REDUCED LEVELS AS PER ADVGET-need afl

#1
Hi xperts

here is the code as given by THETRADER in advget section. can we have it in amibroker language please.
we can check how far it helps for trading
Link
http://www.traderji.com/advanced-get/26644-tjs-levels-reduced.html
regards
------------------

The TJ's levels in Advanced Get are, a certain % of prev. day's range above & below prev. day's close. The percentages are, 7.3%, 30.9%, 54.5%, 69.1% & 92.7%, and, these are 'Reduced' levels. There are Normal and Extended also. I am giving Metastock formula for plotting the daily levels on an intraday chart. I am also attaching screenshot of these levels plotted on Nifty Futures.

{CPATJsLevelsReduced}
PH:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)),
HighestSince(1,DayOfMonth() <> Ref(DayOfMonth() ,-1) ,H )) ;

PL:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)),
LowestSince(1,DayOfMonth() <> Ref(DayOfMonth() ,-1) ,L )) ;

PC:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)), C);

PR:= PH - PL;

RD:= PC + 0.927*PR;
RC:= PC + 0.691*PR;
RB:= PC + 0.545*PR;
RA:= PC + 0.309*PR;

NU:= PC + 0.073*PR;
ND:= PC - 0.073*PR;

SA:= PC - 0.309*PR;
SB:= PC - 0.545*PR;
SC:= PC - 0.691*PR;
SD:= PC - 0.927*PR;

RD;
RC;
RB;
RA;

NU;
ND;

SA;
SB;
SC;
SD;
{Code ends here}
 

KelvinHand

Well-Known Member
#2
Hi xperts

here is the code as given by THETRADER in advget section. can we have it in amibroker language please.
we can check how far it helps for trading
Link
http://www.traderji.com/advanced-get/26644-tjs-levels-reduced.html
regards
------------------

The TJ's levels in Advanced Get are, a certain % of prev. day's range above & below prev. day's close. The percentages are, 7.3%, 30.9%, 54.5%, 69.1% & 92.7%, and, these are 'Reduced' levels. There are Normal and Extended also. I am giving Metastock formula for plotting the daily levels on an intraday chart. I am also attaching screenshot of these levels plotted on Nifty Futures.

{CPATJsLevelsReduced}
PH:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)),
HighestSince(1,DayOfMonth() <> Ref(DayOfMonth() ,-1) ,H )) ;

PL:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)),
LowestSince(1,DayOfMonth() <> Ref(DayOfMonth() ,-1) ,L )) ;

PC:=ValueWhen(1,
(DayOfMonth() <> Ref(DayOfMonth() ,1)), C);

PR:= PH - PL;

RD:= PC + 0.927*PR;
RC:= PC + 0.691*PR;
RB:= PC + 0.545*PR;
RA:= PC + 0.309*PR;

NU:= PC + 0.073*PR;
ND:= PC - 0.073*PR;

SA:= PC - 0.309*PR;
SB:= PC - 0.545*PR;
SC:= PC - 0.691*PR;
SD:= PC - 0.927*PR;

RD;
RC;
RB;
RA;

NU;
ND;

SA;
SB;
SC;
SD;
{Code ends here}
Code:
//{CPATJsLevelsReduced}
PH=ValueWhen((Day() != Ref(Day() ,1)), HighestSince(Day() != Ref(Day() ,-1) ,H )) ;
PL=ValueWhen((Day() != Ref(Day() ,1)), LowestSince(Day() != Ref(Day() ,-1) ,L )) ;
PC=ValueWhen((Day() != Ref(Day() ,1)), C);

PR= PH - PL;

RD= PC + 0.927*PR;
RC= PC + 0.691*PR;
RB= PC + 0.545*PR;
RA= PC + 0.309*PR;

NU= PC + 0.073*PR;
ND= PC - 0.073*PR;

SA= PC - 0.309*PR;
SB= PC - 0.545*PR;
SC= PC - 0.691*PR;
SD= PC - 0.927*PR;

Plot(RD, "RD", colorRed, styleNoLabel);
Plot(RC, "RC", colorRed, styleNoLabel);
Plot(RB, "RB", colorRed, styleNoLabel);
Plot(RA, "RA", colorRed, styleNoLabel);


Plot(NU, "NU", colorGold, styleNoLabel) ;
Plot(ND, "ND", colorGold, styleNoLabel) ;



Plot(SA, "SA", colorGreen, styleNoLabel) ;
Plot(SB, "SB", colorGreen, styleNoLabel) ;
Plot(SC, "SC", colorGreen, styleNoLabel) ;
Plot(SD, "SD", colorGreen, styleNoLabel) ;
 

Similar threads