Can anyone code this simple EA? - page 3

 

Sample hour didn't work. Almost as soon as I opened the Platform and the market opened, it placed trades.

 

I know what you mean, and yes, I didn't think clear enough. The EA always check back for the price at the last sample hour (which may be yesterday) as a basis. Probably not the right thing. Hmm, after the weekend it's even more strange. I suppose, when you start the EA, it should only consider trading into the future, and it shouldn't look back to yesterday.... all this just because I wanted to avoid that it keeps runtime state

 

ralphy..won't this EA that you wrote work?...just enter in zero's for TS and BE..

ES

https://www.mql5.com/en/forum/177788

 

Possibly. Probably. But I updated this EA to have an "enabling period limit" so that it should only consider a trade that number of hours after the sample time. All in post #2. This also made it look better at my cursory backtest; didn't even bottom it out.

Also, in case the copyright notice stopped anyone, I've now made this a Public domain software. Go for it.

 
ElectricSavant:
ralphy..won't this EA that you wrote work?...just enter in zero's for TS and BE..

ES

https://www.mql5.com/en/forum/177788

Btw. In fairness: I didn't write that EA. I merely made a small correction.

 
ralph.ronnquist:
Possibly. Probably. But I updated this EA to have an "enabling period limit" so that it should only consider a trade that number of hours after the sample time. All in post #2. This also made it look better at my cursory backtest; didn't even bottom it out. Also, in case the copyright notice stopped anyone, I've now made this a Public domain software. Go for it.

I thought the EA was only supposed to initiate the trade at exactly 07:00 GMT ??

So why the 'enabling period limit' option?

On the BackTest it opens when ever it feels like ??

 

As I read it, the method was to make a trade when or after that price has moved 40 pips away from the 7am price. So it all depends on when that happens, which in theory can be at any time after 7am, up to the next day 7am (and even after that). arsenic786 didn't give any expiration, though maybe there is something implied.

But, you are right in that arsenic786 did express the method in terms of pending orders, whereas I made the EA use market orders attempting to implement the pending order trades. There is a difference, maybe significant, so the EA does not implement the exact method, although it attempts to execute the exact trades that the method proposes.

 

RR,

What does this mean?

But I updated this EA to have an "enabling period limit"

 

Oh, well, it was a good try. The backtest shows multiple trades in one day, so something isn't right.

 
ElectricSavant:
RR,

What does this mean?

But I updated this EA to have an "enabling period limit"

I meant that the EA now takes a parameter by which you tell how many hours following the sample hour that the EA is to look for entering a trade. After that time, it does not (should not) make any trade until next sample hour.

Though, going by matrixbiz, I've been sloppy again so don't hold your breath.

Reason: