Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyStopPrice or get target needed vs GetAtmStrategyStopTargetOrderStatus

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GetAtmStrategyStopPrice or get target needed vs GetAtmStrategyStopTargetOrderStatus

    GetAtmStrategyStopTargetOrderStatus seems pointless and does not give what I am looking for.


    protected override void OnBarUpdate()
    {
    string[,] orders = GetAtmStrategyStopTargetOrderStatus("Target1", "idValue");
    // Check length to ensure that returned array holds order information
    if (orders.Length > 0)
    {
    for (int i = 0; i < orders.GetLength(0); i++)
    {
    Print("Average fill price is " + orders[i, 0].ToString());
    Print("Filled amount is " + orders[i, 1].ToString());
    Print("Current state is " + orders[i, 2].ToString());
    }
    }
    }​

    It seems to me if the target is filled, why would you look for it

    Other than recording it myself which I am in process of coding.

    I would like to know the current ATM stop and target especially since I can move it manually.

    #2
    Hello BartMan,

    Thank you for your post.

    The use case for using an ATM strategy inside of a NinjaScript strategy is to use NinjaScript to programmatically monitor and generate the entry signal, then manually manage the open position, including stops and targets. What is your reasoning for accessing the stop and target price programmatically? What do you plan to do with that information within the script? Having a better explanation might help me to understand and suggest how to get what you are looking for.

    You could access information outside of orders generated by a NinjaScript strategy, such as the stop and target information since that is generated by the ATM strategy, by using the Account class:You could then set up OnOrderUpdate to check for orders with names such as "Stop1" or "Target1" and check their prices.Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X