Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Resting Stop (IOrder)

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

    Resting Stop (IOrder)

    Hello,

    I set the original Stop in the OnExecution portion of my code, then manually trail it down (Short Trade) but the order rejects and the log says I am placing a stop bellow the code.

    The issue is the close is bellow my stop by about 1.8 ATR. Why would this error through. Here is the code snip:

    Code:
    if(Position.MarketPosition == MarketPosition.Short)
    			{
    				if(exitShortStop == null) Print("Danger");
    				RiskS[0] = sMIN(ATRHigh,myBarsSinceEntry)[1];
    				DrawLine(CurrentBar.ToString()+"SStop",false,0,RiskS[0],1,RiskS[0],Color.Red,DashStyle.Solid,1); 
    					if( exitShortStop != null && RiskS[1] > RiskS[0] && Close[0]+(5*TickSize) < RiskS[0])
    					{
    					//	CancelOrder(exitShortStop);
    						exitShortStop = ExitShortStop(0,true,SStopQty, RiskS[0], "ATRStopS", "S20");
    						
    											
    					}
    					else RiskS[0] = ATRHigh[1];
    					
    					
    			}
    Please help cheers,

    Sody

    #2
    Hello Sody,

    It looks to be correct. Are you changing your Stop Order any where else?

    Also, if using a Forex instrument have you checked the spread incase there is more than a 5 tick spread?
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks for Checking it out. Besides setting get the initial stop on execution there is no other update. Stops set for futures so no Fx traded. Strange thing is exit Long Stop works great. The The data series RiskS never has a zero or anything that would cause an issue. I'm stumped.

      Comment


        #4
        Hello Sody,

        Are you adding any additional series to your strategy like another time frame or instrument to your strategy?

        Also, are you checking the values of Close[0] and RiskS[0] when the order is being rejected?
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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