Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with Stop Orders

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

    #16
    To be honest Brett if you could simply tell me what is wrong with the following code then that would be much quicker:

    Code:
    			if (CrossAbove(MAseries, DWMAseries, 1))
    				{if (myEntryOrderL == null)
    				myEntryOrderL = EnterLongStop(0, true, 1, High[0] + TickSize, "L");
    				else if (myEntryOrderS != null)
    				CancelOrder(myEntryOrderS);}
    			else if (CrossBelow(MAseries, DWMAseries, 1))
    				{if (myEntryOrderS == null)
    				myEntryOrderS = EnterShortStop(0, true, 1, Low[0] - TickSize, "S");
    				else if (myEntryOrderL != null)
    				CancelOrder(myEntryOrderL);}
    				#endregion
    Put simply if MA's cross then it enters a stop order at 1 tick above/below high/low of signal bar, then the order needs to stay on the market until it crosses the other way. Let me know if there is any confusion.

    Comment


      #17
      Hello,

      I took a look however I dont see anything specifically off with these lines of code. However they would require adding in the Print statements and Trace orders to isolate what actions the strategy is taking at one times to help us narrow down what is going on.


      I dont see you specifically setting the iOrder object to null, are you doing this inside of OnOrderUpdate()?

      -Brett
      BrettNinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X