Problem with EA on Digits+1 broker.
Hello,
I had the same problem before, 0.1 Lots is for normal digits (4 in EUR/USD)
To trade 0.1 Lots with 5 digits (EUR/USD), you must use 1.0 Lots instead.
And for Sl and TP, it is the same thing, you must do :
(what you want) x 10
for example, if you want a StopLoss of 10 in normal digits :
10 x 10 = 100
Have a nice day.
Nobody can help? Stringo? Rosh maybe?
Change source such:
if(ordertotal<1 ) { if(long.condition) { SL=Ask-StopLoss*x*Point; TP=Ask+TakeProfit*x*Point; ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SL,TP,0,magic,0,Blue); if(ticket<=0) { Alert("Error on opening new BUY order, error=",GetLastError()); Print("Point="+DoubleToString(Point,5)," StopLevel=",MarketInfo(Symbol(),MODE_STOPLEVEL)); } } if(short.condition) { SL=Bid+StopLoss*x*Point; TP=Bid-TakeProfit*x*Point; ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SL,TP,0,magic,0,Red); if(ticket<=0) { Alert("Error on opening new SELL order, error=",GetLastError()); Print("Point="+DoubleToString(Point,5)," StopLevel=",MarketInfo(Symbol(),MODE_STOPLEVEL)); } } }
Hello,
I had the same problem before, 0.1 Lots is for normal digits (4 in EUR/USD)
To trade 0.1 Lots with 5 digits (EUR/USD), you must use 1.0 Lots instead.
And for Sl and TP, it is the same thing, you must do :
(what you want) x 10
for example, if you want a StopLoss of 10 in normal digits :
10 x 10 = 100
Have a nice day.
Hello Nazoreen,
Thanks for your reply, but as far I concern thats what the
int dig=MarketInfo("GBPUSD",MODE_DIGITS); int x; if(dig==4) x=1; if(dig==5) x=10;use for.
@ Rosh, sorry I wrote the wrong code,
it's not
if(ticket<=0) else Alert("Error on opening new order ",GetLastError());but
if(ticket<=0) Alert("Error on opening new order ",GetLastError());
the real code is
if(ticket>0) blablabla; else Alert("Error on opening new order ",GetLastError());
I'm forgot to delete the "else" word.
Try chopping off 5th digit from Ask/Bid when calculating SL/TP:
SL=NormalizeDouble(Bid,Digits-1)+StopLoss*x*Point;
Any other idea maybe?
What execution use your broker - market or instant? In matter market execution you can not open order with non-zero StopLoss and TakeProfit. First time you have open order and then in second time you may to modify opened order.
Hello,
May be the subject will lead to some confuse, Sorry, but I can't find any other way to say it.
Digits+1 broker is those who use 5 digits decimal for GBPUSD, EURUSD, etc (the common broker usually use 4 digits for GBPUSD).
My code is :
I test it in 5 minutes EURUSD and I get numerous Error 130. The strange thing is it's working flawlessly on the backtester but not on the forward demo test. What should I do?
The broker is forexte.com
Thank you