Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 agclub, 04-21-2024, 08:57 PM
      4 responses
      18 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Irukandji, Today, 04:58 AM
      0 responses
      2 views
      0 likes
      Last Post Irukandji  
      Started by fitspressoburnfat, Today, 04:25 AM
      0 responses
      2 views
      0 likes
      Last Post fitspressoburnfat  
      Started by Skifree, Today, 03:41 AM
      1 response
      4 views
      0 likes
      Last Post Skifree
      by Skifree
       
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Working...
      X