XavierAndreu

2 indicadores

Mar 21st, 2023 (edited)
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. //Youtube-->https://youtu.be/tln2kvYGNLk
  2.  
  3. int MACD=0;
  4. int RSI=0;
  5.  
  6. void OnInit()
  7. {
  8. MACD=iMACD(_Symbol,PERIOD_CURRENT,12,26,9,PRICE_CLOSE);
  9. RSI=iRSI(_Symbol,PERIOD_CURRENT,14,PRICE_CLOSE);
  10. }
  11.  
  12. void OnTick()
  13. {
  14. Comment( "Liena.P= ",IndicadorMACD(0),
  15. "\nSeñal= ",IndicadorMACD(1),
  16. "\nSeñal= ",IndicadorRSI(0)
  17. );
  18. }
  19.  
  20. double IndicadorMACD(int Buffer)
  21. {
  22. double MACDArray[];
  23. ArraySetAsSeries(MACDArray,true);
  24. CopyBuffer(MACD,Buffer,0,2,MACDArray);
  25.  
  26. return(NormalizeDouble(MACDArray[1],_Digits));
  27. }
  28.  
  29. double IndicadorRSI(int Buffer)
  30. {
  31. double RSIArray[];
  32. ArraySetAsSeries(RSIArray,true);
  33. CopyBuffer(RSI,Buffer,0,2,RSIArray);
  34.  
  35. return(NormalizeDouble(RSIArray[1],_Digits));
  36. }
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment