Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyStopTargetOrderStatus price stop order problem

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

    GetAtmStrategyStopTargetOrderStatus price stop order problem

    hello i need help with this

    I have a strategy that enters the market with an ATM and that according to the scenario will move the stop, but before using the ATM it puts it in brake even. What I want is for me to never move the stop below that brake even, so through GetAtmStrategyStopTargetOrderStatus

    I am looking to print the price of the "stop1" order with the result that it is always 0, verifying the information in the control panel, the avg.price is correct, it is 0 but I want to get the Stop price, that is, the price where visually the order is placed to compare it with the new move that the strategy would make

    How could I print the price of the "stop1" order of an ATM strategy to be able to compare it?​

    #2
    Hello RubenCazorla,

    You can't query the individual ATM orders, if you plan to make price changes your script needs to have a variable that holds a stops price and then you would change the atm stop to that price using AtmStrategyChangeStopTarget().
    JesseNinjaTrader Customer Service

    Comment


      #3
      This is insane. ATM strategy (the one that saved in chart trader) can adjust stop based on it's settings. Not only via NinjaScript strategy. Saving it as a variable wont help.

      Comment


        #4
        Hello Leeroy_Jenkins,

        An ATM submitted by NinjaScript still adjusts the stop and target based on the template settings, it works the same as if it was submitted with the chart trader. Because there is no user interface to edit the template from your code you would use the method AtmStrategyChangeStopTarget() if you need to update the prices while the ATM is active.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I'm saying that string[,] orders = GetAtmStrategyStopTargetOrderStatus("Stop1", "idValue") should return stop price of working orders. Instead, it outputs 0. The stop price can be adjusted by user or ATM template. That's whole reason ATMStrategy management via NinjaScript exists - to help automatize user orders. Reading stop values from .xml templates wont help because again user can adjust it manually. And for whatever reason OnExecutionUpdate() and OnOrderUpdate() dont work within ATM NinjaScript strategy.

          Comment


            #6
            Hello Leeroy_Jenkins,

            The price is not returned with that method, that is just a status. For your script to know the price you would have to calculate a price and then use AtmStrategyChangeStopTarget to set that price, at that point the script is in control of the pricing rather than the template.

            ATM's in NinjaScript are intentionally limited, the ATM is actually managing the orders so the script is not in charge unless you make it be in control using the atm methods. The alternative is to not use ATM's and then the complete information is available to the script because it is in complete control. If you don't use atms you can use more complex code and observe order/execution events that are associated with the script.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by clarocque1, Today, 06:18 PM
            0 responses
            2 views
            0 likes
            Last Post clarocque1  
            Started by clarocque1, Today, 06:17 PM
            0 responses
            2 views
            0 likes
            Last Post clarocque1  
            Started by clarocque1, 03-23-2025, 08:17 AM
            4 responses
            26 views
            0 likes
            Last Post clarocque1  
            Started by Artorias, Today, 05:22 PM
            0 responses
            9 views
            0 likes
            Last Post Artorias  
            Started by several, Today, 07:07 AM
            8 responses
            26 views
            0 likes
            Last Post several
            by several
             
            Working...
            X