Advertisement
Guest User

Untitled

a guest
Dec 19th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1.  
  2. //+------------------------------------------------------------------+
  3. //| Expert tick function |
  4. //+------------------------------------------------------------------+
  5. void OnTick()
  6. {
  7. //---
  8. static double lastHigh;
  9. static double lastLow;
  10.  
  11. MqlRates priceInfo[];
  12.  
  13. ArraySetAsSeries(priceInfo, true);
  14.  
  15. int priceData = CopyRates(_Symbol, _Period, 0, 3, priceInfo);
  16.  
  17. if ((lastHigh != priceInfo[1].high) && (lastLow != priceInfo[1].low)) {
  18.  
  19. int handle = FileOpen("aaa.csv", FILE_READ|FILE_WRITE|FILE_CSV|FILE_ANSI);
  20.  
  21. FileSeek(handle, 0, SEEK_END);
  22.  
  23. FileWrite(handle, "Time", priceInfo[1].time);
  24. FileClose(handle);
  25. lastHigh = priceInfo[1].high;
  26. lastLow = priceInfo[1].low;
  27.  
  28. Comment(priceInfo[1].high);
  29. }
  30. }
  31. //+------------------------------------------------------------------+
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement