Hi Guys Can Anyone Help Me Fix My EA!

Hi Guys! I’m creating an EA that will help me create pending Orders at a Specific Time. My current Trading (Demo) Strategy focuses on the opening bar for a specific time.

Please note this EA is just a helper for my manual trades. I designed this as I am already off to work when the bar I am targeting is about to open. Currently, Its encountering an error of invalid parameters and I am having a hard time isolating what is wrong can anyone help me.

Thanks,

ScheduleTraderB.zip (4.08 KB)

Hi,

Just had a quick look…most often if you have invalid parameters, it will be due to an expiration issue.

Offhand, i would say that you are trying to run it on the M5 timeframe. There is an expiration in the coding that take the TF in seconds * 0.75…so this would give you 225 seconds. In MT4, for some reason there is a minimum expiration of around 600 or so seconds, so even M15 is a borderline case.

Thanks Kenny,

I was just using the 5M for debugging purposes to check if the code will actually create a pending order in the demo account. My target time frame is actually 1 hour - 1 day.

I will try again when the market is open.

Then I need to add Breakeven and Partial close code.:o

Then I need to add Breakeven and Partial close code.

Read more: 301 Moved Permanently

Don’t even bother complicating your life with a partial close. Some brokers don’t support it and the brokers that do all have different ways of dealing with partial closes. They change comment, and sometime they even make a complete new order, deleting your magicnumber in the process. If you eventually get it to work with your broker, there is no guarantee it will work with your next broker.

A far simpler solution is to make 2 trades, each one at half your target trade size and then close one. Does the same thing as a partial close but about 100 times easier to do…

In terms of Breakeven, there are many trailing stop/MBE EA’s out there…pick one, feed it your magicnumber and you’re done…