The following AFL I got it from somewhere else, I want to convert to TOS, but I don't know what is the "1" mean in "BBandTop(C,20,0.5),1" and what are the "0" and "-1" mean in "BBandTop(C,20,0.5),0,-1".
Can someone explain to me or convert to TOS?
Thank you very much!
_SECTION_BEGIN("");
tf= IIf(C > BBandTop(C,20,0.5),1, IIf(C<BBandTop(C,20,0.5) AND C>BBandBot(C,20,0.5),0,-1))*10;
@chaser2009 you've been using AmiBroker for many years so perhaps you should become familiar with the functions and how to properly post code on the forum using code tags.
User guide reference for immediateIF
More discussion on this forum,
So the code within the nested immediate IF's will return a 1 or a 0 (zero) or a -1 depending upon the position of the Close and the Bollinger Bands. Then it multiplies by 10.
tf= IIf(C > BBandTop(C,20,0.5), 1, IIf(C<BBandTop(C,20,0.5) AND C>BBandBot(C,20,0.5),0,-1))*10;