XavierAndreu

Crear MACD

Mar 31st, 2022
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. //https://youtu.be/ldvZB72SoPs
  2.  
  3. int MACD=0;
  4.  
  5. int OnInit()
  6. {
  7. MACD=iMACD(_Symbol,PERIOD_CURRENT,12,26,9,PRICE_CLOSE);
  8. return(0);
  9. }
  10.  
  11. void OnTick()
  12. {
  13. Comment( "Liena.P= ",IndicadorMACD(0),
  14. "\nSeƱal= ",IndicadorMACD(1)
  15. );
  16. }
  17.  
  18. double IndicadorMACD(int Buffer)
  19. {
  20. double MACDArray[];
  21. ArraySetAsSeries(MACDArray,true);
  22. CopyBuffer(MACD,Buffer,0,2,MACDArray);
  23.  
  24. return(NormalizeDouble(MACDArray[1],_Digits));
  25. }
Advertisement
Add Comment
Please, Sign In to add comment