Click or drag to resize

Strategy Class

Inheritance Hierarchy

Namespace: ArthaChitra.Model.SharpScript
Assembly: ArthaChitra.Core (in ArthaChitra.Core.dll) Version: 2.0.3.0
Syntax
C#
public abstract class Strategy : IndicatorBase

The Strategy type exposes the following members.

Constructors
 NameDescription
Public methodStrategy 
Top
Properties
 NameDescription
Public propertyAccount Gets or sets the account associated with the strategy. This property can be set only when the strategy is in Initialize state.
Public propertyAxisOrientation
(Inherited from ChartVisualBase)
Public propertyBarsArray
(Inherited from IndicatorBase)
Protected propertyBarsInProgress
(Inherited from IndicatorBase)
Public propertyBufferSize Gets or sets the buffer size. This property can be set only when the State is in Initialize state
(Inherited from IndicatorBase)
Public propertyCalculate Gets or sets the Calculate mode. This property can be set only when the State is in Initialize state
(Inherited from IndicatorBase)
Public propertyCanUserModifyOrders Gets or sets if the order as submitted by the strategy can be further changed/cancelled by user manually (from Chart or DOM etc). The property should be set when the strategy is in Initialize state. Note : The Orders will always be available in the Main View
Protected propertyClose
(Inherited from IndicatorBase)
Protected propertyCloses
(Inherited from IndicatorBase)
Public propertyConnectionLossHandling Gets the Connection loss handling type. This can be set via Settings > Options > Strategy tab
Public propertyConnectionTimeoutSeconds Gets the connection timeout seconds up which the strategy will be disabled on connection loss. This can be set via Settings > Options > Strategy tab
Public propertyCount
(Inherited from IndicatorBase)
Protected propertyCurrentBar
(Inherited from IndicatorBase)
Public propertyCurrentBars
(Inherited from IndicatorBase)
Protected propertyDialogService
(Inherited from ServiceBase)
Protected propertyDispatcher Gets the dispatcher
(Inherited from SharpScriptBase)
Public propertyDisplayName
(Inherited from IndicatorBase)
Public propertyEntriesPerDirection Gets or sets the entries per direction. This property can be set only when the strategy is in Initialize state.
Public propertyEntryHandling Gets or sets the Entry Handling type. This property can be set only when the strategy is in Initialize state.
Public propertyError Gets the Error string
(Inherited from ServiceBase)
Protected propertyFileService
(Inherited from ServiceBase)
Public propertyFill Gets the IFill
Protected propertyHigh
(Inherited from IndicatorBase)
Public propertyHighestHigh
(Inherited from IndicatorBase)
Protected propertyHighs
(Inherited from IndicatorBase)
Public propertyIndicators
(Inherited from IndicatorBase)
Public propertyInput
(Inherited from IndicatorBase)
Public propertyInputSerializerHelper
(Inherited from IndicatorBase)
Protected propertyInstrument
(Inherited from IndicatorBase)
Public propertyInstruments
(Inherited from IndicatorBase)
Public propertyIsAutoScale
(Inherited from ChartVisualBase)
Public propertyIsCloseObsolete.
Specifies what value an empty series node will return. If true, will return the Close price of the corresponding IBars index. If false, will return NaN
(Inherited from IndicatorBase)
Public propertyIsEnabled Gets or sets IsEnabled property.
Protected propertyIsFirstTickOfBar
(Inherited from IndicatorBase)
Public propertyIsFirstTickOfBars
(Inherited from IndicatorBase)
Public propertyIsHistoricalOrder Returns if historical order will be submitted or not
Public propertyIsSelected
(Inherited from IndicatorBase)
Public propertyIsSharpScript Gets if the drawing object is created by a sharpScript code
(Inherited from ChartVisualBase)
Public propertyIsUserManaged Gets or sets if the strategy is user managed or not. The property should be set when the strategy is in Initialize state
Protected propertyIsValueChanged
(Inherited from ChartVisualBase)
Public propertyIsVisible
(Inherited from ChartVisualBase)
Public propertyItemInt32
(Inherited from IndicatorBase)
Public propertyItemString Gets the IDataErrorInfo error string
(Inherited from ServiceBase)
Public propertyLast
(Inherited from IndicatorBase)
Protected propertyLastSelectedIndex Gets the last selected series index
(Inherited from IndicatorBase)
Public propertyLineHitTestWidth
(Inherited from ChartVisualBase)
Public propertyLines Gets or sets the Lines
(Inherited from IndicatorBase)
Protected propertyLow
(Inherited from IndicatorBase)
Public propertyLowestLow
(Inherited from IndicatorBase)
Protected propertyLows
(Inherited from IndicatorBase)
Protected propertyMedian
(Inherited from IndicatorBase)
Protected propertyMedians
(Inherited from IndicatorBase)
Protected propertyMessageBox
(Inherited from ServiceBase)
Public propertyName Gets the name
(Inherited from SharpScriptBase)
Protected propertyOpen
(Inherited from IndicatorBase)
Protected propertyOpenInterest
(Inherited from IndicatorBase)
Protected propertyOpenInterests
(Inherited from IndicatorBase)
Protected propertyOpens
(Inherited from IndicatorBase)
Public propertyOrders 
Public propertyPanelIndex
(Inherited from ChartVisualBase)
Public propertyParent
(Inherited from IndicatorBase)
Public propertyPlots
(Inherited from IndicatorBase)
Public propertyPosition Gets the current strategy position
Public propertyPositions Gets the positions collection
Public propertyProductType Gets or sets the order productType. The property should be set when the strategy is in Initialize state.
Public propertyQuantity 
Public propertyRealtimeErrorHandling Gets the real time error handing type. This can be set via Settings > Options > Strategy tab
Public propertySelectedSeriesIndex
(Inherited from IndicatorBase)
Protected propertySingletonService
(Inherited from ServiceBase)
Public propertySlippage Gets or sets the slippage (in ticks) when a historical order is filled. Default value = 1, Minimum value = 0.0.
Public propertyState Gets the current State of the script
(Inherited from SharpScriptBase)
Public propertyStatic memberStrategies 
Public propertyTemplate
(Overrides SharpScriptBaseTemplate)
Protected propertyTime
(Inherited from IndicatorBase)
Public propertyTimeInForce Gets or sets the time in force. This property can be set only when the strategy is in Initialize state.
Protected propertyTimes
(Inherited from IndicatorBase)
Protected propertyCode exampleTraceOrders Prints the order messages in the Output View when set to true
Public propertyTrades 
Public propertyTransactions 
Public propertyStatic memberTypes 
Protected propertyTypical
(Inherited from IndicatorBase)
Protected propertyTypicals
(Inherited from IndicatorBase)
Public propertyValues
(Inherited from IndicatorBase)
Protected propertyVolume
(Inherited from IndicatorBase)
Protected propertyVolumes
(Inherited from IndicatorBase)
Protected propertyWeighted
(Inherited from IndicatorBase)
Protected propertyWeighteds
(Inherited from IndicatorBase)
Top
Methods
 NameDescription
Protected methodAddBars(BarType)
(Inherited from IndicatorBase)
Protected methodAddBars(String)
(Inherited from IndicatorBase)
Protected methodAddBars(String, BarType)
(Inherited from IndicatorBase)
Protected methodAddBars(String, BarType, String, DateTime, DateTime, BackfillPolicy)
(Inherited from IndicatorBase)
Protected methodAddContextMenu
(Inherited from IndicatorBase)
Public methodAddIndicatorT Adds and/or retrieves sharp script from the cache
(Inherited from IndicatorBase)
Public methodAddIndicatorT(ISeriesDouble) Adds and/or retrieves sharp script from the cache
(Inherited from IndicatorBase)
Public methodAddIndicatorT(Object) Adds and/or retrieves and sharp script from the cache
(Inherited from IndicatorBase)
Public methodAddIndicatorT(ISeriesDouble, Object) Adds and/or retrieves and sharp script from the cache
(Inherited from IndicatorBase)
Protected methodAddLine(String, Double, Pen)
(Inherited from IndicatorBase)
Protected methodAddLine(String, Double, Brush, Double)
(Inherited from IndicatorBase)
Protected methodAddMenuItem
(Inherited from IndicatorBase)
Protected methodAddPlot(String, PlotStyle, Pen, Boolean)
(Inherited from IndicatorBase)
Protected methodAddPlot(String, PlotStyle, Brush, Double, Boolean)
(Inherited from IndicatorBase)
Protected methodAlert(String, String)
(Inherited from ChartVisualBase)
Protected methodAlert(String, String, TimeSpan)
(Inherited from ChartVisualBase)
Protected methodAlert(String, Priority, Brush, String)
(Inherited from ChartVisualBase)
Protected methodAlert(String, Priority, Brush, String, TimeSpan)
(Inherited from ChartVisualBase)
Protected methodAlert(String, IInstrument, Priority, Brush, String, TimeSpan) Shoots an alert. The alert is triggered only when the State is Realtime
(Inherited from SharpScriptBase)
Protected methodBarsSinceTrade(IOrder) Returns the number of bars that have elapsed since the order entry for the primary Bars series
Protected methodBarsSinceTrade(Int32, IOrder) Returns the number of bars that have elapsed since the order entry
Protected methodCalculateMinMax
(Inherited from IndicatorBase)
Protected methodCalculatePriceFromY(Double, ChartVisualArgs)
(Inherited from VisualBase)
Protected methodCalculatePriceFromY(Double, Double, Double, Double, Double, ScaleType)
(Inherited from VisualBase)
Protected methodCalculateXFromBarIndex
(Inherited from VisualBase)
Protected methodCalculateYFromPrice(Double, ChartVisualArgs)
(Inherited from VisualBase)
Protected methodCalculateYFromPrice(Double, Double, Double, Double, Double, ScaleType)
(Inherited from VisualBase)
Public methodCancelOrder Cancels an order
Protected methodCanRender
(Inherited from IndicatorBase)
Public methodChangeOrder Change an order Will be ignore if order is not user managed
Public methodCloseAllPositions Closes the position accross all bars indexes
Public methodClosePosition Cancels all pending orders and closes exiting position. Market order is submitted to close the position. If Connection does not supports market order then a limit order is submitted.
Public methodClosePosition(Int32) Cancels all pending orders and closes exiting position. Market order is submitted to close the position. If Connection does not supports market order then a limit order is submitted.
Public methodCrossAbove(Double, ISeriesDouble, Int32) Evaluates when value crosses above a series
(Inherited from IndicatorBase)
Public methodCrossAbove(ISeriesDouble, ISeriesDouble, Int32) Evaluates when 2 (two) series crosses each other
(Inherited from IndicatorBase)
Public methodCrossAbove(ISeriesDouble, Double, Int32) Evaluates when the series crosses above the value
(Inherited from IndicatorBase)
Public methodCrossBelow(Double, ISeriesDouble, Int32) Evaluates when a value crosses below a series
(Inherited from IndicatorBase)
Public methodCrossBelow(ISeriesDouble, ISeriesDouble, Int32) Evaluates when 2 (two) series crosses below each other
(Inherited from IndicatorBase)
Public methodCrossBelow(ISeriesDouble, Double, Int32) Evaluates when series crosses below a value
(Inherited from IndicatorBase)
Public methodDisable Disables the strategy. Pending orders will be canceled or not will be determined via Settings > Options > Strategies tab > CanCancelPendingOrders property. Position will be closed or not will be determined via Settings > Options > Strategies tab > CanClosePosition property.
Public methodEnterLong Enters a long position. The entry name is set to the default 'Strategy Entry'. Order quantity will be as specified by the strategy Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterLong(Int32) Enters a long position. The entry name is set to the default 'Strategy Entry' Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterLong(String) Enters a long position with a specified name. Order quantity will be as specified by the strategy Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterLong(Int32, Int32) Enters a long position for the specified bars index and with specified quantity.
Public methodEnterLong(String, Int32) Enters a long position with a specified name and quantity Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterLong(Int32, String, Int32) Enters a long position for the specified bars index with specified name and quantity Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterLongLimit(Double) Submits a long limit order. The entry name is set to the default 'Strategy Entry'. Order quantity will be as specified by the strategy
Public methodEnterLongLimit(Int32, Double) Submits a long limit order with the specified quantity and limit price.
Public methodEnterLongLimit(String, Double) Submits a long limit order with a specified name. Order quantity will be as specified by the strategy
Public methodEnterLongLimit(Int32, Int32, Double) Submits a long limit order to the specified bars index, with specified quantity
Public methodEnterLongLimit(String, Int32, Double) Submits a long limit order with the specified name and quantity
Public methodEnterLongLimit(Int32, String, Int32, Double) Submits a long limit order to the specified bars index with specified name and quantity
Public methodEnterShort Enters a short position. The entry name is set to the default 'Strategy Entry' Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShort(Int32) Enters a short position with the specifed quantity. The entry name is set to the default 'Strategy Entry' Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShort(String) Enters a short position. Order quantity will be as specified by the strategy Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShort(Int32, Int32) Enters a short position for the specified bars index and the specified quantity Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShort(String, Int32) Enters a short position with the specifed name and quantity. Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShort(Int32, String, Int32) Enters a short position for the specified bars index and specified name and quantity Market order is submitted. If Connection does not supports market order then a limit order is submitted.
Public methodEnterShortLimit(Double) Submits a short limit order. The entry name is set to the default 'Strategy Entry'. Order quantity will be as specified by the strategy
Public methodEnterShortLimit(Int32, Double) Submits a short limit order with the specified quantity and limit price
Public methodEnterShortLimit(String, Double) Submits a short limit order with the specified name. Order quantity will be as specified by the strategy
Public methodEnterShortLimit(Int32, Int32, Double) Submits a short limit order for the specified bars index and specified quantity
Public methodEnterShortLimit(String, Int32, Double) Submits a short limit order with specified name and quantity
Public methodEnterShortLimit(Int32, String, Int32, Double) Submits a short limit order for the specified bars index and specified name and quantity
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExitPosition Exits positions as entered via entry order with entry name as Strategy Entry (default entry name) Market order is submitted to close the position. If Connection does not supports market order then a limit order is submitted.
Public methodExitPosition(Int32) Exits a position
Public methodExitPosition(String) Exits positions as entered via entry order with entry name as Strategy Entry (default entry name) Market order is submitted to close the position. If Connection does not supports market order then a limit order is submitted.
Public methodExitPosition(Int32, String) Exits a position
Protected methodFinalize
(Inherited from SharpScriptBase)
Protected methodGetHandleCursor Returns the handle cursor
(Inherited from ChartVisualBase)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLastPrice Returns the last traded price. In case the real time price is not available the closing value of the last available bar is returned
(Inherited from IndicatorBase)
Public methodGetOrAddT
(Inherited from IndicatorBase)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodGetValue
(Inherited from NotifyPropertyBase)
Public methodHasValue
(Inherited from IndicatorBase)
Public methodInvalidateView
(Inherited from ChartVisualBase)
Protected methodInvokeAsync Invoke any action. It is recommended to draw any [!:ChartObject.DrawingBase] by invoking this method
(Inherited from SharpScriptBase)
Public methodIsInputEquals Compares two input
(Inherited from IndicatorBase)
Protected methodLog(String) Logs a message with Low
(Inherited from SharpScriptBase)
Protected methodLog(Priority, String) Logs a message with the specified Priority
(Inherited from SharpScriptBase)
Protected methodLog(Priority, Brush, String) Logs a message with the specified Priority and defined brush
(Inherited from SharpScriptBase)
Protected methodMakeHitTest
(Inherited from IndicatorBase)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodMove
(Inherited from IndicatorBase)
Protected methodNotifyPropertyChanged
(Inherited from SharpScriptBase)
Protected methodOnBarUpdate
(Inherited from IndicatorBase)
Protected methodOnConnectionStatus 
Protected methodOnFill Updates when a ITrade takes place
Protected methodOnLevel1
(Inherited from IndicatorBase)
Protected methodOnLevel2
(Inherited from IndicatorBase)
Protected methodOnOrderUpdate Updates when the IOrder gets updated
Protected methodOnPositionUpdate Updates when the position gets updated
Protected methodOnRender
(Inherited from IndicatorBase)
Protected methodOnRenderYAxis
(Inherited from IndicatorBase)
Protected methodOnStateChange Invoked when the State changes
(Inherited from SharpScriptBase)
Protected methodPlaySound
(Inherited from SharpScriptBase)
Protected methodPrint(String, String) Prints a message with Low
(Inherited from SharpScriptBase)
Protected methodPrint(Brush, String, String) Prints a message with a defined foreground brush
(Inherited from SharpScriptBase)
Protected methodPrint(Priority, String, String) Prints a message with the defined Priority
(Inherited from SharpScriptBase)
Public methodRefreshView
(Inherited from IndicatorBase)
Protected methodRound Rounds the value with the factor as defined in Options > General tab > RoundFactor
(Inherited from SharpScriptBase)
Protected methodSelectionSteps
(Inherited from VisualBase)
Protected methodSetOverrideBrush
(Inherited from IndicatorBase)
Protected methodSetOverridePen(Pen, Int32)
(Inherited from IndicatorBase)
Protected methodSetOverridePen(Pen, Int32, Int32)
(Inherited from IndicatorBase)
Protected methodSetStop(Double) Submits a new stop order for entry orders with entry name as 'Strategy Entry' (default entry order name) If stop order with the same entry order name exits, then changes the order if the stop price differs This method will be ignored if set when the Strategy is in Initialized state
Protected methodSetStop(Double, CalculationMode) Submits a stop order for entry orders with entry name as 'Strategy Entry' (default entry name) If stop order with the same entry order name exists, then changes the order if the stop price differs. If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place an stop order as defined by the method
Protected methodSetStop(Double, String) Submits a new stop order. If stop order with the same entry order name exits, then changes the order if the stop price differs This method will be ignored if set when the Strategy is in Initialized state
Protected methodSetStop(Int32, Double) Submits a new stop order for the specified bars index. If stop order with the same entry order name exits, then changes the order if the stop price differs This method will be ignored if set when the Strategy is in Initialized state
Protected methodSetStop(Double, CalculationMode, String) Submits a stop order. If stop order with the same entry order name exits, then changes the order if the stop price differs. If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place an stop order as defined by the method
Protected methodSetStop(Int32, Double, CalculationMode) Submits a stop order for the specified bars index. If stop order with the same entry order name exits, then changes the order if the stop price differs. If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place an stop order as defined by the method
Protected methodSetStop(Int32, Double, String) Submits a new stop order for the specified bars index. If stop order with the same entry order name exits, then changes the order if the stop price differs This method will be ignored if set when the Strategy is in Initialized state
Protected methodSetStop(Int32, Double, CalculationMode, String) Submits a stop order for the specified bars index. If stop order with the same entry order name exits, then changes the order if the stop price differs. If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place an stop order as defined by the method
Protected methodSetTarget(Double) Submits a limit order. If a limit order with the same entry order name exits then changes that order if the price differs This method will be ignored if called when the strategy is in Initialized state
Protected methodSetTarget(Double, CalculationMode) Submits a limit order. If a limit order with the same entry order name exits then changes that order if the price differs If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place a target order as defined by the method
Protected methodSetTarget(Double, String) Submits a limit order. If a limit order with the same entry order name exits then changes that order if the price differs This method will be ignored if called when the strategy is in Initialized state
Protected methodSetTarget(Int32, Double) Submits a limit order for the specified bars index. If a limit order with the same entry order name exits then changes that order if the price differs This method will be ignored if called when the strategy is in Initialized state
Protected methodSetTarget(Double, CalculationMode, String) Submits a limit order. If a limit order with the same entry order name exits then changes that order if the price differs If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place a target order as defined by the method
Protected methodSetTarget(Int32, Double, CalculationMode) Submits a limit order for the specified bars index. If a limit order with the same entry order name exists then changes that order if the price differs If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place a target order as defined by the method
Protected methodSetTarget(Int32, Double, String) Submits a limit order for the specified bars index. If a limit order with the same entry order name exits then changes that order if the price differs This method will be ignored if called when the strategy is in Initialized state
Protected methodSetTarget(Int32, Double, CalculationMode, String) Submits a limit order for the specified bars index. If a limit order with the same entry order name exists then changes that order if the price differs If called when the strategy is in Initialized state then all subsequent entry trades with the same entry name will automatically place a target order as defined by the method
Protected methodSetValue
(Inherited from NotifyPropertyBase)
Protected methodShare Share messages via to social media SocialType The messages will be transmitted only when the state is Realtime
(Inherited from SharpScriptBase)
Public methodSubmitOrder(String, OrderAction, OrderType, Double, Double) Submits an order with the quantity as defined in the Strategy Selector View
Public methodSubmitOrder(String, OrderAction, OrderType, Int32, Double, Double) Submit an order
Public methodSubmitOrder(Int32, String, OrderAction, OrderType, Int32, Double, Double) Submit an order
Public methodSubmitOrder(String, OrderAction, OrderType, Int32, Double, Double, String) Submit an order
Public methodSubmitOrder(Int32, String, OrderAction, OrderType, Int32, Double, Double, String) Submit an order
Public methodToString
(Inherited from IndicatorBase)
Public methodToStringFormat
(Inherited from IndicatorBase)
Protected methodTryRemoveContextMenuItem
(Inherited from IndicatorBase)
Protected methodTryRemoveDrawing
(Inherited from IndicatorBase)
Protected methodTryRemoveMenuItem
(Inherited from IndicatorBase)
Top
Events
 NameDescription
Public eventPropertyChanged
(Inherited from NotifyPropertyBase)
Top
See Also