XavierAndreu

Desviación Estándar

Apr 21st, 2022
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. //https://youtu.be/oNiu3iwiMtA
  2.  
  3. int Desviacion=0;
  4.  
  5. int OnInit()
  6. {
  7. Desviacion=iStdDev(_Symbol,PERIOD_CURRENT,20,0,MODE_SMA,PRICE_CLOSE);
  8. return(0);
  9. }
  10.  
  11. void OnTick()
  12. {
  13. Comment( "Desviacion= ",IndicadorDesviacion());
  14. }
  15.  
  16. double IndicadorDesviacion()
  17. {
  18. double DesviacionArray[];
  19. ArraySetAsSeries(DesviacionArray,true);
  20. CopyBuffer(Desviacion,0,0,2,DesviacionArray);
  21.  
  22. return(NormalizeDouble(DesviacionArray[1],_Digits));
  23. }
Advertisement
Add Comment
Please, Sign In to add comment