dudest » Sat Jun 07, 2014 8:51 am wrote:
Goodstuff PT!
I still haven't managed to figure out why sometimes some pairs do not open trades
Unfortunately I've been a bit caught up, haven't had much time to decode a few things I'd like
Trailing is always a great way to lock-in profit! Do you mind sharing your ATR trail settings?
Thanks for posting your progress!
Cheers
PS: I have uploaded the EA also to post #1 of this thread to avoid confusion in looking for it
.
I cannot see why the ea occasionally fails to fire a trade either. I suppose, check that your history tab is empty of trades with the same magic number.
I noticed a bloop - just the kind of thingy I do.
Lines 362 & 363 are
// Check Trades
for (int cc =
OrdersHistoryTotal() - 1; cc >= 0; cc--)
which means the bot is checking history twice.
// Check Trades
for (int cc =
OrdersTotal() - 1; cc >= 0; cc--)
is what you need.
int CheckTradesOnStart( int op_type ) is only called from init(). Once a trade is sent, then it only returns -1 again after a restart - and this is the only time that long_ticket_number and its partner are set to -1. I suppose a dim possibility is that the program was not restarted since the previous trade, so long_ticket_number etc are not reset to -1, stopping a trade.
FWIW, this ea is in danger of sending multiple small trades if the user is with a less-than-reputable broker. What happens is this: the ea sends the trade and it shows up instantly in your trading window; this is a mirage as the trade has not yet returned from the criminal's server; come the next tick, the ea sees it has not traded yet and that the conditions are there for a trade, and so trades. This process can be repeated many times and you end up with umpteen trades and a margin call.
You need Matt Kennel's OrderReliable code to overcome this - you will find it in all of my ea's. Sing out if it confuses you and I will add it - I would do so automatically were I to use this ea live anyway, so it is not much bother for me.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed
Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.