Click or drag to resize

Managed Order Methods

Describes the various order methods that can be called to place an order via a SharpScript Strategy using Managed Order. By default all strtegies are managed.

Entry Market Orders

A market order can be placed via the EnterLong or EnterShort methods. Please click on the respective methods to know more about the available overloads.

The various parameters that are available, are as follows:

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
NameName of the order. If not defined the name is set to default 'Strategy Entry'
QuantityEntry 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.

Entry Limit Orders

A limit order can be placed by calling the EnterLongLimit or the EnterShortLimit methods. Please click on the respective methods to know more about the available overloads.

The various parameters that are available, are as follows:

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
NameName of the order. If not defined the name is set to default 'Strategy Entry'
QuantityEntry order quantity. If not defined then strategy Quantity property is set.
Limit PriceLimit 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.

Target Methods

Submits a buy or sell order limit order depending on the entry order action. 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.

SetTarget(Double, CalculationMode)

SetTarget(Double, CalculationMode, String)

SetTarget(Int32, Double, CalculationMode)

SetTarget(Int32, Double, CalculationMode, String)

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
PriceValue of the limit price as calculated from the entry order fill price based on the Calculation Mode
Calculation ModeHow the price will be calculated. Possible values are Ticks, Point and Percentage
EntryOrderNameName of the ENTRY order for which the target will be set. If no name is defined then the default name 'Strategy Entry' is set
  • 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
  • When called from the Initialized state the method will return null value
  • 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.
  • In a multi-series environment, when the method is called during the Initialized state, the targets will be available accross the bars series and will be NOT restricted to the specific series, even if it is mentioned.

SetTarget(Double)

SetTarget(Double, String)

SetTarget(Int32, Double)

SetTarget(Int32, Double, String)

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
TargetPriceThe 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.
  • This method will be ignored if called when the strategy is in Initialized state.
Stop Methods

Submits a buy or sell stop market order depending on the entry order action. 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.

SetStop(Double, CalculationMode)

SetStop(Double, CalculationMode, String)

SetStop(Int32, Double, CalculationMode)

SetStop(Int32, Double, CalculationMode, String)

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
PriceValue of the stop price as calculated from the entry order fill price based on the Calculation Mode
Calculation ModeHow the price will be calculated. Possible values are Ticks, Point and Percentage
EntryOrderNameName of the ENTRY order for which the target will be set. If no name is defined then the default name 'Strategy Entry' is set
  • 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
  • When called from the Initialized state the method will return null value
  • 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.
  • In a multi-series environment, when the method is called during the Initialized state, the stops will be available accross the bars series and will be NOT restricted to the specific series, even if it is mentioned.

SetStop(Double)

SetStop(Double, String)

SetStop(Int32, Double)

SetStop(Int32, Double, String)

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
StopPriceThe actual stop 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.
  • 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.
Exit Methods

User can exit a position anytime by calling the ExitPosition or ClosePosition methods.

The ExitPosition lets the user close a specific order, by defining the entry order name.

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars
EntryNameName of the ENTRY order for which the stop will be set. If no name is defined then the default name 'Strategy Entry' is set.
  • Exit() method will be ignored if theres an order placed via the Set() method

The ClosePosition cancels all pending orders as submitted by the strategy and closes the strategy position for the specified bars index.

Parameters

Bars IndexThe Bars Index where the order is to be submitted. By default submitted to the primary bars

  • If connection does not supports market orders a limit order will be placed above/below the current market price.
  • In a multi-series environment the ExitPostion and ClosePosition exits/closes the position for the specified bars indexes only and NOT for the all the bars series.
Miscellaneous Methods

CancelOrder(IOrder)

Cancels a specific order

Parameters:

Order The order which is to be cancelled.
Miscellaneous Conventions
  • ArthaChitra supports orders to be submitted in the secondary bars too and follows the following conventions.
    • If not specified all orders will be submitted to the primary bars only.
    • The EntriesPerDirection in a multi-series envirionment is independent of each other, i.e. BarsArray[0] will calculate its own EntriesPerDirection and BarsArray[1] will have its own EntriesPerDirection and both are independent of each other. For more details please refer here.
    • Each bars index will calculate the positions separately.
    • The barsIndex parameter in order notification methods, like OnFill(Int32, ITrade), OnOrderUpdate(Int32, IOrder) or OnPositionUpdate(Int32) will return the bars index from where the order generates.
See Also

Other Resources