Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries in ATM Strategy

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

    #16
    Joydeep - just one more quick check. if I manually close an ATM strategy then the position will show as flat but the strategy ID will still be the original string, and would have to be 'emptied out' in the script ?
    thanks much

    Comment


      #17
      Hello buylosellhi,
      If you manually close the Atm strategy by clicking on the Flatten Everything (File>Flatted Everything) or Close button in SuperDom or Chart Trader then all positions will be closed and the strategy will be disabled.

      Please let me know if I can assist you any further.
      JoydeepNinjaTrader Customer Service

      Comment


        #18
        Hi Joydeep, thanks for your note. I meant to say closing the strategy using the middle mouse botton which closes only the active ATM strategy, without disabling it and leaves everything running. In that case, the strategy ID string still contains its tag so would need to be reset

        Comment


          #19
          Hello buylosellhi,
          You can reset those by the following code of yours for example:
          Code:
          if (atmStrategyIdS.Length>0 && GetAtmStrategyMarketPosition(atmStrategyIdS)==Cbi.MarketPosition.Flat)
          {
          	orderIdS = string.Empty;
          	atmStrategyIdS = string.Empty;
          	Print("Confirming successful close of Short strategyID = " + atmStrategyIdS + " and no order ID = " + orderIdS);
          }
          Either put it above the entry logic or if your put your entry logic first (as in your original code) just return, once the entry has been made.

          The positions will be updated on the next tick, and then you can reset the string id's.

          Please let me know if I can assist you any further.
          JoydeepNinjaTrader Customer Service

          Comment


            #20
            Thanks Joydeep,

            so in that block of your code, I shouldnt use AtmStrategyClose(...) command because the manual click has essentially achieved the same ?

            Comment


              #21
              Hello,

              Correct - if you plan on manually closing the ATM Strategy, you do not need to use ATMStrategyClose in the code. You would only need to use ATMStrategyClose if you want to automatically close the position through the code.
              MatthewNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              666 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              377 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              110 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              575 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              580 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X