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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    29 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    17 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    9 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    15 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X