Skip Navigation Links.

Order Methods

Describes the various order methods that can be called to place an order via a SharpScript Strategy.

Submits a buy market order.
EnterLong()
EnterLong(string name)
EnterLong(int quantity)
EnterLong(string name, int quantity)
Submits a sell market order.
EnterShort()
EnterShort(string name)
EnterShort(int quantity)
EnterShort(string name, int quantity)
 
Parameters
Name Name of the order. If not defined the name is set to default 'Strategy Entry'
Quantity Entry order quantity. If not defined then strategy Quantity property is set.
 
Note: If connection does not supports market orders a limit order will be placed above/below the current market price.

Submits a buy limit order
EnterLongLimit(double limitPrice)
EnterLongLimit(string name, double limitPrice)
EnterLongLimit(string name, int quantity, double limitPrice)
 
Submits a sell limit order
EnterShortLimit(double limitPrice)
EnterShortLimit(string name, double limitPrice)
EnterShortLimit(string name, int quantity, double limitPrice)
 
Parameters
Name Name of the order. If not defined the name is set to the default 'Strategy Entry'
Quantity Entry order quantity. If not defined strategy Quantity property is set.
Limit Price Limit price of the order.
 
Note:
If and limit order with the same order entry name is in working/accepted/part filled state then ArthaChira will change that order instead of submitting a new order provided the limit price differs.

Submits a buy or sell order limit order depending on the entry order action.
SetTarget(double price, CalculationMode calculationMode)
SetTarget(double price, CalculationMode calculationMode, string entryOrderName)
 
Parameters
Price Value of the limit price as calculated from the entry order fill price based on the Calculation Mode
Calculation Mode How the price will be calculated. Possible values are Ticks, Point and Percentage
EntryOrderName Name of the ENTRY order for which the target will be set. If no name is defined then the default name 'Strategy Entry' is set
 
Note:
If called when the Strategy State 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

The price field can be a negative value, except when called when the strategy is in Initialized state. As such any negative value will be converted to an absolute value.

If an order with the same entry name already exists then ArthaChita will change that order instead of submitting a new order provided the limit price differs.

Submits a buy or sell limit order depending on the entry order action
SetTarget(double targetPrice)
SetTarget(double targetPrice, string entryOrderName)
 
Parameters
TargetPrice The actual target price
EntryOrderName Name of the ENTRY order for which the target will be set. If no name is defined then the default name 'Strategy Entry' is set
 
Note:
This method will be ignored if called when the strategy is in Initialized state.

If an order with the same entry name already exists then ArthaChita will change that order instead of submitting a new order provided the limit price differs.

Submits a buy or sell stop market order depending on the entry order action
SetStop(double price, CalculationMode calculationMode)
SetStop(double price, CalculationMode calculationMode, string entryOrderName)
 
Parameters
Price Value of the stop price as calculated from the entry order fill price based on the Calculation Mode
CalculationMode How the price will be calculated. Possible values are Ticks, Point and Percentage
EntryOrderName Name of the ENTRY order for which the stop will be set. If no name is defined then the default name 'Strategy Entry' is set
 
Note:
If called when the Strategy State is in Initialized state, then all subsequent entry trades with the same entry name will automatically place a stop order as defined by the method

The price field can be a negative value, except when called when the strategy is in Initialized state. As such any negative value will be converted to an absolute value.

If an order with the same entry name already exists then ArthaChita will change that order instead of submitting a new order provided the stop price differs.

Submits a stop order depending on the entry order action
SetStop(double stopPrice)
SetStop(double stopPrice, string entryOrderName)
 
Parameters
StopPrice The actual stop price
EntryOrderName Name of the ENTRY order for which the stop will be set. If no name is defined then the default name 'Strategy Entry' is set
 
Note:
This method will be ignored if called when the strategy is in Initialized state.

If connection does not supports stop market orders a stop limit order will be placed.

If an order with the same entry name already exists then ArthaChita will change that order instead of submitting a new order provided the stop price differs.

Exits the position by submitting a market order.
ExitPosition()
ExitPosition(string entryName)
 
Parameters
EntryName Name of the ENTRY order for which the stop will be set. If no name is defined then the default name 'Strategy Entry' is set
 
Note:
If connection does not supports market orders a limit order will be placed above/below the current market price.

Cancels all pending orders and closes the current strategy position
ClosePosition()

Cancels a specific order
CancelOrder(IOrder order)
 
Parameters
Order The order which is to be cancelled

Please refer to the StrategyBase class documentation file for more details on various Strategy methods.