My System - My trades.

extremist

Well-Known Member
MB Ji , What is the exact meaning of this
stayement ?
n=Day() != Ref(Day(), -1);
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....
 
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....
Very Neatly explained... A newbie also would understand this... Appreciate your patience :)
 

Shikamaru

What a drag!!!
B

Bhai,
what are this bands at the bottom of your price chart?
Both should not be so identical.
VKSL Band, Consider band only in Price Pane
Ignore band in OBV pane!

Courtesy to author: @extremist

Code:
_SECTION_BEGIN("VKSLline V 1.01");

n=Day() != Ref(Day(), -1);

a=LowestSince(n,V);
hh=ValueWhen(V==a,H);
ll=ValueWhen(V==a,L);

hr = ValueWhen(V==a,Hour());
mn = ValueWhen(V==a,Minute());
e36 = EMA(C,36);

res=Max(e36,hh);
sup=Min(e36,ll);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
col = IIf(avn==1,colorGreen,colorRed);

Plot(tsl,"\nVKSL ",col,styleThick);

y=5;
PlotOHLC(y,Y+10,y,y,"",col,styleOwnScale|styleNoLabel|styleCloud,0,200,0,-5);

_SECTION_END();


_SECTION_BEGIN("VK LVB");

n=Day() != Ref(Day(), -1);

a=LowestSince(n,V);
hh=ValueWhen(V==a,H);
ll=ValueWhen(V==a,L);

hr = ValueWhen(V==a,Hour());
mn = ValueWhen(V==a,Minute());

Plot(hh,"\nLVhb ",colorYellow,styleDashed);
Plot(ll,"\nLVlb @ ("+hr+" : "+mn+") ",colorWhite,styleDashed);
PlotOHLC(ll,hh,ll,hh,"",colorBlack,styleCloud,0,0,0,-2);

_SECTION_END();
 

Similar threads