Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ability to move SL and TP in strategy

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

    Ability to move SL and TP in strategy

    Hello. I have started to create a strategy using SetStopLoss and SetTakeProfit, and while it does work, I would like the ability to move them manually on the chart as needed. My understanding is that this requires me to use either OnOrderUpdate or OnExecutionUpdate. I believe I would be setting my SL and TP parameters there so that it triggers once, also using bool liveuntilcancelled = true, as opposed to it 'setting' every state change. I'm just having a difficult time wrapping my head around the logic of using that.

    I have an entry, and am trying to make a unique entry signal everytime a position is opened, "LongEntry" + int LongEntryCount, where it starts with 1 and adds everytime it fills. I know to set the SL and TP from that same entry signal.

    Is there a way to be able to move the SL up to my break even point once certain conditions are met? Or is that only possible if the conditions are 'static' and update OnBarUpdate()?

    Is there a method I can use to determine when my position has either hit TP or the SL? I am using horizontal lines to draw my BE trigger point and my BE price, effectively 3 ticks above entry to account for commissions, and would like to use the event of it hitting TP or SL to change those lines to Brushes.Transparent.

    Ideally, I want to use unique entries so that each entry has its own SL and TP, which I think I may have figured out.

    #2
    Hello rockmanx00,

    For an order to be manually modifiable you'll need to use Exit order methods (and not Set methods) or use the unmanaged approach.

    Submit the order once from OnExecutionUpdate() with the isLiveUntilCancelled parameter as true and then do not modify the orders by code once submitted.

    Below is a link to an example.


    Also, below is a link to examples of modifying stop and limit price as trailing (or breakeven) type logic.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea. I will look through those and come back if I have further questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X