The code works in strategy tester, but when using in real trade, I get Error 4756 (Trade request sending failed) and retcode 10006 (Request rejected).
Anyone has any idea why this could not work? the SYMBOL_FILLING_MODE is 3 and the SYMBOL_EXPIRATION_MODE is 2. I can buy and sell normally if I use the "new order" thing from Metatrader. Please, any idea would be greatly appreciated. I ran out of ideas I could try to make it work.
this will generate in log the following lines:
11:36:36.695 Trades '1000015025': exchange buy 1.00 WDON15 at market
11:36:36.763 Trades '1000015025': rejected exchange buy 1.00 WDON15 at market
if I use the "new order" tool from Metatrader (that works), it generates these lines:
11:09:31.155 Trades '1000015025': exchange buy 1.00 WDON15 at market 11:09:31.207 Trades '1000015025': exchange buy 1.00 WDON15 at market placed for execution in 51 ms (Order received. Sending to OMS.) 11:09:32.459 Trades '1000015025': deal #4204115 buy 1.00 WDON15 at 3129.000 done (based on order #4913284)
Thanks
Hi bro,
I have the same problem but in different broker!
I don't know where can I find the comment if my broker uses the same trick?
I am having the same issue with my code. Its on the strategy tester but when I add it to any chart/pair it just sits there. It doesn't make trades
at all but in my journal it says that it loaded successfully. Any help is appreciated!
// Import the system components / Import der System Komponenten#import "ROBOTRADINGSYSTEM-Library-20190827-KorenRolle.ex5"bool GetNewChartCandle();
int GetNumberOfPositionsThisSymbol();
double GetCurrencyPairProfit();
void OpenStopLossBuyTrade(int StopLossPoints);
void OpenStopLossSellTrade(int StopLossPoints);
double SetEquityStop();
int SetMaxPositionsThisSymbol();
double SetPositionSize();
void CloseAllPositions();
void CheckForTick(string Signal, double TradingRisk, double InitAccountSize, int StopLossPoints);
#import
inputdouble TradingRisk=2.8;//Trading Risk 1=low/niedrig 10=high/hochinputint StopLossPoints=100000; //STOP LOSS POINTSinputint NumberOfBacktests=100; // FOR MASS TESTINGdouble InitAccountSize;
// Import entry logic / Import der Eingangslogik// #include "CheckEntry_SMA1000.mq5";// #include "CheckEntry_WPR.mq5"; // -// #include "CheckEntry_Stochastic.mq5"; // + 2.5// #include "CheckEntry_SAR.mq5"; // -// #include "CheckEntry_CCI.mq5";// -// #include "CheckEntry_IAD.mq5"; // - cadchf// #include "CheckEntry_AdvancedMA.mq5" // - cadchf gut// #include "CheckEntry_ReverseBWMFI.mq5";// + 2.5// #include "CheckEntry_Crossover.mq5"; // + - cadchf#include "CheckEntry_BollingerBands.mq5"; // 2.7 okay!// #include "CheckEntry_MacD.mq5";// #include "CheckEntry_Random.mq5";// #include "CheckEntry_Envelopes.mq5";// #include "CheckEntry_ReverseMacD.mq5";// #include "CheckEntry_SMA.mq5";// + 2.5// #include "CheckEntry_IVIDYA.mq5";// #include "CheckEntry_Chaikin.mq5";// #include "CheckEntry_RVI.mq5";// #include "CheckEntry_RSI.mq5";// #include "CheckEntry_ReverseMacD.mq5";voidOnInit()
{
InitAccountSize= AccountInfoDouble(ACCOUNT_EQUITY);
}
voidOnTick()
{
// check for an entry / Checke Einstiegstring Signal=CheckEntry();
// call trade management / Rufe Trade Mangement auf
CheckForTick(Signal,TradingRisk, InitAccountSize, StopLossPoints);
}
voidOnChartEvent(constint id, // Event ID constlong& lparam, // Event parameter vom Typ longconstdouble& dparam, // Event parameter vom Typ doubleconststring& sparam // Event parameter vom Typ string
)
{
// if mouse was clickedif(id==CHARTEVENT_CLICK)
// if click was in upper left cornerif (lparam <20 && dparam<20)
{
Print ("Left upper chart corner was clicked");
int closeAllPositions=MessageBox("WOULD YOU LIKE TO CLOSE ALL POSITIONS??? ","CLOSE POSITIONS?",MB_YESNO);
if (closeAllPositions==6) CloseAllPositions();
}
}
How I can I authorized my Expert ?
The code works in strategy tester, but when using in real trade, I get Error 4756 (Trade request sending failed) and retcode 10006 (Request rejected).
Anyone has any idea why this could not work? the SYMBOL_FILLING_MODE is 3 and the SYMBOL_EXPIRATION_MODE is 2. I can buy and sell normally if I use the "new order" thing from Metatrader. Please, any idea would be greatly appreciated. I ran out of ideas I could try to make it work.
this will generate in log the following lines:
11:36:36.695 Trades '1000015025': exchange buy 1.00 WDON15 at market
11:36:36.763 Trades '1000015025': rejected exchange buy 1.00 WDON15 at market
if I use the "new order" tool from Metatrader (that works), it generates these lines:
11:09:31.155 Trades '1000015025': exchange buy 1.00 WDON15 at market
11:09:31.207 Trades '1000015025': exchange buy 1.00 WDON15 at market placed for execution in 51 ms (Order received. Sending to OMS.)
11:09:32.459 Trades '1000015025': deal #4204115 buy 1.00 WDON15 at 3129.000 done (based on order #4913284)
Thanks
Hi bro,
I have the same problem but in different broker!
I don't know where can I find the comment if my broker uses the same trick?
Best regards.
Request.deviation = 100;Hello,
I am having the same issue with my code. Its on the strategy tester but when I add it to any chart/pair it just sits there. It doesn't make trades at all but in my journal it says that it loaded successfully. Any help is appreciated!