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

What is the difference between the 2 cases?

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

    What is the difference between the 2 cases?

    The attached "strategy" merely prints the values of an indicator I developed. The problem I am experiencing is that sometimes the values reported are garbage (well, there is actually some method to the madness but more on that later), whereas the values are valid if printed inside the indicator itself. When this happens, I have no recourse but to restart NT.

    Let's say I have the following statement in the indicator's OnBarUpdate() method:
    Print("DEBUG0: " + indicator.value)

    And I have
    Print("DEBUG1: " + indicator.value)
    in the strategy's OnBarUpdate() method.

    When things work fine, I see the following output:
    20060516 DEBUG0: 1.2957, 1.2685, 1.293, 1.2696
    20060516 DEBUG1: 1.2957, 1.2685, 1.293, 1.2696
    20060517 DEBUG0: 1.2957, 1.2693, 1.293, 1.2697
    20060517 DEBUG1: 1.2957, 1.2693, 1.293, 1.2697
    ...

    When things don't work, I see something like the following:

    20060516 DEBUG1: 1.2685, 1.2685, 1.2685, 1.2685
    20060517 DEBUG1: 1.2693, 1.2693, 1.2693, 1.2693
    20060516 DEBUG0: 1.2957, 1.2685, 1.293, 1.2696
    20060517 DEBUG0: 1.2957, 1.2693, 1.293, 1.2697

    Please note that the indicator doesn't seem to get executed until aftere the strategy runs, which looks odd to me.

    Can you please try to reproduce it on your end?

    -Henry
    Attached Files

    #2
    What you are experiencing is most likely solvable through the use of Update().
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gemify, 11-11-2022, 11:52 AM
    6 responses
    803 views
    2 likes
    Last Post ultls
    by ultls
     
    Started by ScottWalsh, Today, 04:52 PM
    0 responses
    3 views
    0 likes
    Last Post ScottWalsh  
    Started by ScottWalsh, Today, 04:29 PM
    0 responses
    7 views
    0 likes
    Last Post ScottWalsh  
    Started by rtwave, 04-12-2024, 09:30 AM
    2 responses
    22 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by tsantospinto, 04-12-2024, 07:04 PM
    5 responses
    70 views
    0 likes
    Last Post tsantospinto  
    Working...
    X