Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy to go long with a stop loss and a take profit?

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

    Strategy to go long with a stop loss and a take profit?

    Hi.
    How can I place a trade in c# strategy to go long, but also include a stop loss and a take profit?

    e.g.
    Long trade at 200
    Stop loss will kick in if it goes below 180
    Profit will be taken if it goes above 220

    #2
    Hello spikeruk,

    Thanks for your post and Welcome to the NinjaTrader forums!

    You can use the Ninjascript methods of SetStopLoss() and SetProfitTarget(). Those methods will be employed with an OCO structure meaning one is canceled automatically when the other is filled. I will include the help guide links below as well as a reference to the "managed Approach" that summarizes this information.

    If you are using the Strategy Builder, these methods are also available through the Stops and Targets window however in the strategy builder these would need to be fixed values that would apply to every trade so you would want to use the CalculationMode of Ticks and specify the number of ticks to achieve your goal.

    References:
    Managed Approach: https://ninjatrader.com/support/help...d_approach.htm
    SetStopLoss(): https://ninjatrader.com/support/help...etstoploss.htm
    SetProfitTarget(): https://ninjatrader.com/support/help...ofittarget.htm

    Comment


      #3
      Thanks, this helped

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      65 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      23 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      26 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X