Jump to content
Medved Trader Forums

Advanced Paintbar "Today High" / "Today Low" Horizontal Line values only reflect Entire Day

Doug Hayman

Recommended Posts

I noticed this while trading live versus reviewing a trade of mine via Advanced Paintbars:

When trading live, the PB Horizontal Line Intraday Values for "Today's High" and "Today's Low" display chart-wise and indicate value-wise the correct values to date.

However, I noticed that after reloading my symbol data, my Paintbar results (which sometimes are predicated on Today's High/Low values), indicated different results from my Live trade.

Upon examination, my historical paintbar used the High/Low values of the entire day in its calculation, as opposed to the what the actual High/Low value was at the time of my trade.

I tried enabling the "Reg. Session Values Only" flag in the Parameter setting for these 2 Variable declarations, but that didn't change anything.

Link to comment
Share on other sites

That's correct - the Today's High and Today's Low are actual Today's high/low - right now, not at the time of the candle.

If you wants a paintbar/scan to get the high and low for the day *at the time of the candle* you have to keep track of it yourself.

It is pretty easy to do


double DayHigh, DayLow;
int PrevDayNumber = -1;

then, inside the paintbar, at start, do:

    var info = GetTradingSessionInfo(Timestamp);
    if (info.DayNumber!=PrevDayNumber)
        DayHigh = High; DayLow=Low; PrevDayNumber=info.DayNumber;
        DayHigh = Math.Max(DayHigh, High);
        DayLow  = Math.Min(DayLow, Low);

There ya go.


  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...