Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript Buggy and Inacurate. Please Help !!!

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

    NinjaScript Buggy and Inacurate. Please Help !!!

    Hello,

    I created a test indicator (accepting the default values of the wizard just to have a bare minimum indicator, in order to debug the odd behavior)

    The resulting created indicator code and the test code:

    protected override void OnBarUpdate()
    {
    Print("");

    for (int idx =0; idx < 20; idx++)
    {
    Print("Value before : " + Close[idx]);
    }
    Print("");

    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    Plot0.Set(Close[0]);
    }

    After loading this to a "3Minutes YM Chart, Connected to simulator", I get the following odd result:

    Value before : 10594


    1. The print shows only one value (the above value)
    2. This value is not even the last value showing on the chart ( 10729 is the last value).
    3. 10 minutes, 30 minutes and An hour later, I still get the same single value.

    I changed the code to the following:

    protected override void OnBarUpdate()
    {
    Print("Value After : " + Close[0]);
    Print("Value After 2: " + Close[1]);
    Print("Value After 3: " + Close[2]);
    Print("");

    for (int idx =0; idx < 20; idx++)
    {
    Print("Value before : " + Close[idx]);
    }
    Print("");

    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    Plot0.Set(Close[0]);
    }

    The result (some 10 minutes later):

    Value After : 10594


    That's it!??? No need to tell you that this is very odd and extremely frustrating.

    I desperately need your help and solution to this bug as all my work is currently suspended until this is resolved.

    Obi

    #2
    Hi obi, please check the recommendations send to you via mail and also in the other thread you opend - you should always check to have enough bars present before you start accessing them - http://www.ninjatrader-support2.com/...ead.php?t=3170

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    116 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    61 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    82 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X