GetAtmStrategyStopTargetOrderStatus()

View as Markdown

Definition

Gets the current order state(s) of the specified stop or target order of a still-active ATM strategy.

Notes:

  1. If the method can’t find the specified order(s), an empty array is returned.
  2. A specified stop or target within an ATM strategy can actually hold multiple orders. For example, if your ATM strategy submits a stop and target and you receive multiple partial fills on entry with a delay of a few seconds or more between entry fills, the ATM strategy will submit stop and target orders for each partial fill all with the same price and order type.

Method Return Value

A string[,] multi-dimensional array holding three dimensions that represent average fill price, filled amount and order state. The length (number of elements) represents the number of orders that represent the specified name.

Syntax

GetAtmStrategyStopTargetOrderStatus(string orderName, string atmStrategyId)

Parameters

ParameterDescription
orderNameThe order name such as “Stop1” or “Target2”
atmStrategyIdThe unique identifier for the ATM strategy

Examples

1protected override void OnBarUpdate()
2{
3 string[,] orders = GetAtmStrategyStopTargetOrderStatus("Target1", "idValue");
4
5 // Check length to ensure that returned array holds order information
6 if (orders.Length > 0)
7 {
8 for (int i = 0; i < orders.GetLength(0); i++)
9 {
10 Print("Average fill price is " + orders[i, 0].ToString());
11 Print("Filled amount is " + orders[i, 1].ToString());
12 Print("Current state is " + orders[i, 2].ToString());
13 }
14 }
15}