# Buy or Sell at specific RSI

Hi,

I’m still learning to code and was wondering whether it is possible to specify the buy price as the price at a specific RSI level.

``````Buy = Cross(RSI(5),30) AND (High > EMA(Close,5));
Sell = RSI(5)>=75 OR (Low < EMA(Close,5) AND RSI(5)<45);

``````

Buy --> When High is above 5 period EMA. Also, 5 period RSI crosses or has already crossed 30 from below.
Buyprice --> Amibroker must consider buyprice as the price that would have been when RSI(5) is 30.25

In other words --> I will have a buy stop ready for the price level at which RSI(5) will be 30.25, if price is more than EMA.

Sell --> Sell if RSI(5) equals or is greater than 75; alternative exit --> if low falls below 5 period EMA and 5 period RSI is less than 45.

thanks

any pointers or help? many thanks for the assistance

To do this you would need a Reverse RSI Solver to determine the price at which a particular RSI value would occur. You can find such a Solver on Cesar Alvarez’s site: http://alvarezquanttrading.com/amibroker/.

1 Like

Dear friends,

I need AFL with RSI with popup alerts at 60 BUY & At 40 SELL
Can any friend help me on this.

at present using below formula, would like to add ALERT at 60 BUY & At 40 SELL -

_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
Plot( RSI( periods), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

Rds,Mandy

@mandy do not post the same request in multiple threads. Also if you are starting a new topic just start a new forum thread. Search the user guide and the knowledge base and this forum before asking someone to do all your work for you.

Your "code" is just the Plot of an RSI. If you are looking to add BUY and SELL arrows then review
https://www.amibroker.com/guide/afl/plotshapes.html

For Alerts, and PopUP information try the user guide,