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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        656 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        371 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        579 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X