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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      58 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X