NetExposureHedger
The net position that has to be held at the exchange per instrument, the one actually held there on the hedging portfolio, and the hedges already sent to close the difference between them.
构造函数
public NetExposureHedger(IReadOnlyDictionary<SecurityId, NetExposureLimit> limits, string portfolioName, IdGenerator idGenerator)
netExposureHedger = NetExposureHedger(limits, portfolioName, idGenerator)
Initializes a new instance of the NetExposureHedger.
- limits
- How far each instrument may run before its gap is closed. An instrument not named here is never hedged. The table is read on every row, so one named later is hedged from then on.
- portfolioName
- The portfolio a hedge is placed on, which has to reach the exchange.
- idGenerator
- Where the transaction id of a hedge order comes from.
属性
public int Count { get; }
value = netExposureHedger.Count
How many capped instruments anything is known about. An instrument the table does not name is not one of them, whatever has been stated about it.
public bool IsHedging { get; }
value = netExposureHedger.IsHedging
Whether any instrument is capped at all. Capping none is how the table says nothing is ever hedged.
public string PortfolioName { get; }
value = netExposureHedger.PortfolioName
The portfolio a hedge is placed on, which has to reach the exchange.
方法
public bool HedgeFinished(long transactionId)
result = netExposureHedger.HedgeFinished(transactionId)
A hedge order is no longer on its way - it filled, or it never reached the exchange.
- transactionId
- The transaction the hedge was produced under.
返回值: when the transaction was a hedge still reserving part of the gap.
public OrderRegisterMessage SetExposure(SecurityId securityId, decimal volume, decimal averagePrice)
result = netExposureHedger.SetExposure(securityId, volume, averagePrice)
States the net position that has to be held at the exchange on an instrument.
- securityId
- The instrument.
- volume
- The signed position that has to be there.
- averagePrice
- What the exposure is worth a unit, or zero when nothing is known. The uncovered gap is what the money cap measures at this price.
返回值: The order that closes the gap, or when none is due.
public OrderRegisterMessage SetHedgePosition(SecurityId securityId, decimal volume, decimal averagePrice)
result = netExposureHedger.SetHedgePosition(securityId, volume, averagePrice)
States the net position the hedging portfolio actually holds at the exchange on an instrument.
- securityId
- The instrument.
- volume
- The signed position that is there.
- averagePrice
- What the hedging portfolio holds it at a unit, or zero when nothing is known. This prices what is covered already, which the money cap does not measure.
返回值: The order that closes the gap, or when none is due.