How to locate yesterdays High of the day

sr114

Well-Known Member
#2
Suppose i want to draw a vertical line at yesterdays High of the day then what condition is needed to do so

We can draw vertical line by:

Plot(TimeNum()==091500,"",colorBlue,styleHistogram|styleOwnScale);
1st find out yesterday's high by requisite time frame operation, then plot that. but vertical line will be plotted ,

instead u plot a horizontal line depicting the yesterday high, then it will be visible throughout whereas the vertical line will be on that particular bar.

to get yesterday high , use
// Example - get previous Day High when working on intraday data
TimeFrameGetPrice( "H", inDaily, -1 )
then plot this line

thanx
Subroto
 

extremist

Well-Known Member
#3
1st find out yesterday's high by requisite time frame operation, then plot that. but vertical line will be plotted ,

instead u plot a horizontal line depicting the yesterday high, then it will be visible throughout whereas the vertical line will be on that particular bar.

to get yesterday high , use


then plot this line

thanx
Subroto
i particularly want that vertical line. the horizontal line is easy i knew it. how to do tht.

Actually i want to calculate bars from yesterday high.
So i given the example of plotting the vertical line.

Thank u
Extremist
 

sr114

Well-Known Member
#4
i particularly want that vertical line. the horizontal line is easy i knew it. how to do tht.

Actually i want to calculate bars from yesterday high.
So i given the example of plotting the vertical line.

Thank u
Extremist
same thing, just use the vertical i.e.- stylehistogram to plot that but u have to find the value by using that function
 
#9
Actually i want to plot the Vwap from the yesterday high to the last bar of today
Even After the hint from happyji i'm unable to create the code.

So please any senior would u look in to this code....?
Not a senior but anyway :lol:

Code:
DayHigh = H==TimeFrameGetPrice("H",inDaily);
Plot(IIf(DayHigh,Null,MA(Avg,BarsSince(DayHigh)+1)),"VWAP",colorBrightGreen,styleThick);
Plz note that the code is dynamic (not forward looking), but
as the today's high can/will change the MA line will also change . . .


Happy :)
 

extremist

Well-Known Member
#10
Not a senior but anyway :lol:

Code:
DayHigh = H==TimeFrameGetPrice("H",inDaily);
Plot(IIf(DayHigh,Null,MA(Avg,BarsSince(DayHigh)+1)),"VWAP",colorBrightGreen,styleThick);
Plz note that the code is dynamic (not forward looking), but
as the today's high can/will change the MA line will also change . . .


Happy :)
well thank u sirji i actually Managed this.

tht's why i had particularly written "i want to plot the Vwap from the yesterday high to the last bar of today"

My way is little long cut :
Code:
start = H==TimeFrameGetPrice("H",inDaily); 
sh=ValueWhen(start,H);
sl=ValueWhen(start,L);
mp = IIf(sh>Ref(H,-1),H,IIf(sl<Ref(L,-1),L,C));
PV = mp * V; 
CV = Cum( V ); 
VSS = CV - ValueWhen( start, CV ); 

denom = IIf( VSS == 0, 1, VSS ); 
num = Cum( PV ) - ValueWhen( start, Cum( PV ) ); 

M = IIf( BarsSince( start ), num/denom, mp ); 

//Plot( C, Date() + "Close", colorBlack, styleBar ); 
Plot( M, "\n M : ", colorBlue ,styleThick);
 
Last edited: