MADTrader

Rene's trading Expert Advisors
Post Reply
fxstrategie
Trader
Posts: 31
Joined: Wed Jun 01, 2016 12:30 pm
Location: Germany

MADTrader

Post by fxstrategie »

First of all - a big THANK YOU for the great Development and the shared Ideas! :good:

After 2 weeks of sucessful testing i decide to go live yesterday with wavegarricks settings. But - this first night was a really nightmare for this account. Against the demo - the live account shows strange behaviors...

Some (a lot !!! of orders) are opened at a stack - dozens of orders with same time and entry point... so the mad tader kills arund 400 EUR (30% Account loss) within one night..
Error in fron of this are: "1 01:23:09.534 'xxx27450': order buy 0.01 GBPJPY opening at market sl: 0.000 tp: 0.000 failed [Trade context is busy]" Any Idea how to avoid this? All i've found about this is https://www.mql5.com/en/articles/1412 I dont found any settings for min trade distance or min time between trades...
Unbenannt.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

MADTrader

Post by Wavegarrick »

Hi Fxstrat,

You have will have to send the mad trader set file you use for us to have a look at..this does not make sense.

Leon
fxstrategie
Trader
Posts: 31
Joined: Wed Jun 01, 2016 12:30 pm
Location: Germany

MADTrader

Post by fxstrategie »

Wavegarrick » Wed Jul 13, 2016 12:49 pm wrote:Hi Fxstrat,

You have will have to send the mad trader set file you use for us to have a look at..this does not make sense.

Leon
thank you in advance for your help :) using your hgi H1 setfile...
You do not have the required permissions to view the files attached to this post.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

MADTrader

Post by Wavegarrick »

Fxstrat...I am dumbfounded my friend. Everything looks fine on your set file...I have never encountered anything like this with mad trader.

Hopefully someone can help
fxstrategie
Trader
Posts: 31
Joined: Wed Jun 01, 2016 12:30 pm
Location: Germany

MADTrader

Post by fxstrategie »

it seems that there is no check before trading, if trade is possible. (see MQL5 link, describes this) So it will try again and again and builds up a stack... if it is possile to trade a few seconds further, then all trades opened at the same time...
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

MADTrader

Post by renexxxx »

fxstrategie » Wed Jul 13, 2016 10:52 pm wrote:it seems that there is no check before trading, if trade is possible. (see MQL5 link, describes this) So it will try again and again and builds up a stack... if it is possile to trade a few seconds further, then all trades opened at the same time...
I have never seen this behaviour before. From what I gather, OrderSendReliable sends the trade, but the trade server responds with a "Trade Context Busy". The code assumes that the initial trade is rejected, and therefore OrderSendReliable sends another one a moment later. What seems to be happening -- which is new to me -- is that the initial trade is not rejected, but kept in "the waiting room" at the trade server and is processed as and when the trade server feels like it. This is totally unacceptable behaviour, and if true would open up a whole new can of worms. You can call IsTradeAllowed() prior to the OrderSend() but it could be that at the time IsTradeAllowed() was called, everything was fine, but at the time of the OrderSend() there is trouble.

Just out of interest, what br0ker are you using?
fxstrategie
Trader
Posts: 31
Joined: Wed Jun 01, 2016 12:30 pm
Location: Germany

MADTrader

Post by fxstrategie »

renexxxx » Thu Jul 14, 2016 2:29 am wrote:
fxstrategie » Wed Jul 13, 2016 10:52 pm wrote:it seems that there is no check before trading, if trade is possible. (see MQL5 link, describes this) So it will try again and again and builds up a stack... if it is possile to trade a few seconds further, then all trades opened at the same time...
I have never seen this behaviour before. From what I gather, OrderSendReliable sends the trade, but the trade server responds with a "Trade Context Busy". The code assumes that the initial trade is rejected, and therefore OrderSendReliable sends another one a moment later. What seems to be happening -- which is new to me -- is that the initial trade is not rejected, but kept in "the waiting room" at the trade server and is processed as and when the trade server feels like it. This is totally unacceptable behaviour, and if true would open up a whole new can of worms. You can call IsTradeAllowed() prior to the OrderSend() but it could be that at the time IsTradeAllowed() was called, everything was fine, but at the time of the OrderSend() there is trouble.

Just out of interest, what br0ker are you using?
Thank you for you analysis. :) I've done a short chat with technical service about this - and yes it seems thats in a wait state till liquidity providers give back a result :( Broker is FXCC - XL Account... till now the've done a very good job :cry:
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

MADTrader

Post by renexxxx »

fxstrategie » Thu Jul 14, 2016 8:20 pm wrote:
Thank you for you analysis. :) I've done a short chat with technical service about this - and yes it seems thats in a wait state till liquidity providers give back a result :( Broker is FXCC - XL Account... till now the've done a very good job :cry:
I've attached a special version of OrderReliable.mqh, that basically replaces every OrderSend() with the following code:

Code: Select all

         int maxTries = 100;
         while( !IsTradeAllowed() && (maxTries > 0) ) {
            Sleep(10);
            maxTries--;
         }
         if (maxTries > 0) {
            ticket = OrderSend(symbol, cmd, volume, price, slippage, stoploss,
                               takeprofit, comment, magic, expiration, arrow_color);
            err = GetLastError();
         }
         else {
            err = ERR_TRADE_CONTEXT_BUSY;
         }
Let me know if this solves your problem. I guess this involves sending a few live trades at a time when there is no liquidity available at the live server. You may not be keen to do this -- which I fully understand -- but it would be a good test though.

R.
You do not have the required permissions to view the files attached to this post.
fxstrategie
Trader
Posts: 31
Joined: Wed Jun 01, 2016 12:30 pm
Location: Germany

MADTrader

Post by fxstrategie »

this looks great - ill do so! will test next week - because we're on tour actually... better to do this under control in front of my terminal... meanwhile i've found out that the same behavior occurs on Broker XM and Roboforex! A friend and my father too lost each around 300 Eur with the same Errors... damn... switch of the accounts now, till successful testings...

But maybe - your change will fix that if there is an trade request in front of that :)
Unfortunatly i've to test this behavior with real money ;)

Thank you for this great and fast support! :)
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

MADTrader

Post by Wavegarrick »

" Every cloud has a silver lining " Fxstrat I feel your pain buddy and I am confident Rene has come to your rescue...Thanks Rene :good:
Post Reply

Return to “Auto-trading EA's and EA monitors”