Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

wrong time order - ninja script output ...

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

    wrong time order - ninja script output ...

    i have some problems with ninja script output from strategy Analyzer
    ninja script output shows the output with some kind of time loops.
    every ( 5 min) bar loop should print a output with time, some variables and order status...
    but the output jumbles the times and print the outputs in a wrong order...

    one example :
    this is the code that should print every bar loop some variables and order status :

    PHP Code:
    Print ("---------------------------------------------------------"); 
    Print(Time[0].ToString());  
    Print ("---------------------------------------------------------"); 
    Print ( "sell : " + sell + " buy : " + buy);            
    Print ("Buykurs " + Buykurs); 
    Print ("Sellkurs " + Sellkurs);             
    Print ("longlimit " + longlimit);             
    Print ("shortlimit " + shortlimit);                         
    Print ("Position :" + Position.MarketPosition);         
    Print ("orderlong :"); 
    Print (orderlong);                     
    Print ("orderlongstop :"); 
    Print (orderlongstop);                 
    Print ("orderlongexit :"); 
    Print (orderlongexit);         
    Print ("ordershort :");     
    Print (ordershort); 
    Print ("ordershortstop :");  
    Print (ordershortstop);             
    Print ("ordershortexit :" ); 
    Print (ordershortexit);             
    Print ("--------------------------------------------------------------"); 
    Print (" "); 
    
    The strange thing in the output is the " Print(Time[0].ToString()); " Part ...
    there is first : 11:30:00, than 11:15:00 , than 11.35:00 , than 11.20:00 ... an so on ...
    why this kind of messy time output ?

    My Strategy is a little bit extensive (about 1000 lines) but there are no time loops, no goto , no second time series or somthing like this in the code that can change the order of the bars or the order from the output ... just one output print every 5 min bar update...
    why this wrong output order ?
    Some multithread buck ?
    Last edited by jr123; 06-18-2017, 05:53 AM.

    #2
    " Some multithread buck ? "
    It seems like this ...
    with :

    Thread.Sleep(50);

    in the code , the wrong time order is gone ...

    Comment


      #3
      Hello jr123,

      Is your code in OnBarUpdate?

      Do you have multiple data series added to your script?

      Can you provide a reduced version that only prints the time and doesn't take other actions or have other conditions?
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 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