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

Strange indicator behavior in first five non-historical periods

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

    Strange indicator behavior in first five non-historical periods

    I have a tick-by-tick indicator that is behaving strangely. The internal workings are very complicated, so I'll spare the details for now; however, I'm wondering whether anyone else has seen something similar.

    One example is a two-dimensional array that I reset on the first tick of each bar (it doesn't look across periods at all -- it just accumulates volume counts for different price levels within a single period). Inside a code block controlled by the condition "if (FirstTickOfBar)", the code block for the array reset is controlled by the condition "if (!Historical)". On the first five real-time bars (i.e., not historical), it's like the array doesn't get reset at the beginning of each period (values accumulate across periods, resulting in wacky numbers).

    I checked the log and trace file, but no errors. Anyone?

    Thank you.


    Regards,

    #2
    I suggest starting from scratch by a simple as possible indicator, putting in print statements to debug and re-add your custom logic until it finally breaks.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    2 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frslvr, 04-11-2024, 07:26 AM
    9 responses
    124 views
    1 like
    Last Post caryc123  
    Started by selu72, Today, 02:01 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    21 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Working...
    X