EA entering only sporadically on Alpari UK - page 2

 

The Price is "Ask" on buy or "Bid" on short:

EnterLong(){
Print ("Long Entry Attempted");
ticket = OrderSend(Symbol(), OP_BUY, 0.1, Ask, 30, 0, 0, comment, magicnumber, 0, Green);
}

So it's getting the Ask directly from the server. I find it odd that I'd have to normalize it again. Alpari UK is a 5 digit broker, so i set my slip to 30 (3 pips), and no TP or SL is specified for the reasons you mentioned. This is handled after the order is placed.

Before this entry subroutine is triggered, a rather lengthy monte carlo calculation is performed that takes typically between 40-60 seconds, but like i said, the same EA is running on CMS-FX and orders are entered just fine without having to do a RefreshRates. Maybe there is some fundamental difference in how these two brokers refresh their variables, though. I think I'll call RefreshRates prior to the trade entry just to be safe.

 
If it takes that long to calculate, then you REALLY need to do the RefreshRates(). The curernt Ask and Bid are only valid until next Tick information + slippage afaik and that happens in general much faster than 40-60 seconds.
 

Yeah. That seemed to be the case. Using RefreshRates() at the beginning of the trading decision subroutine resolved the problem I was having. The weird thing is that I didn't see this with CMS, and it sounds like I should have. Anyhow, that problem is fixed, but now I'm facing another issue:

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

 
Not weird at all, maybe CMS uses the same bridge as any "No requote broker"
Reason: