Count Minutes Within Bar
2 replies
tomas262
7 years ago #115017
Let’s say you trade 15 minute chart and you want to enter at 10th minute and not wait for bar close. Here is how to do it:
Add this into EA Wizard / code / CustomFunctions.mq4 file. Then you can use it in Wizard as it is shown in example attached.
int getCurrentMinute() { return Minute(); }
Only variable to set for EA is how many minutes to wait after bar opens.
Bear in mind that you need to use “Every tick” backtesting precision to make this work correctly in MetaTrader
krikri
7 years ago #139016
Hi Tomas262,
there is an error when I compile your example minuteCounter.mql4
can you help me please
Regards
Christian
tomas262
7 years ago #139035
Viewing 2 replies - 1 through 2 (of 2 total)