My System - My trades.

Reverencing previous day
tht statement is used to locate the start of new day.
Day() : is the function in AFL which will return current day.
whn we use ref for day function it gives you previous day.

and != means not equals to.

So in plane english the meaning of tht sentence is today is not equal to previous day. this ultimately will give us the meeting point of two days that in other words is starting point of the day.
that's why these codes don't work on first day of the database coz there is no previous day prior to it.
hope all is clear.

Enjoy....
Thanks Money Businness Ji and Thanks extremist ji.... for your detailed patient explanation....whenever i see this statement n=Day() != Ref(Day(), -1); i thought, previous day never equal to today , then why do we need this statement... now it is almost clear. Your codes always extreme shortest form ..
Now small logical doubt..
n=Day() != Ref(Day(), -1); ->When previous day is not equal to today True/1/Yes may be assigned to n . is it right Extremist ji.
Thanks in advance..
 

extremist

Well-Known Member
Thanks Money Businness Ji and Thanks extremist ji.... for your detailed patient explanation....whenever i see this statement n=Day() != Ref(Day(), -1); i thought, previous day never equal to today , then why do we need this statement... now it is almost clear. Your codes always extreme shortest form ..
Now small logical doubt..
n=Day() != Ref(Day(), -1); ->When previous day is not equal to today True/1/Yes may be assigned to n . is it right Extremist ji.
Thanks in advance..
yes bro...
correct.
but there is no may be in logic. either it is yes or no. 1 or 0.
plane and simple
 
Last edited:
varunkochhar, post: 1248698
Now these are colour coded OBV candles based on LVbar. Such clear and crisp way to take the initial trade and adds. Now the only problem is that once the LVB of the day is established we seldom get another LV bar. But for hourly CRB in 1min.TF we would get something like an area to play with every hour.


This is what you asked for yesterday toocoolji.Its not clear if OBV candles colour based on LVbar of OBV or Price?So posting both.

///////////////OBV candles colour based on LVbar of OBV/////////////////////////
n=Day() != Ref(Day(), -1);
a=LowestSince(n,V);
hh=ValueWhen(V==a,OBV());
ll=ValueWhen(V==a,Ref(OBV(),-1));
//PlotOHLC( hh, hh, ll, ll, "",colorblack,styleCloud|styleNoRescale,Null,Null,0,-2,0);
Plotohlc( Ref(OBV(),-1),Ref(OBV(),-1),OBV(),OBV() ,_DEFAULT_NAME(), IIf(OBV()>hh AND OBV()>ll,colorGreen,colorRed), stylecandle );
/////////////////////////////////////////////////////////////////////////////////

/////////////////////////OBV candles colour based on LVbar of Price///////////////////
n=Day() != Ref(Day(), -1);
a=LowestSince(n,V);
hh=ValueWhen(V==a,h);
ll=ValueWhen(V==a,l);
//PlotOHLC( hh, hh, ll, ll, "",colorblack,styleCloud|styleNoRescale,Null,Null,0,-2,0);
Plotohlc( Ref(OBV(),-1),Ref(OBV(),-1),OBV(),OBV() ,_DEFAULT_NAME(), IIf(c>hh AND c>ll,colorGreen,colorRed), stylecandle );
/////////////////////////////////////////////////////////////////////////////////

I don't have crude data to check if this is matching with Vkji's chart.
manish9300 ji small dought , at Plotohlc, O=L=Ref(OBV(),-1), when OBV()>Ref(OBV(),-1) , Similarly for H/C for better marking of candles at peak/trough. is it right or am i missing some thing...?

Thanks in advance..
 

manish9300

Well-Known Member
OBV candles have no high, low, open values.Only closing values are available and previous close value is used as open value.SO it goes like ......O=L or H=Ref(OBV(),-1).If up candle O=L=Ref(OBV(),-1) and C=H=OBV(),if down candle O=H=Ref(OBV(),-1) and C=L=OBV().
Candle colour is based on close and previous close for OBV candles.In the codes given, candle colour is based on close and LVB.
First one uses OBV close and LVB to colour OBV candles while second one uses Price close and LVB to colour OBV candles.
 
Last edited:
OBV candles have no high, low, open values.Only closing values are available and previous close value is used as open value.SO it goes like ......O=L or H=Ref(OBV(),-1).If up candle O=L=Ref(OBV(),-1) and C=H=OBV(),if down candle O=H=Ref(OBV(),-1) and C=L=OBV().
Candle colour is based on close and previous close for OBV candles.In the codes given, candle colour is based on close and LVB.
First one uses OBV close and LVB to colour OBV candles while second one uses Price close and LVB to colour OBV candles.
Thanku manish9300 ji, but checking of up/Down candle is not there , this may lead to wrong printing of the candle.... may be i am wrong too...
 

Similar threads