Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Erroneous open...

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

    Erroneous open...

    I have the following script in OnBarUpdate:
    Code:
                            CanID[CanNumber] = "Current Day";
                            Fast[CanNumber]= 6;
                            Slow[CanNumber]= 13;
                            Smooth[CanNumber] = 9;
                            numStdDev[CanNumber] = 2;
                            period[CanNumber] = 14;
                            TOI = Time[0];
                            barsAgo=GetBar(new DateTime(TOI.Year,TOI.Month,TOI.Day,00,00,00));
                            SubjBar = HighestBar(High,barsAgo);
                            Canhigh[CanNumber] = High[SubjBar];
                            SubjBar = LowestBar(Low,barsAgo);
                            Canlow[CanNumber] = Low[SubjBar];
                            Canopen[CanNumber] = Open[barsAgo];
                            Canclose[CanNumber] = Close[0];
    Occasionally the open price will be outside of the high and low, as if it were "clinging" to the open from the previous session. I am lost! Please help!

    #2
    Sleeping Troll, I'm not sure what exactly your code is doing. Can you please further explain what is going on and why you think the open is wrong? This little bit of code doesn't fully explain what you're trying to do. Is your variable 'Canopen' the one obtaining a "wrong" value? If so, what value of barsAgo is being evaluated?
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X