Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //+------------------------------------------------------------------+
- //| Expert tick function |
- //+------------------------------------------------------------------+
- void OnTick()
- {
- //---
- static double lastHigh;
- static double lastLow;
- MqlRates priceInfo[];
- ArraySetAsSeries(priceInfo, true);
- int priceData = CopyRates(_Symbol, _Period, 0, 3, priceInfo);
- if ((lastHigh != priceInfo[1].high) && (lastLow != priceInfo[1].low)) {
- int handle = FileOpen("aaa.csv", FILE_READ|FILE_WRITE|FILE_CSV|FILE_ANSI);
- FileSeek(handle, 0, SEEK_END);
- FileWrite(handle, "Time", priceInfo[1].time);
- FileClose(handle);
- lastHigh = priceInfo[1].high;
- lastLow = priceInfo[1].low;
- Comment(priceInfo[1].high);
- }
- }
- //+------------------------------------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement