XavierAndreu

Alerta RSI

May 7th, 2022
1,068
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //youtube: https://youtu.be/ONIV_u5dLZU
  2.  
  3. int RSI=0;
  4. int SobreCompra=70; int SobreVenta=30;
  5.  
  6. void OnInit()
  7. {
  8. RSI=iRSI(_Symbol,PERIOD_CURRENT,14,PRICE_CLOSE);
  9. }
  10.  
  11. void OnTick()
  12. {
  13. //if(IndicadorRSI(2)>SobreCompra)
  14. //if(IndicadorRSI(2)<SobreVenta)
  15. //if(IndicadorRSI(3)>SobreCompra && IndicadorRSI(2)<SobreCompra)
  16. if(IndicadorRSI(4)<SobreVenta || IndicadorRSI(10)>SobreVenta)
  17. Alert("RSI");
  18. }
  19.  
  20. double IndicadorRSI(int posicion)
  21. {
  22. double RSIArray[];
  23. ArraySetAsSeries(RSIArray,true);
  24. CopyBuffer(RSI,0,0,posicion+1,RSIArray);
  25.  
  26. return(NormalizeDouble(RSIArray[posicion],_Digits));
  27. }
  28.  
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment