"A crucial mistake that you do is using MODE_CLOSE"
I had already realized this if you refer to the top of the original post. My question was how to correct the problem, please be aware that I know()0 about programming, see!
Also I have tried the same indicator with various trios, but cant capitalize till the aforementioned issue is resolved.
When there are strong jumps in one of the currencies (like just after newsreports), then 2 of those pairs move very fast. That often means there is a chance on a hedge. However when you would automatically send orders, you will see that mostly only one of the orders is accepted for the price you wish, and the other is not accpeted. And the one that was accepted will be the losing one.
for (i=0;i<NoOfContracts;i++)
{
//WriteLn("Sending order "+OrderType2Str(Ops[i])+" "+DoubleToStr(Lots[i], 2)+" "+Contracts[i]);
Gle=ERR_TRADE_CONTEXT_BUSY;
while (Gle==ERR_TRADE_CONTEXT_BUSY||Gle==ERR_REQUOTE)
{
if (Gle==ERR_REQUOTE)
{
RefreshRates();
if (Ops[i]==OP_BUY)
Prices[i]=MarketInfo(Contracts[i],MODE_ASK);
else
Prices[i]=MarketInfo(Contracts[i],MODE_BID);
}
OrderSend(Contracts[i],Ops[i],Lots[i],Prices[i],AdmittedSlippage,0,0,comm,AccountMagic, 0,CLR_NONE);
Gle=GetLastError();
if (Gle==ERR_NO_CONNECTION)
{
if (i!=0)
Gle=ERR_TRADE_CONTEXT_BUSY;
else
break;
}
}
if (Gle==ERR_NO_CONNECTION)
break;
if (Gle!=0)
error=True;
}
I have a similar problem closing them too...
Anyway, the broker plays even a more important role than the strategy itself.
I have looked at the Triangular Arbitrage Indicator. That is interesing. But can you give me a pointer as to how one would be able to use this indicator to trade? You have three pairs involved. One of the pair is probably lying (lagging / slightly off) but you don't know which one is right and wrong.
Video about Forex Arbitrage:
https://s3.amazonaws.com/learnforex/forex-arbitrage.mp4
Arbitrage system:
usage video:
I have looked at the Triangular Arbitrage Indicator. That is interesing. But can you give me a pointer as to how one would be able to use this indicator to trade? You have three pairs involved. One of the pair is probably lying (lagging / slightly off) but you don't know which one is right and wrong.
Yes, thats true. You trade all 3 pairs simultaneously. If you do the programming right, trade only when FPI > SumOfSpread+Commision the Triangular Arbitrage system works perfectly on demo accounts. However i never got the same results when trying it on a live account due to higher slippage, requotes, higher spread and higher commisions.
In theory a unbeatable system, which does not work well as an average trader

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am very new to MQL4 but have been wondering about the possibility of a trianngular arbitrage EA for a while.
Here is the code ,courtesy of Codersguru, for a fractional product oscillator.
I notice this uses MODE_CLOSE for each pair, could this be applied to live tick data?
As I am assuming close data will not be reliable for triangular arbitrage,could anyone confirm this?
It would be great if somebody could make this open the hedge (i.e buy EURUSD, buy USDJPY, sell EURJPY simultaneously) when 1.0003 <FPI<0.9997,
and swap close or open when the opposite extreme is reached.
Granted the profits will be small and the above parameters may not be wide enough, but I would love to forward test this system anyway,
as it may be forexs' only "FREE LUNCH"