Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Find all StopLoss orders Atm Strategy creates in Sample ATM Strategy

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

    Find all StopLoss orders Atm Strategy creates in Sample ATM Strategy

    Currently i have implemented a customized version of the Sample ATM Strategy included in NT8. The ATM I am using creates one stop for a potion of the order and another for the second portion. The first portion contains a stop and target while the second has just a trailing stop with no target. I am trying to go through the stops and set them to BE even when I do not know how many the ATM created. The ATM dynamically creates the stop order names to "Stop1" "Stop2" "Stop3" etc. I currently have implemented a quick loop from 1 to the total ATM qty and dynamically built the name using "Stop"+loopIndex. This works but does produce errors printing to the output log like "'AtmStrategyChangeStopTarget' method error: Order name 'STOP10' is invalid".

    I would like to just loop through the stop orders created by the ATM.

    Any Ideas?

    Thanks,
    Mark

    #2
    Hi Mark, thanks for posting. The for loop would need to stop at the last ATM that is created. You can have an int variable representing the max number, or keep a counter to keep track off all the ATMs that were created.

    private int MAXATMCOUNT = 3;

    for(int i = 1; i <= MAXATMCOUNT; i++)
    {
    Print(i); //this will print 1 through 3. Use it to build a string e.g. Print("STOP"+i);
    }

    Comment


      #3
      Hi Ellis, to count how many ATMs were created will take C# code and trial and error testing on your end. The alternative is to use OnOrderUpate to monitor the stops and targets. We have an example of this here:


      Start out by using Print() to print out the data coming from OnExecutionUpdate/OnOrderUpdate. Prints will be the best way to debug and find the correct data to target since you are workint with the ATM strategy methods.

      Kind regards,
      -ChrisL

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X