Click or drag to resize

HedgeStrategy Class

The base strategy of hedging.
Inheritance Hierarchy

Namespace:  StockSharp.Algo.Strategies.Derivatives
Assembly:  StockSharp.Algo.Strategies (in StockSharp.Algo.Strategies.dll) Version: 4.3.27.2 (4.3.27.2)
Syntax
C#
public abstract class HedgeStrategy : Strategy

The HedgeStrategy type exposes the following members.

Constructors
  NameDescription
Protected methodHedgeStrategy
Initialize HedgeStrategy.
Top
Properties
  NameDescription
Protected propertyBlackScholes
Portfolio model for calculating the values of Greeks by the Black-Scholes formula.
Public propertyCancelOrdersWhenStopping
To cancel active orders at stop. Is On by default.
(Inherited from Strategy.)
Public propertyChildStrategies
Subsidiary trade strategies.
(Inherited from Strategy.)
Public propertyCommentOrders
To add to Comment the name of the strategy Name, registering the order.
(Inherited from Strategy.)
Public propertyCommission
Total commission.
(Inherited from Strategy.)
Public propertyConnector
Connection to the trading system.
(Inherited from Strategy.)
Public propertyCurrentTime
Current time, which will be passed to the Time.
(Inherited from Strategy.)
Public propertyDisposeOnStop
Automatically to clear resources, used by the strategy, when it stops (state ProcessState becomes equal to Stopped) and delete it from the parent strategy through ChildStrategies.
(Inherited from Strategy.)
Public propertyEnvironment
Strategy environment parameters.
(Inherited from Strategy.)
Public propertyErrorCount
The current number of errors.
(Inherited from Strategy.)
Public propertyErrorState
The state of an error.
(Inherited from Strategy.)
Public propertyId
The unique identifier of the source.
(Inherited from Strategy.)
Public propertyIsDisposed (Inherited from Disposable.)
Public propertyIsRoot
Whether the source is the root (even if Parent is not equal to ).
(Inherited from BaseLogSource.)
Public propertyIsRulesSuspended
Is rules execution suspended.
(Inherited from Strategy.)
Public propertyLatency
Total latency.
(Inherited from Strategy.)
Public propertyLogLevel
The logging level. The default is set to Inherit.
(Inherited from Strategy.)
Public propertyMaxErrorCount
The maximal number of errors, which strategy shall receive prior to stop operation.
(Inherited from Strategy.)
Public propertyMyTrades
Trades, matched during the strategy operation.
(Inherited from Strategy.)
Public propertyName
Strategy name.
(Inherited from Strategy.)
Public propertyNameGenerator
The generator of strategy name.
(Inherited from Strategy.)
Public propertyOrderFails
Orders with errors, registered within the strategy.
(Inherited from Strategy.)
Public propertyOrders
Orders, registered within the strategy framework.
(Inherited from Strategy.)
Public propertyOrdersKeepTime
The time for storing Orders and StopOrders orders in memory. By default it equals to 2 days. If value is set in Zero, orders will not be deleted.
(Inherited from Strategy.)
Public propertyParameters
Strategy parameters.
(Inherited from Strategy.)
Public propertyParent
Parent.
(Inherited from BaseLogSource.)
Public propertyPnL
The aggregate value of profit-loss without accounting commission Commission.
(Inherited from Strategy.)
Public propertyPnLManager
The profit-loss manager. It accounts trades of this strategy, as well as of its subsidiary strategies ChildStrategies.
(Inherited from Strategy.)
Public propertyPortfolio
Portfolio.
(Inherited from Strategy.)
Public propertyPosition
The position aggregate value.
(Inherited from Strategy.)
Public propertyPositionManager
The position manager. It accounts trades of this strategy, as well as of its subsidiary strategies ChildStrategies.
(Inherited from Strategy.)
Public propertyPriceOffset
The price shift for the registering order. It determines the amount of shift from the best quote (for the buy it is added to the price, for the sell it is subtracted).
Public propertyProcessState
The operation state.
(Inherited from Strategy.)
Public propertyRiskManager
The risks control manager.
(Inherited from Strategy.)
Public propertyRules
Registered rules.
(Inherited from Strategy.)
Public propertySecurity
Security.
(Inherited from Strategy.)
Public propertySlippage
Total slippage.
(Inherited from Strategy.)
Public propertyStartedTime
Strategy start time.
(Inherited from Strategy.)
Public propertyStatisticManager
The statistics manager.
(Inherited from Strategy.)
Public propertyStopOrders
Stop-orders, registered within the strategy framework.
(Inherited from Strategy.)
Public propertyTotalWorkingTime
The total time of strategy operation less time periods, when strategy was stopped.
(Inherited from Strategy.)
Public propertyUnrealizedPnLInterval
The interval for unrealized profit recalculation. The default value is 1 minute.
(Inherited from Strategy.)
Public propertyUseQuoting
Whether to quote the registered order by the market price. The default mode is disabled.
Public propertyVolume
Operational volume.
(Inherited from Strategy.)
Public propertyWaitAllTrades
Stop strategy only after getting all trades by registered orders.
(Inherited from Strategy.)
Top
Methods
  NameDescription
Protected methodAddReHedgeOrder
To add the rehedging order.
Protected methodAddReHedgeQuoting
To add the rehedging strategy.
Protected methodAssignOrderStrategyId
To set the strategy identifier for the order.
(Inherited from Strategy.)
Public methodAttachOrder
To add the active order to the strategy and process trades by the order.
(Inherited from Strategy.)
Public methodCancelActiveOrders
To cancel all active orders (to stop and regular).
(Inherited from Strategy.)
Public methodCancelOrder
Cancel order.
(Inherited from Strategy.)
Public methodClone
Create a copy of Strategy.
(Inherited from Strategy.)
Protected methodCreateQuoting
To create a quoting strategy to change the position.
Public methodDispose (Inherited from Disposable.)
Protected methodDisposeManaged
Release resources.
(Inherited from Strategy.)
Protected methodDisposeNative (Inherited from Disposable.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Inherited from Disposable.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLevel1Fields
To get a set of available fields Level1Fields, for which there is a market data for the instrument.
(Inherited from Strategy.)
Public methodGetMarketDepth
To get the quotes order book.
(Inherited from Strategy.)
Protected methodGetNotificationRules
To get a list of rules on which the rehedging will respond.
Protected methodGetReHedgeOrders
To get a list of orders rehedging the option position.
Public methodGetSecurityValue
To get the value of market data for the instrument.
(Inherited from Strategy.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsSuspended
Whether the rehedging is paused.
Public methodLoad
Load settings.
(Inherited from Strategy.)
Public methodLookup
Lookup securities by criteria criteria.
(Inherited from Strategy.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnError
Processing of error, occurred as result of strategy operation.
(Inherited from Strategy.)
Protected methodOnNewMyTrade
The method, called at occurrence of new strategy trade.
(Inherited from Strategy.)
Protected methodOnOrderCanceling
To call the event OrderRegistered.
(Inherited from Strategy.)
Protected methodOnOrderChanged
The method, called at strategy order change.
(Inherited from Strategy.)
Protected methodOnOrderRegistered
To call the event OrderRegistered.
(Inherited from Strategy.)
Protected methodOnOrderRegisterFailed
The method, called at strategy order registration error.
(Inherited from Strategy.)
Protected methodOnOrderRegistering
To call the event OrderRegistering.
(Inherited from Strategy.)
Protected methodOnOrderReRegistering
To call the event OrderReRegistering.
(Inherited from Strategy.)
Protected methodOnPositionChanged
The method, called at strategy position change.
(Inherited from Strategy.)
Protected methodOnReseted (Inherited from Strategy.)
Protected methodOnStarted
The method is called when the Start method has been called and the ProcessState state has been taken the Started value.
(Overrides StrategyOnStarted.)
Protected methodOnStopOrderCanceling
To call the event StopOrderRegistered.
(Inherited from Strategy.)
Protected methodOnStopOrderChanged
The method, called at strategy stop order change.
(Inherited from Strategy.)
Protected methodOnStopOrderRegistered
To call the event StopOrderRegistered.
(Inherited from Strategy.)
Protected methodOnStopOrderRegisterFailed
The method, called at strategy stop order registration error.
(Inherited from Strategy.)
Protected methodOnStopOrderRegistering
To call the event StopOrderRegistering.
(Inherited from Strategy.)
Protected methodOnStopOrderReRegistering
To call the event StopOrderReRegistering.
(Inherited from Strategy.)
Protected methodOnStopOrdersChanged
The method, called at strategy stop orders change.
(Inherited from Strategy.)
Protected methodOnStopped
The method is called when the ProcessState process state has been taken the Stopped value.
(Inherited from Strategy.)
Protected methodOnStopping
The method is called when the ProcessState process state has been taken the Stopping value.
(Inherited from Strategy.)
Protected methodProcessCancelActiveOrders
To cancel all active orders (to stop and regular).
(Inherited from Strategy.)
Protected methodProcessNewOrders
To process orders, received for the connection Connector, and find among them those, belonging to the strategy.
(Inherited from Strategy.)
Protected methodRaiseLog
To call the event Log.
(Inherited from Strategy.)
Protected methodRaiseParametersChanged
To call events ParametersChanged and PropertyChanged.
(Inherited from Strategy.)
Protected methodRaiseProcessStateChanged
To call the event ProcessStateChanged.
(Inherited from Strategy.)
Public methodRegisterOrder
To register the order and automatically add to start mechanism of profit-loss and slippage.
(Inherited from Strategy.)
Protected methodReHedge
To start rehedging.
Public methodReRegisterOrder
To re-register the order and automatically add to start mechanism of profit-loss and slippage.
(Inherited from Strategy.)
Public methodReset
To re-initialize the trade algorithm. It is called after initialization of the strategy object and loading stored parameters.
(Inherited from Strategy.)
Public methodSafeGetConnector
To get the strategy getting Connector. If it is not initialized, the exception will be discarded.
(Inherited from Strategy.)
Public methodSave
Save settings.
(Inherited from Strategy.)
Public methodStart
To start the trade algorithm.
(Inherited from Strategy.)
Public methodStop
To stop the trade algorithm.
(Inherited from Strategy.)
Protected methodThrowIfDisposed (Inherited from Disposable.)
Public methodToString
Returns a string that represents the current object.
(Inherited from BaseLogSource.)
Top
Events
  NameDescription
Public eventCommissionChanged
Commission change event.
(Inherited from Strategy.)
Public eventConnectorChanged
The event of strategy connection change.
(Inherited from Strategy.)
Public eventError
The event of error occurrence in the strategy.
(Inherited from Strategy.)
Public eventLatencyChanged
Latency change event.
(Inherited from Strategy.)
Public eventLog
New debug message event.
(Inherited from BaseLogSource.)
Public eventNewMyTrade
The event of new trade occurrence.
(Inherited from Strategy.)
Public eventOrderCancelFailed
The event of order cancelling order.
(Inherited from Strategy.)
Public eventOrderCanceling
The event of sending order for cancelling.
(Inherited from Strategy.)
Public eventOrderChanged
The event of order change.
(Inherited from Strategy.)
Public eventOrderRegistered
The event of order successful registration.
(Inherited from Strategy.)
Public eventOrderRegisterFailed
The event of order registration error.
(Inherited from Strategy.)
Public eventOrderRegistering
The event of sending order for registration.
(Inherited from Strategy.)
Public eventOrderReRegistering
The event of sending order for re-registration.
(Inherited from Strategy.)
Public eventParametersChanged
Parameters change event.
(Inherited from Strategy.)
Public eventPnLChanged
PnL change event.
(Inherited from Strategy.)
Public eventPortfolioChanged
The event of strategy portfolio change.
(Inherited from Strategy.)
Public eventPositionChanged
Position change event.
(Inherited from Strategy.)
Public eventPositionChanged2
The event of strategy position change.
(Inherited from Strategy.)
Public eventProcessStateChanged
ProcessState change event.
(Inherited from Strategy.)
Public eventPropertyChanged
The event of strategy parameters change.
(Inherited from Strategy.)
Public eventReseted
The event of the strategy re-initialization.
(Inherited from Strategy.)
Public eventSecurityChanged
The event of strategy instrument change.
(Inherited from Strategy.)
Public eventSlippageChanged
Slippage change event.
(Inherited from Strategy.)
Public eventStopOrderCancelFailed
The event of stop-order cancelling order.
(Inherited from Strategy.)
Public eventStopOrderCanceling
The event of sending stop-order for cancelling.
(Inherited from Strategy.)
Public eventStopOrderChanged
The event of stop-order change.
(Inherited from Strategy.)
Public eventStopOrderRegistered
The event of stop-order successful registration.
(Inherited from Strategy.)
Public eventStopOrderRegisterFailed
The event of stop-order registration error.
(Inherited from Strategy.)
Public eventStopOrderRegistering
The event of sending stop-order for registration.
(Inherited from Strategy.)
Public eventStopOrderReRegistering
The event of sending stop-order for re-registration.
(Inherited from Strategy.)
Public eventValuesChanged
Security changed.
(Inherited from Strategy.)
Top
Extension Methods
  NameDescription
Public Extension MethodBuyAtLimit
To create the initialized order object for buy.
(Defined by StrategyHelper.)
Public Extension MethodBuyAtMarket
To create initialized object of buy order at market price.
(Defined by StrategyHelper.)
Public Extension MethodClosePosition
To close open position by market (to register the order of the type Market).
(Defined by StrategyHelper.)
Public Extension MethodClosePositionByQuoting
To close the open position via quoting.
(Defined by Extensions.)
Public Extension MethodCreateOrder
To create the initialized order object.
(Defined by StrategyHelper.)
Public Extension MethodGetCandleManager
To get the candle manager, associated with the passed strategy.
(Defined by StrategyHelper.)
Public Extension MethodGetChart
To get the chart associated with the passed strategy.
(Defined by ChartHelper.)
Public Extension MethodGetIsEmulation
To get the strategy start-up mode (paper trading or real).
(Defined by StrategyHelper.)
Public Extension MethodGetIsInitialization
To get the strategy operation mode (initialization or trade).
(Defined by StrategyHelper.)
Public Extension MethodGetSecurityValueT
To get market data value for the strategy instrument.
(Defined by StrategyHelper.)
Public Extension MethodLoadState
To restore the strategy state.
(Defined by StrategyHelper.)
Public Extension MethodOpenPositionByQuoting
To open the position via quoting.
(Defined by Extensions.)
Public Extension MethodParamT (Defined by StrategyParamHelper.)
Public Extension MethodSellAtLimit
To create the initialized order object for sell.
(Defined by StrategyHelper.)
Public Extension MethodSellAtMarket
To create the initialized order object of sell order at market price.
(Defined by StrategyHelper.)
Public Extension MethodSetCandleManager
To set the candle manager for the strategy.
(Defined by StrategyHelper.)
Public Extension MethodSetChart
To set a chart for the strategy.
(Defined by ChartHelper.)
Public Extension MethodSetIsEmulation
To get the strategy start-up mode (paper trading or real).
(Defined by StrategyHelper.)
Public Extension MethodSetIsInitialization
To set the strategy operation mode (initialization or trade).
(Defined by StrategyHelper.)
Public Extension MethodWhenError
To create a rule for event of strategy error (transition of state ErrorState into Error).
(Defined by StrategyHelper.)
Public Extension MethodWhenNewMyTrade
To create a rule for the event of occurrence new strategy trade.
(Defined by StrategyHelper.)
Public Extension MethodWhenOrderChanged
To create a rule for event of change of any strategy order.
(Defined by StrategyHelper.)
Public Extension MethodWhenOrderRegistered
To create a rule for event of occurrence of new strategy order.
(Defined by StrategyHelper.)
Public Extension MethodWhenPnLChanged
To create a rule for event of profit change.
(Defined by StrategyHelper.)
Public Extension MethodWhenPnLLess
To create a rule for event of profit reduction below the specified level.
(Defined by StrategyHelper.)
Public Extension MethodWhenPnLMore
To create a rule for event of profit increase above the specified level.
(Defined by StrategyHelper.)
Public Extension MethodWhenPositionChanged
To create a rule for the event of strategy position change.
(Defined by StrategyHelper.)
Public Extension MethodWhenPositionLess
To create a rule for event of position event reduction below the specified level.
(Defined by StrategyHelper.)
Public Extension MethodWhenPositionMore
To create a rule for event of position event increase above the specified level.
(Defined by StrategyHelper.)
Public Extension MethodWhenStarted
To create a rule for event of start of strategy operation.
(Defined by StrategyHelper.)
Public Extension MethodWhenStopped
To create a rule for event full stop of strategy operation.
(Defined by StrategyHelper.)
Public Extension MethodWhenStopping
To create a rule for event of beginning of the strategy operation stop.
(Defined by StrategyHelper.)
Public Extension MethodWhenWarning
To create a rule for event of strategy warning (transition of state ErrorState into Warning).
(Defined by StrategyHelper.)
Top
See Also