Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget works in backtesting but not in live trading. Why?

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

    SetProfitTarget works in backtesting but not in live trading. Why?

    Hello!

    I created a strategy that scales out half of the position at target 1 and the other at target 2. I followed Josh's example on scale out by using SetProfitTarget:

    SetProfitTarget("P1", CalculationMode.Ticks, 10);
    SetProfitTarget("P2", CalculationMode.Ticks, 20);

    EnterLong(5, "P1");
    EnterLong(5, "P2");

    The strategy worked as expected in my backtesting. However, in living trading, my whole position was scaled out at target 1. I couldn't believe my eyes and applied the exact same strategy on the same (but now historical) data. It again worked as expected, that is, exiting half at target 1 and the other at target 2.

    This problem is very puzzling to me. Any help, please!


    #2
    ooppie,

    I am unable to reproduce on my end. Please post your code. Thanks.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I noticed something similiar in Chart Trader. If you use the same strategy twice at 2 different prices, the stops are just combined even though they should be in different places. I worked around it by just creating the same strategy twice with different names.

      Comment


        #4
        Stainless2000,

        Please ensure your stops are truly at different price points by looking on the Control Center orders tab. On my end, different price stops from the same strategy but different instances of them are shown separately in my Chart Trader.

        Once the two strategy instances become in sync with each other then Chart Trader will show the stops together because they are at the same price.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        152 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        305 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        244 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        345 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        176 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X