Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adjusting SL and TP after entering a position by Strategy

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

    Adjusting SL and TP after entering a position by Strategy

    Hi team,

    I set target profit and stop loss on Strategy script. After entering a position with SL/TP, they are not adjusted by manually or any.
    How can I make them flexible even if it was executed by Strategy?

    Thanks,

    #2
    Hello rocketman7,

    Thank you for your post.

    It’s possible to manually modify stops and targets submitted by a NinjaScript Strategy by using exit methods, such as ExitLongStopMarket(), with isLiveUntilCancelled set to true.

    ExitLongStopMarket(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName, string fromEntrySignal)

    Help Guide: NinjaScript > Language Reference > Strategy > Order Methods > Managed Approach > ExitLongStopMarket()

    Using isLiveUntilCancelled set to true allows the orders to be submitted once without being updated again from the script. This will allow you to manually modify the orders without them moving back to the original price from the strategy. We suggest submitting the orders from OnExecutionUpdate() when the entry order fills.

    Please note that this cannot be accomplished with the Strategy Builder. In the Strategy Builder, orders are submitted without using the isLiveUntilCancelled bool, meaning the bool will be set to false and the order will be automatically cancelled if not resubmitted on each new bar. If the orders are resubmitted, this would cause the manually adjusted order to revert back to the strategy assigned price.

    ManuallyModifiableStopTargetExample_NT8 demonstrates placing an exit stop and limit order which can be manually modified.

    ManuallyModifiableStopTargetExample_NT8.zip

    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    116 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    61 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    82 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X