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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      64 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X