Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to apply ATM strategy to an open position via NinjaScript

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

    How to apply ATM strategy to an open position via NinjaScript

    Hi there!

    I already have created entry orders in NinjaScript and attached ATM Strategy using the method below.

    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("Teste ATM", myOrder);

    But imagine I have a position opened (long or short) and want to apply an ATM to that position. That's an easy task through the graphical interface (tab "Positions" from Control Center, then right click and the desired position -> Apply ATM Strategy). So far so good!

    My question is how to do this simple action using NinjaScript? I'm having a hard time trying to apply ATM strategy to a position. Is it possible to be done in NinjaScript?

    Thank you in advance!
    NeoTraderBot
    NinjaTrader Ecosystem Vendor - NeoTraderBot

    #2
    Hello NeoTraderBot,

    Thank you for your post.

    But imagine I have a position opened (long or short) and want to apply an ATM to that position.
    Unfortunately, this would not be possible with an ATM Strategy as there's no supported method to add an ATM to a position from NinjaScript after the position has been opened.

    You could instead create an Add-on that would monitor an account and automatically submit a stop loss and profit target.

    Please let us know if you have any further questions.

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello NeoTraderBot,

      Thank you for your post.



      Unfortunately, this would not be possible with an ATM Strategy as there's no supported method to add an ATM to a position from NinjaScript after the position has been opened.

      You could instead create an Add-on that would monitor an account and automatically submit a stop loss and profit target.

      Please let us know if you have any further questions.
      If thats the case - what would the order submission look like? As a short and a long would have different order submissions for the take profit/stop loss orders

      Comment


        #4
        Hello WHICKED,

        We have an existing sample script that demonstrates submitting protective orders via account monitoring, ProfitChaseTrailStopIndicator:



        This example is only submitting a buy market order, you would need to add separate logic if you want to add logic for sell market as well. While we can't create the logic for you, you can use this as a guideline.

        Comment


          #5
          how would this look in a non-strategy implementation?

          Comment


            #6
            Hello WHICKED,

            The script mentioned in my previous post is an indicator using the AddOn approach, not a strategy.

            Comment


              #7
              would this be capable in a indicator? By using the Account.Submit? and if so what would the orders be for a long position and a short position for a take profit/stop loss

              Comment


                #8
                Hello WHICKED,

                Have you taken a look at the example script suggested? It is an indicator that is using Account.Submit... I really recommend taking a look at that script since it can answer a lot of the questions you're asking.

                The script demonstrates submitting long positions, you can mirror that logic for short positions.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                612 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                355 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                561 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                564 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X