Write to File - but just once per minute

 

Hi All,

I am writing select data on my trades to a .txt file. My EA operates at the tick level.

I calculate the current server time at the minute level = CMinute.

At minutes 5,15,30,45,59, I want to "write to file" only once during that minute.

I am currently posting, say on CMinute = 15, from 5-30 records (ticks) to the .txt file.

How can I get the EA to post only once during the selected minutes.

Seems like there should be an easy way.


Thank you in advance


Ross Crill

Documentation on MQL5: File Functions / FileWrite
Documentation on MQL5: File Functions / FileWrite
  • www.mql5.com
//|                                               Demo_FileWrite.mq5 | //|                        Copyright 2013, MetaQuotes Software Corp. | //|                                              https://www.mql5.com | //| Script program start function                                    | //
 
rcrill: Seems like there should be an easy way.
  1. Remember the minute you last wrote, and don't if it hasn't changed.

  2. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor
Reason: