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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X