Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Auto Breakeven

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

    Auto Breakeven

    Hello,
    Just having a play with my first bit of backtesting... how would i amend the below to move the stop to b/e if the price hits +25 ticks?

    Any help greatly appreciated

    Code:
            
    protected override void Initialize()
            {
                SetStopLoss("", CalculationMode.Ticks, 25, false);
                
                SetProfitTarget("", CalculationMode.Ticks, 36);
    
                CalculateOnBarClose = true;
    
            }

    #2
    Hello,

    You will need to move the SetStopLoss("", CalculationMode.Ticks, 25, false); out of the Initialization block and into the OnBarUpdate block, build your criteria for move the stop, then call the SetStopLoss again with new placement.

    This link may help:
    http://www.ninjatrader-support2.com/...ead.php?t=3222
    DenNinjaTrader Customer Service

    Comment


      #3
      thanks that works a treat

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 02:12 AM
      5 responses
      23 views
      0 likes
      Last Post rocketman7  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      7 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by samish18, 04-17-2024, 08:57 AM
      17 responses
      66 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by briansaul, Today, 05:31 AM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PaulMohn, Today, 03:49 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X