Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

auto reverse trade when stop loss of open position is triggered

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

    auto reverse trade when stop loss of open position is triggered

    do you perhaps have a ninjascript code that i can use in my strategy, where once i place a marketbuyorder order marketsellorder with defined takeprofits and stop losses, once the stop loss is triggered, it immediately enters the same trade with same take profit and stop loss but in reverse direction? Thanks in advance

    #2
    Hello konganda,

    I am not aware of a specific working example of that but you can drive your strategies logic by using the OnExecutionUpdate override. That override shows any executions for orders that your strategy submits. You could use the fill event for the target to submit a new entry in the opposite direction.

    If this is something you wanted to try and make yourself a good starting point is to learn about the order events. You can find an example of making a strategy that uses its OnOrderUpdate and OnExecutionUpdate events here: https://ninjatrader.com/support/help...and_onexec.htm

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cre8able, Yesterday, 01:16 PM
    3 responses
    11 views
    0 likes
    Last Post cre8able  
    Started by ChartTourist, Today, 08:22 AM
    0 responses
    6 views
    0 likes
    Last Post ChartTourist  
    Started by LiamTwine, Today, 08:10 AM
    0 responses
    2 views
    0 likes
    Last Post LiamTwine  
    Started by Balage0922, Today, 07:38 AM
    0 responses
    5 views
    0 likes
    Last Post Balage0922  
    Started by JoMoon2024, Today, 06:56 AM
    0 responses
    6 views
    0 likes
    Last Post JoMoon2024  
    Working...
    X