EURUSD EA won't make any trades. - page 2

 
LukeB:
Change:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, Ask-StopLoss*Point, Ask-StopLoss*Point); //Opening Buy
to:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0); //Opening Buy
if (openbuy > 0 ) { // Succeeded, got back a ticket number
if ( !(OrderModify(openBuy, OrderOpen(), Slippage, Ask+StopLoss*Point, Ask-StopLoss*Point, 0, CLR_NONE)) ) {
// Process orderModify Errors(use GetLastError())
}
} else {
// Process OrderSend errors, no ticket was received back (use GetLastError())
}

This works with all brokers that I know of - While it used to be limited to ECN brokers, there is a growing number of all types who require you to establish an order with no stop loss or take profit and then add the TP and SL to the already existing order (and make sure the values added and subtracted from Ask are large enough to not run afoul of 'stoplevel').


LukeB, After Talking to MBTrading, they said I cannot have the StopLoss or TakeProfit in the first Order line of OP_Buy or OP_Sell. It WILL NOT execute Orders. I

did a live test with an EA with No stops or Take Profit in the first line of Order code. It made or executed a real order fine even on a 1M chart. I am sending my

most recent update on an EA that tests or performs very well on a 5M chart. I took out the SL and TP and down below added a check for Trailing stop code. I havn't

checked it out yet but plan to do so tonight on the Demo. Is this the best way to get the stop loss and take profit out of the first Order line or is there a better way?

Also notice one other problem that may be related to more than this EA. It doesn't seem to make any Long trades just Short. Tested some other EA'S and they didn't

seem to want to go long either.Think I will grab a fresh one off of the Code base to see if it will go long.

Thanks,

JimTrader1


	          
 
LukeB:
Change:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, Ask-StopLoss*Point, Ask-StopLoss*Point); //Opening Buy
to:
int openbuy=OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0); //Opening Buy
if (openbuy > 0 ) { // Succeeded, got back a ticket number
if ( !(OrderModify(openBuy, OrderOpen(), Slippage, Ask+StopLoss*Point, Ask-StopLoss*Point, 0, CLR_NONE)) ) {
// Process orderModify Errors(use GetLastError())
}
} else {
// Process OrderSend errors, no ticket was received back (use GetLastError())
}

This works with all brokers that I know of - While it used to be limited to ECN brokers, there is a growing number of all types who require you to establish an order with no stop loss or take profit and then add the TP and SL to the already existing order (and make sure the values added and subtracted from Ask are large enough to not run afoul of 'stoplevel').


Thanks LukeB. I am still having trouble with the EURUSD making trades in the live acct. It's getting a little weird if not frustrating.Not much sense in me spending more time building these EURUSD EA'S if they won't fire off the trades. Some are working in the Demo acct. but not in the real acct. I havn't had a chance yet but will definitely try yours out.

JimTrader1