Fire EA: Can you create this EA? - page 3

 

Now I'm getting a bunch of Error sending Order 130, Order Send Error 130 messages. I'm still getting a bunch of Losses for -66.72 and when it does make profit its 162.03. I also see that they are all BUYS.... there are no SELLS. I dont believe its coded correctly for the parameters I mentioned. It should make about $100 per trade, long or short @ 1 Lot.

I'll break down my system to make sure we are both thinking in the same way. Here it is when I do it manually:

1. At 5pm EST when the market starts a new trading day. I look at the previous days HIGH and LOW.

2. I place a Buy Stop at the High with a T/P of 10 pips.

3. I place a Sell Stop at the Low with a T/P of 10 pips.

4. I do not set a Stop Loss.

5. The price will either reach the Previous High or Low, the trade will be placed and profit taken when it gains 10 pips.

Here's and example:

If the Previous high was 207.55 and the previous low was 205.52, I would place the Buy Stop at 207.55 with the T/P @ 207.65. I would place the Sell Stop at 205.52 with the T/P @ 205.42. If the price reaches 205.52 first, then it should make that trade and cancel the 207.55 pending order. It should close out the 205.52 short @ 205.42 for 10 pips profit sometime during that 24 hour trading day. It should not make any other trades that day and the system should reset at 5pm EST again for that trading days High and Low.... and so on and so on.

Hope this makes things clear as mud!

 
AirforceMook:
Fixing, gimme a few!

10-4, appreciate the work!

 

go to next post... wish we could delete old ones.

 

OK, new version.

First off, it wasn't creating $100 orders because the lots were set to 0.1 instead of 1. This is a setting you must set yourself. To make it easier, I now have it default to 1 LOT.

I've changed the order code to ensure pending orders are deleted properly. For some reason, however, I'm receiving 4108 "Pending order cannot be closed." I have absolutely no idea why. Everything is being passed correctly as far as I can tell, and I'm guessing that it's a tester problem?

The best thing, I think, is simply to wait until sunday and start testing on a demo account.

Files:
 

how do you deal with weekends?

you take Friday only or with Thursday together? or skip Monday? or...

fireslayer26:
Now I'm getting a bunch of Error sending Order 130, Order Send Error 130 messages. I'm still getting a bunch of Losses for -66.72 and when it does make profit its 162.03. I also see that they are all BUYS.... there are no SELLS. I dont believe its coded correctly for the parameters I mentioned. It should make about $100 per trade, long or short @ 1 Lot.

I'll break down my system to make sure we are both thinking in the same way. Here it is when I do it manually:

1. At 5pm EST when the market starts a new trading day. I look at the previous days HIGH and LOW.

2. I place a Buy Stop at the High with a T/P of 10 pips.

3. I place a Sell Stop at the Low with a T/P of 10 pips.

4. I do not set a Stop Loss.

5. The price will either reach the Previous High or Low, the trade will be placed and profit taken when it gains 10 pips.

Here's and example:

If the Previous high was 207.55 and the previous low was 205.52, I would place the Buy Stop at 207.55 with the T/P @ 207.65. I would place the Sell Stop at 205.52 with the T/P @ 205.42. If the price reaches 205.52 first, then it should make that trade and cancel the 207.55 pending order. It should close out the 205.52 short @ 205.42 for 10 pips profit sometime during that 24 hour trading day. It should not make any other trades that day and the system should reset at 5pm EST again for that trading days High and Low.... and so on and so on.

Hope this makes things clear as mud!
 

Hey Airforce,

That one's looking alot better! But its still making numerous trades a day, instead of just the one.

Int10tion - I ususally trade this system Monday thru Thursday at 5pm.

 

As far as I can tell, this is a tester issue.

I created a new, very simple EA that would create a buystop or sellstop and then try to close it on the next tick. Every tick it fails.

Again, "4108" error. "pending order # cannot be closed"

 

Ok, will just have to wait and see how it performs during real trading hours. Even though, looking at the results from the strategy tester it turned some very nice profits.

Are there any more accurate testers out there?

And would it be possible to add the option for a trailing stop? Also, is it possible to make it time adjustable? For when it resets, if you wanted to change it from 5pm.

Thanks!

 

This one has trailing stop.

When enabled the takeprofits aren't initiated with orders.

use_trailing enable the trailing stop

trailing_stop amount in pips

-----

I'm not sure why the timezone is necessary? My MT4 broker is FXDD, who opens at 5PM sunday when NY does. This creates the newest day bar at exactly that time. Unless you're trying to sync to london time or something, I don't see the point? Maybe I'm just missing something.

Files:
 

That looks great Airforce! Can't wait to start testing it live!

One last question, as I was tweaking the settings, it seemed that 10 is the lowest T/P it will go correct? Can that be changed so it can go lower to any number? I want to try going 5 pips and doubling my Lots.

Thanks for all the help!!!

Reason: