Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongStop problem

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

    EnterLongStop problem

    Hello,

    I have a problem and I don't understand why.
    I have searched into forum but I didn't find anything. Sorry if is repeated.

    The strategy is simple. In the bar 2, one LongStop order is submitted.
    If the price reachs the stop, the strategy finishs correctly.
    If the price doesn't reach the stop, the strategy terminates with errors.

    Strategy Code A:
    Code:
    protected override void OnBarUpdate()
    {
    if ( CurrentBar == 2 )
       EnterLongStop(0, true, 1, 110.33, "EntrarLargoStop"+CurrentBar);
    }
    Here 110.33 is reached in the bar 15, the stop order is filled and the strategy finish correctly.




    Strategy Code B:
    Code:
     
    protected override void OnBarUpdate()
    {
    if ( CurrentBar == 2 )
       EnterLongStop(0, true, 1, 110.45, "EntrarLargoStop"+CurrentBar);
    }
    Here 110.45 isn´t reached and the strategy terminates with errors.





    Probably i'll be mistaken in anything but i don't know what. Could you help me, please ?

    Thanks very much.
    Attached Files

    #2
    This has nothing to do with your strategy. Last screenshot indicates the problem: if there is no market data coming in for the instrument in question then the simulator will not work, but reject the order afgter a few secs. If you are on sim feed, then you would need to provide a start price for you instrument (see logs).

    Comment


      #3
      Thanks Dierk

      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