Reply

Count Minutes Within Bar

2 replies

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

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

0

krikri

Subscriber, bbp_participant, community, 49 replies.

Visit profile

7 years ago #139016

Hi Tomas262,

 

there is an error when I compile your example minuteCounter.mql4

 

can you help me please

 

Regards

 

Christian

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #139035

Hello,

 

make sure the code above shown is placed in the EA code. Look at the sample attached

File: code.pngcode.png

0

Viewing 2 replies - 1 through 2 (of 2 total)