Comments that do not relate to the "The EA I wrote three months ago can not pass the strategy testing now, but it used working well two or three months ago!!", have been moved into this topic.
- The EA I wrote three months ago can not pass the strategy testing now, but it used working well two or three months ago!!
- EA
- Forex Market Update
//+------------------------------------------------------------------+ //| New.mq5 | //| Copyright 2017, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2017, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #include <trade/trade.mqh> double Bid; string sym="اخابر"; double vol=1000; //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ int OnInit() { gobuy(); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { } void OnTick() { } void gobuy() { Bid= SymbolInfoDouble(sym,SYMBOL_BID); MqlTradeRequest request; MqlTradeResult result; MqlTradeCheckResult check; ZeroMemory(request); ZeroMemory(result); ZeroMemory(check); request.action=TRADE_ACTION_PENDING; request.symbol=sym; request.volume=vol; request.price=Bid+1; //request.stoplimit=1800.000; request.sl=0; request.tp=0; request.type=ORDER_TYPE_BUY_STOP_LIMIT; request.type_filling=ORDER_FILLING_RETURN; request.type_time=0; request.expiration=0; request.magic=0; request.comment=""; if(!OrderSend(request,result)) { Print(__FUNCTION__,": error ",GetLastError(),", retcode = ",result.retcode); } }
Hi please someone help me i receive 4756 error and 10015 retcode
I use real account
Files:
error.jpg
348 kb
With BUY_STOP_LIMIT order you need to specify a stoplimit price. Also you stop price must be greater or equal to ask price.
Alain Verleyen:
With BUY_STOP_LIMIT order you need to specify a stoplimit price. Also you stop price must be greater or equal to ask price.
With BUY_STOP_LIMIT order you need to specify a stoplimit price. Also you stop price must be greater or equal to ask price.
//+------------------------------------------------------------------+ //| New.mq5 | //| Copyright 2017, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2017, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #include <trade/trade.mqh> double Bid; string sym="اخابر"; double vol=1000; //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ int OnInit() { gobuy(); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { } void OnTick() { } void gobuy() { Bid= SymbolInfoDouble(sym,SYMBOL_BID); MqlTradeRequest request; MqlTradeResult result; MqlTradeCheckResult check; ZeroMemory(request); ZeroMemory(result); ZeroMemory(check); request.action=TRADE_ACTION_PENDING; request.symbol=sym; request.volume=vol; request.price=Bid+1; request.stoplimit=1903; request.sl=0; request.tp=0; request.type=ORDER_TYPE_BUY_STOP_LIMIT; request.type_filling=ORDER_FILLING_RETURN; request.type_time=0; request.expiration=0; request.magic=0; request.comment=""; if(!OrderSend(request,result)) { Print(__FUNCTION__,": error ",GetLastError(),", retcode = ",result.retcode); } }I Still receive 4756 error and 10015 retcode
amirsis:
I Still receive 4756 error and 10015 retcode
I Still receive 4756 error and 10015 retcode
Did you read my previous message ?
Forum on trading, automated trading systems and testing trading strategies
Alain Verleyen, 2017.06.07 22:12
With BUY_STOP_LIMIT order you need to specify a stoplimit price. Also you stop price must be greater or equal to ask price.request.price=Bid+1;
This price must be greater or equal to Ask price. Is it ?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register