Swing

#1
Hello:

It would want to modify the following AFL:

//SWING FORMULA//
function stoploss (no) {
res=HHV(H,no);
sup=LLV(L,no);
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);
return tsl;
}
Plot(stoploss(2),"Stop Loss",colorblack, styleStaircase);


The AFL is ascending and descendant stairs that follow the price. But that it has in his ascending trip or descendant small backward movements which I want to eliminate, to use it as a trailing stoploss .

They could add linear the necessary ones to me to the AFL, or modify this one. Thank you very much.
They pardon by my level of English.

Greetings,
 

asnavale

Well-Known Member
#2
Hello:

It would want to modify the following AFL:

//SWING FORMULA//
function stoploss (no) {
res=HHV(H,no);
sup=LLV(L,no);
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);
return tsl;
}
Plot(stoploss(2),"Stop Loss",colorblack, styleStaircase);


The AFL is ascending and descendant stairs that follow the price. But that it has in his ascending trip or descendant small backward movements which I want to eliminate, to use it as a trailing stoploss .

They could add linear the necessary ones to me to the AFL, or modify this one. Thank you very much.
They pardon by my level of English.

Greetings,
Hi Mary,

I did not find any "Backward movement". May be I did not understand what you mean by "Backward Movement". If you can attach a chart and show on the chart what is backward movement and also what you want to see on chart it will be easy to write the AFL.

-Anant
 

Similar threads