rsi<30 and sort for Amibroker (AFL)
ali32b over 12 years ago Amibroker (AFL)
It will find rsi <30 and shows Internal RSI in a column and sort them by rsi in ascending order.
Indicator / Formula
Copy & Paste Friendly
function BuiltInRSIEquivalent( period )
{
P = N = 0;
result = Null;
for( i = 1; i < BarCount; i++ )
{
diff = C[ i ] - C[ i - 1 ];
W = S = 0;
if( diff > 0 ) W = diff;
if( diff < 0 ) S = -diff;
P = ( ( period -1 ) * P + W ) / period;
N = ( ( period -1 ) * N + S ) / period;
if( i >= period )
result[ i ] = 100 * P / ( P + N );
}
return result;
}
Buy=BuiltInRSIEquivalent(14)<30 ;
Filter=Buy;
AddColumn(BuiltInRSIEquivalent(14), "RSI15");
SetSortColumns(3,-2);2 comments
Leave Comment
Please login here to leave a comment.
hi iam new in forex i want to know what is AFL
Great code! Many thanks!