Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    596 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    554 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X