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, 05-11-2026, 05:56 AM
      0 responses
      58 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      361 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      281 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X