Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tyring to manually close an ATM strategy called from a script ?

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

    Tyring to manually close an ATM strategy called from a script ?

    Hi,

    I'm calling a simple ATM strategy within a script and what I'm trying to achieve is that if I dont like the visual look of a trade that was entered programatically then I'd like to manually press the 'Close' button to get out of the trade and not have Strategy switch off on me, like it would do for a script not using ATM strategy.

    Using the logic from the sample ATM strategy code i'm doing 2 basic things
    1) as soon as entry order is resolved (by filling/canceling/rejecting) I'm making the entry order ID string empty.
    2) as soon as marketposition is flat for whatever reason, and strategyID still exists i'm resetting that by making strategyID string empty.

    will the above approach work ? I'd appreciate if somebody could pls point me to other logical potholes and/or a good thread from the past where this might have been covered.

    many thanks in advance for your help

    #2
    Hi buylosellhi,

    Yes, should work and following the sample is best approach for proper management. See the following link for the section on manually closing script-run ATM strategies using superdom. There is different behavior depending on AtmStrategySelection mode and left/middle click close button.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      thanks Ryan, that does what I need it to do. Is there a way programatically set that property of the chart trader ? Or is the best approach is to save workspaces with specific chart combinations with proper settings ?

      Comment


        #4
        There's no way to set that property progamatically for a particular window, although you can can set as default.

        Right click in ChartTrader area > Properties > Set ATM Strategy Selection mode. Then click Set Default and the next time you use chart trader will have those settings. Yes, can also save it in a workspace and will be preserved.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I'm observing rather odd behavior on my chart trader window. ATMSelectionMode is set to DisplaySelectedATMStrategyOnly. when I select <none> in the ATM strategy of chart trader then I see the proper entry level and stop level associated with the strategy and when I use middle button it closes properly without closing the strategy. However, when I also select the ATM strategy in the chart trader that I'm also calling within the script I only see the entry level and no stop and when I left click on Close then the strategy is closed.

          Is this expected behavior ? What should be the ATM Strategy on the chart trader ?

          thanks again for your help

          Comment


            #6
            Yes, that's expected behavior for DisplayOnly. These modes are detailed more here:


            What you probably want is "Keep.." or "Select...", but will need to use the middle mouse button to close only that ATM strategy, and not the NS running as well.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X