XavierAndreu

Calcular Media Spread

Oct 1st, 2022
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. // https://youtu.be/VuyDXGWUBdk
  2.  
  3. int contador=1;
  4. int sumadorSpread=0;
  5.  
  6. int OnCalculate(const int rates_total,
  7. const int prev_calculated,
  8. const int begin,
  9. const double &price[])
  10. {
  11. Comment("Spread: ",SymbolInfoInteger(_Symbol,SYMBOL_SPREAD),
  12.  
  13. "\ncontador: ",contador,
  14. "\nSumadorspread: ",sumadorSpread,
  15. "\nMedia Spread: ",
  16. (sumadorSpread=sumadorSpread +
  17. SymbolInfoInteger(_Symbol,SYMBOL_SPREAD))
  18. /contador
  19. );
  20.  
  21. contador++;
  22.  
  23. return(0);
  24. }
  25.  
  26.  
  27. void DibujarLinea(string Linea, double Posicion)
  28. {
  29. ObjectCreate(Symbol(),Linea,OBJ_HLINE,0,0,Posicion);
  30. ObjectSetInteger(Symbol(),Linea,OBJPROP_COLOR,clrYellow);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment