MQL4 - automated forex trading   /  

Forum

How to automatically set "integer value" to "zero" in every 15 minutes?

Back to topics list To post a new topic, please log in or register

avatar
4
nova5000 2010.05.12 19:39 

Hi...i'm trying to writer a program that needed to reset the "int" value to "0" quarterly...

Can anyone guide me to set "integer value" to "0" in every 15 minutes???

Any suggestion will be deeply appreciated...

An Expert Advisor Made to Order. Manual for a Trader

An Expert Advisor Made to Order. Manual for a Trader

Not all traders are programmers. And not all of the programmers are really good ones. So, what should be done, if you need to automate your system by do not have time and desire to study MQL4?


avatar
391
Russell 2010.05.12 20:18 
if (iVolume("EURUSD", PERIOD_M15, 0) <= 1){
  liMyInt = 0;
}
hth

avatar
4328
WHRoeder 2010.05.20 01:14 

Don't use volume. it is unreliable. A new bar can have volume greater than one.

start() {         static datetime Time_P_M15;
if (TimeCurrent() > Time_P_M15) { Time_P_M15 =TimeCurrent() + 15*60;
   liMyInt = 0;
}
If you are running on a 15 minute chart and you want to do something at start of a new bar:
int start() {                       static datetime Time0;
   bool newBar = Time[0] > Time0;   if (newBar) {   Time0 = Time[0];
   //...
   }
   return(0);
}

Back to topics list  

To add comments, please log in or register