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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 08:03 AM
    0 responses
    2 views
    0 likes
    Last Post f.saeidi  
    Started by cre8able, 04-17-2024, 04:16 PM
    7 responses
    63 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Aviram Y, 08-09-2023, 09:04 AM
    11 responses
    299 views
    0 likes
    Last Post arjandezeeuw  
    Started by Christopher Leggit, 02-15-2024, 09:00 AM
    3 responses
    47 views
    0 likes
    Last Post rdtdale
    by rdtdale
     
    Started by DavidHP, Today, 07:56 AM
    0 responses
    2 views
    0 likes
    Last Post DavidHP
    by DavidHP
     
    Working...
    X