Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modify stop loss by strategy after manual order

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

    Modify stop loss by strategy after manual order

    Dear Support,

    I need to place my order manually by chart trader (with a stop loss of 50 tick and target of 100 tick for example).

    Then, if a certain event occur, I need that my stop loss will be moved to break even.
    This event is a custom event (so, for example, ema1 > ema2 ecc).

    Is it possible to do?

    I noted your "SampleATMStrategy", but I noted that also the entry order is placed by strategy as limit order.
    I need only to move my stop loss, not also the entry order.

    Can you help me?

    Thank you, best regards

    AndreaBhs


    #2
    Hello AndreaBhs,

    Thanks for your post.

    SampleATMStrategy is just an example of the possibility to integrate an automated strategy with the advantages of an ATM and yes it does use a limit order for the entry order. It also only performs long trade, again this is provided as an example of the possibilities.

    I recommend having the strategy place the entry order as otherwise, the strategy would be unaware of the manually placed order.

    You can create your own strategy using the same methods and properties as the Sample ATM Strategy and place any type of entry order you wish in the strategy.

    Here is a link to the methods and properties for strategies using ATMs: https://ninjatrader.com/support/help...gy_methods.htm




    Comment


      #3
      Hello Paul,

      so, we can move to break even a stop loss for a manually placed order only with the default method in the ATM strategy window (stop strategy)

      while, we can NOT move to break even a stop loss for a manually placed order with custom logic (for example a signal of my custom indicator)

      is it correct?

      thank you, best regards

      AndreaBHS

      Comment


        #4
        Hello AndreaBhs,

        Thanks for your reply.

        The issue is that Ninjascript strategies are unaware of the manually placed orders.

        You could have the strategy place the entry order and you could use your custom indicator signal in a strategy to move the stop order if you wish and assuming the custom indicator provides a signal that is recognizable by the strategy.

        Alternatively, you could add button logic to your strategy so that when you place a manual order you click the button to trigger the search in the account object for your orders and then adjust the stop according to your custom indicator (again assuming the custom indicator provides a signal that is recognizable by the strategy.). This would be quite a bit of custom programming.

        Or you could add a button to your strategy that when clicked places a market order which as it is done within the strategy, the strategy then is automatically aware of the order and can react as programmed.

        Note: In a Ninjascript strategy you do not have to work with an ATM to create a breakeven stop, you can program one yourself which would reduce the complexity of the strategy compared to using an ATM in a Ninjascript strategy.




        Comment


          #5
          Ok, now I understand.

          about this:

          Or you could add a button to your strategy that when clicked places a market order which as it is done within the strategy, the strategy then is automatically aware of the order and can react as programmed.
          You mean a something like this?

          Long Short Toolbar Buttons - NinjaTrader Ecosystem

          Instead of using Chart Trader I use a strategy with my logic if trade is long or short and place the order with my button (created in the same strategy) and in this mode the strategy will recognize my order and can move stop loss, it is right?

          Comment


            #6
            Hello AndreaBhs,

            Thanks for your reply.

            The example you linked provides on chart buttons that when clicked AND the strategy meets other entry conditions will place a market order. Yes, the strategy will recognize the order as the code of the strategy placed the order.

            You could remove those other conditions and have the buttons place the order directly when clicked. The strategy will also exit a position when the button is pressed again.

            The example does not provide a stop or target order, these would need to be added. You can then create the code for moving your stop to breakeven, or perhaps use another button or button click event to do so.

            Comment


              #7
              Thank you Paul H., you helped me a lot!

              Best regards

              Comment


                #8
                Originally posted by NinjaTrader_PaulH View Post
                Hello AndreaBhs,

                Thanks for your post.

                SampleATMStrategy is just an example of the possibility to integrate an automated strategy with the advantages of an ATM and yes it does use a limit order for the entry order. It also only performs long trade, again this is provided as an example of the possibilities.

                I recommend having the strategy place the entry order as otherwise, the strategy would be unaware of the manually placed order.

                You can create your own strategy using the same methods and properties as the Sample ATM Strategy and place any type of entry order you wish in the strategy.

                Here is a link to the methods and properties for strategies using ATMs: https://ninjatrader.com/support/help...gy_methods.htm



                hello
                would you have an example to exploit on the strategy builder NT8 please? Thank you

                Comment


                  #9
                  Hello 270027,

                  Thanks for your post.

                  The strategy builder will not work with the special methods required to integrate an ATM template.

                  You would need to work directly in Ninjascript.

                  What you want to work with is a Ninjascript strategy that uses an ATM template to accomplish your goals where the strategy will find the entry conditions and place the entry order, once filled the specified ATM will take over providing the template specified profit and stop(s). You can then manipulate these manually during the trade as you wish. Once the trade has been closed, the strategy will look for the next entry.

                  In your NinjaTrader is an example of this type of strategy called SampleAtmStrategy. Please review this strategy in the Ninjascript editor as the code is the best example we have of this type of hybrid strategy. The code of the strategy is well commented to help understand the requirements of use as well as how the various property and methods work. The comments advise to create an ATM template (for the demonstration) called "AtmStrategyTemplate" and it can be created as you wish to configure it.

                  The sampleATMstrategy uses special methods and properties that do not access the normal strategy methods and properties, here is a link to the help guide section on these special ATM methods and properties: https://ninjatrader.com/support/help...gy_methods.htm

                  Please note:
                  1. The Strategy Builder does not support ATMs
                  2. Strategies that use ATM methods cannot be "backtested" in the strategy analyzer.
                  3. Strategies that use ATM methods can be tested with Playback using Market replay data.
                  4. Strategies that use ATM methods need to skip historical data processing (as shown in the example strategy).

                  Comment


                    #10
                    Originally posted by NinjaTrader_PaulH View Post
                    Hello 270027,

                    Thanks for your post.

                    The strategy builder will not work with the special methods required to integrate an ATM template.

                    You would need to work directly in Ninjascript.

                    What you want to work with is a Ninjascript strategy that uses an ATM template to accomplish your goals where the strategy will find the entry conditions and place the entry order, once filled the specified ATM will take over providing the template specified profit and stop(s). You can then manipulate these manually during the trade as you wish. Once the trade has been closed, the strategy will look for the next entry.

                    In your NinjaTrader is an example of this type of strategy called SampleAtmStrategy. Please review this strategy in the Ninjascript editor as the code is the best example we have of this type of hybrid strategy. The code of the strategy is well commented to help understand the requirements of use as well as how the various property and methods work. The comments advise to create an ATM template (for the demonstration) called "AtmStrategyTemplate" and it can be created as you wish to configure it.

                    The sampleATMstrategy uses special methods and properties that do not access the normal strategy methods and properties, here is a link to the help guide section on these special ATM methods and properties: https://ninjatrader.com/support/help...gy_methods.htm

                    Please note:
                    1. The Strategy Builder does not support ATMs
                    2. Strategies that use ATM methods cannot be "backtested" in the strategy analyzer.
                    3. Strategies that use ATM methods can be tested with Playback using Market replay data.
                    4. Strategies that use ATM methods need to skip historical data processing (as shown in the example strategy).
                    hello and thank you for all these explanations and I think I understood. I am a beginner and I have not yet done a C# internship:
                    I can guess but not understand everything. If you had in your toolbox the same example in strategy construction format it would be simpler for me to understand having worked on logical automation systems like honeywell, Johnson Control.
                    Thank you

                    Comment


                      #11
                      Hello 270027,

                      Thanks for your reply.

                      I may be misunderstanding but I think you are asking how to access the Ninjascript strategy example. The example strategy Sample ATM strategy can be found in your NinjaTrader. You can access it by New>Ninjascript Editor, then select the strategies folder on the right, then double left click on the file Sample ATM strategy, this will open the file for your review of the code.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      558 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      324 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      545 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      547 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X