hi,,, it seem no one has reponded my requested
or pls advise how to to write this syntax in AFL AB platform
init:=Cum(IsDefined(start+end))=1;
flag:=ValueWhen(1,start-end<>0 OR init,start);
start:=flag*(Alert(flag=0,2) OR end*Cum(end)=1);
end :=(flag=0)*(Alert(flag,2) OR start*Cum(start)=1);
value:=V;
acc:=Cum(flag*value);
accVal:=acc-ValueWhen(1,end,acc);
Rgdz
SAT
{ Signal/Value accumulator code in Metastock}
Hi... Senior AFL Programer ,
can anyone help me to convert this MS code to AB-AFL code.
i ve tried but still found error.
------------------------------------------------
{ Start count signal }
start:=TroughBars(1,C,5)=0;
{ End count signal }
end:=PeakBars(1,C,5)=0;
{ Value to accumulate - Volume }
value:=V;
{ Indicator output choice }
plot:=Input("plot: [1]Accumulation, [2]Signals",1,2,1);
{ Remove redundant interim start/end signals }
init:=Cum(IsDefined(start+end))=1;
flag:=ValueWhen(1,start-end<>0 OR init,start);
start:=flag*(Alert(flag=0,2)
OR start*Cum(start)=1);
end:=(flag=0)*(Alert(flag,2)
OR end*Cum(end)=1);
{ Accumulate values }
acc:=Cum(flag*value);
accVal:=acc-ValueWhen(1,end,acc);
{ Plot in own window }
If(plot=1,accVal,start-end)
-------------------------------------------------
Rgdz
Sat