MQL4 - automated forex trading   /  

Forum

I use H4 OPEN price in my EA. I don't want to check every tick and only to check every beginning of 4 hours. How to do that?

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

avatar
163
valleyfir 2008.07.03 05:58 
I use H4 OPEN price in my EA. I don't want to check every tick and only to check every beginning of 4 hours. How to do that?
article

Interview with Lingyu Jiang (jianglingyu)

My Expert Advisor tries to catch the main trend of a day. It's based on the famous catfx50 strategy. Sometimes it will use Moving Average cross as the signal. The main indicator is StepMA. It will take 0, 1 or 2 trades a day normally, and has a StopLoss as small as 18 pips. If it wins, it makes 20-100 pips. The theory behind this expert is: "Many a pickle makes a muckle".


avatar
2462
phy 2008.07.03 06:57 

if(Volume[0] == 1)

{

... do your stuff...

}

.

When that is true, you are at the first tick of a new bar, in the chart timeframe.


avatar
79
riyo 2008.07.03 10:43 
int prevtime = 0;
 
int start()
{
  if(prevtime == Time[0]) return(0);
  prevtime = Time[0];
 
  // your code here
}
Try above code

avatar
163
valleyfir 2008.07.04 03:36 
riyo wrote >>
Try above code

Thanks riyo! I've tried and it worked.


avatar
163
valleyfir 2008.07.04 04:03 
phy wrote >>

if(Volume[0] == 1)

{

... do your stuff...

}

.

When that is true, you are at the first tick of a new bar, in the chart timeframe.

Thanks phy! I searched the documentation and knew what Volume[0] meant. However, I have a question, waht if the volume of first tick doesn't equal to 1?


avatar
2462
phy 2008.07.04 09:59 

Then say "I don't like this method at all", and use a Time method, or use both.


avatar
9
JStein 2008.07.05 16:25 
valleyfir wrote >>

Thanks phy! I searched the documentation and knew what Volume[0] meant. However, I have a question, waht if the volume of first tick doesn't equal to 1?

The value of Volume[0] is not a real volume but always a count for ticks in this period. So if Volume[0] == 5 itmenas the 5th tic in actual period. So what do you

mean with " .. the volume of first tick doesn't equal to 1? .."


avatar
163
valleyfir 2008.07.06 07:06 
JStein wrote >>

The value of Volume[0] is not a real volume but always a count for ticks in this period. So if Volume[0] == 5 itmenas the 5th tic in actual period. So what do you

mean with " .. the volume of first tick doesn't equal to 1? .."

I have thought the Volume is the actual volume, so I have a question of that. Know I understand, thanks.

Back to topics list  

To add comments, please log in or register