Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Trail the Take Profit

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

    Trail the Take Profit

    Hi, There seems to be a way to Trail the stop with an ATM strategy.

    However I want to program a strategy where I can in effect Trail the Take Profit.

    ( Even if the price moves against a trade, I want the Take Profit point to never be more than a fixed distance from the current price. I realize that if the price moves against you enough it would actually result in a loss when the price finally retraces).

    Can the strategy monitor the price and use the SetProfitTarget function to adjust the Take Profit point as needed?

    Thanks

    #2
    Hello,

    Thank you for the question.

    If you are asking how to dynamically modify the SetProfitTarget, you can do that from OnBarUpdate or any of the other override events.

    In the script if you are currently using SetProfitTarget in only Inititialize, you could also use it in a condition in other places in the script to update the orders Price.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse. Can I also do this for orders created outside of the strategy?
      In other words Can I use an ATM strategy to manage orders created manually or by another strategy?

      thanks

      Comment


        #4
        Hello,

        Thank you for the reply.

        Unfortunately not,

        An ATM strategy could only be used as a way to manage a manual position submitted from a DOM or from a chart trader. Alternatively an ATM strategy can also be called from a NinjaScript strategy like the SampleATMStrategy that comes with NinjaTrader.

        Because a strategy can only see its own individual position, it would be un aware of manually placed orders or orders from other strategies so that would not be possible.

        I believe the closest to what you are asking would be to have a NinjaScript strategy submit the entry and also submit an ATM order to manage that position. You can find more information about this in the help guide here: http://ninjatrader.com/support/helpG...gy_methods.htm

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        21 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X