Buy stocks with the smallest RSI values from a list

Hello everyone,

I would like to use my system to buy stocks with the smallest RSI. Unfortunately, this does not work with my formula that I have written so far. Here is an attempt at my formula:

filter = 1;
AddColumn( RSI( 14 ), "RSI( 14 )" );
AddColumn( Sort( RSI( 14 ) ), "Sorted RSI( 14 )" );
AddColumn( Sort( Close, 0, -1, True ), "Index of sorted item", 1.0 );

Buy = RSI( 14 ) < 20
Sell = RSI( 14 ) > 85;

Could you please help me make the formula work.
Thanks in advance and have a nice day!

Michael

When posting the formula, please make sure that you use Code Tags (using </> code button) as explained here: How to use this site .

Using code button

Code tags are required so formulas can be properly displayed and copied without errors.

See
https://www.amibroker.com/guide/h_portfolio.html

2 Likes

Thank you very much for your help!

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.