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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    33 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    184 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    343 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    264 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X