Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //youtube: https://youtu.be/ONIV_u5dLZU
- int RSI=0;
- int SobreCompra=70; int SobreVenta=30;
- void OnInit()
- {
- RSI=iRSI(_Symbol,PERIOD_CURRENT,14,PRICE_CLOSE);
- }
- void OnTick()
- {
- //if(IndicadorRSI(2)>SobreCompra)
- //if(IndicadorRSI(2)<SobreVenta)
- //if(IndicadorRSI(3)>SobreCompra && IndicadorRSI(2)<SobreCompra)
- if(IndicadorRSI(4)<SobreVenta || IndicadorRSI(10)>SobreVenta)
- Alert("RSI");
- }
- double IndicadorRSI(int posicion)
- {
- double RSIArray[];
- ArraySetAsSeries(RSIArray,true);
- CopyBuffer(RSI,0,0,posicion+1,RSIArray);
- return(NormalizeDouble(RSIArray[posicion],_Digits));
- }
Advertisement
Add Comment
Please, Sign In to add comment