Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entershortstop not reversing long position and vice versa

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

    Entershortstop not reversing long position and vice versa

    Hi

    Please have a look at my strategy's buy and sell triggers below.

    I want to make it work as follows:
    When long the "exitlongstop" or entershortstop must exit the trade (and go short in the case of the entershortstop)

    The problem is that the long positions are aways only exited by the exitlongstop - the entershortstop never exits the long = even though I can see on the chart that the conditions for the entershortstop is true.

    Please show me what I am doing wrong

    Same is true for exiting from short position

    // Buy trigger
    if (MyDmipp[0] > MyDmimm[0])
    {
    HighestHighforlong = MAX(High,3)[0];
    EnterLongStop(HighestHighforlong);
    }

    if (Position.MarketPosition == MarketPosition.Long)
    {
    LowestLowforstop = MIN (Low,4)[BarsSinceEntry()];
    ExitLongStop(LowestLowforstop);
    }


    // Sell trigger
    if (MyDmipp[0] < MyDmimm[0])
    {

    LowestLowforshort = MIN(Low,3)[0];
    EnterShortStop(LowestLowforshort);
    }

    if (Position.MarketPosition == MarketPosition.Short)
    {
    HighestHighforstop = MAX (High,4)[BarsSinceEntry()];
    ExitShortStop(HighestHighforstop);
    }

    #2
    I suspect you are running into some internal order handling rules.

    Please see information at bottom of this link - http://www.ninjatrader-support.com/H...verview36.html
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    63 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    54 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    48 views
    0 likes
    Last Post CarlTrading  
    Working...
    X