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 timmbbo, 07-05-2023, 10:21 PM
    4 responses
    158 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by tkaboris, Today, 08:01 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Lumbeezl, 01-11-2022, 06:50 PM
    31 responses
    818 views
    1 like
    Last Post NinjaTrader_Adrian  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by swestendorf, Today, 11:14 AM
    2 responses
    6 views
    0 likes
    Last Post NinjaTrader_Kimberly  
    Working...
    X