Need afl code for plotting support resistance on 5 minute chart with voltility 0.1

ford7k

Banned
hi friends

Need afl code for plotting 2 levels support resistance on 5 minute chart with volatility 0.1
thanks
-----------------------------------------------------------
please convert following metastock code into afl

//Support AND Resistance Levels metastock code
/*

AVd:=if(Close>Ref(Peak(1,H,1) ,-1),
{then}1,
{else}if(Close<Ref(Trough(1,L,1),-1),
{then}-1,
{else}0));
ANv:=ValueWhen(1,AVd<>0,AVd);
SuRe:=if(ANv=-1,
{then}Peak(1,H,1),
{else}Trough(1,L,1));
SuRe;
-------------------
also another metastock code(seems lik pivots) to be converted to afl please
-----------------------------------------------------------------------------------
//Support and Resistance

//I wrote this MetaStock Expert for calculating the support 1 & 2 and resistance 1 & 2 as per Futures magazine, October 1999, page 52.

FIRST RESISTANCE: WRITEVAL(-L+(2* (H+L+C)/3),1.2)
SECOND RESISTANCE: WRITEVAL(((H+L+C)/3) +((-L+(2*
(H+L+C)/3))-(-H+(2* (H+L+C)/3))),1.2)
FIRST SUPPORT:
WRITEVAL(-H+(2*(H+L+C)/3),1.2)
SECOND SUPPORT: WRITEVAL(((H+L+C)/3)
-((-L+(2* (H+L+C)/3))-(-H+(2* (H+L+C)/3))),1.2)

//from Mike Arnoldi
------------------------------------------------------------------------

regards
ford

Last edited:

casoni

Well-Known Member
Re: Need afl code for plotting support resistance on 5 minute chart with voltility 0.

Vol=0.1;
//Support AND Resistance Levels metastock code
AVd=IIf(Close>Ref(Peak(H,Vol) ,-1),1,IIf(Close<Ref(Trough(L,Vol),-1),-1,0));
ANv=ValueWhen(AVd!=0,AVd);
SuRe=IIf(ANv == -1,Peak(H,Vol),Trough(L,Vol));
Plot(SuRe,"",6,1);
Plot(C,"",3,64);

rvlv

Active Member
Re: Need afl code for plotting support resistance on 5 minute chart with voltility 0.

HI CASONI and other experts

Is it possible to have this code plot weekly monthly lines on daily chart please
thanks
rvlv

Vol=0.1;
//Support AND Resistance Levels metastock code
AVd=IIf(Close>Ref(Peak(H,Vol) ,-1),1,IIf(Close<Ref(Trough(L,Vol),-1),-1,0));
ANv=ValueWhen(AVd!=0,AVd);
SuRe=IIf(ANv == -1,Peak(H,Vol),Trough(L,Vol));
Plot(SuRe,"",6,1);
Plot(C,"",3,64);