XavierAndreu

Crear Estocástico

Apr 1st, 2022
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. //https://youtu.be/Ofi79yvDL0U
  2.  
  3. int Stochastic=0;
  4.  
  5. int OnInit()
  6. {
  7. Stochastic=iStochastic(_Symbol,PERIOD_CURRENT,5,3,3,MODE_SMA,STO_LOWHIGH);
  8.  
  9. return(0);
  10. }
  11.  
  12. void OnTick()
  13. {
  14. Comment( "Main= ",IndicadorStochastic(0),
  15. "\nSignal= ",IndicadorStochastic(1)
  16. );
  17. }
  18.  
  19.  
  20. double IndicadorStochastic(int Buffer)
  21. {
  22. double StochasticArray[];
  23. ArraySetAsSeries(StochasticArray,true);
  24. CopyBuffer(Stochastic,Buffer,0,2,StochasticArray);
  25.  
  26. return(NormalizeDouble(StochasticArray[1],_Digits));
  27. }
Advertisement
Add Comment
Please, Sign In to add comment