Topic: EA for MT5 dont work in 'Hedging Mode'

Hallo,

it seems that generated EAs for MT5 dont work on Accounts thats use the new hedging mode.

they dont open orders, see expert log:

QO    0    19:21:09.702    USDJPY_H1_V1 (USDJPY,H1)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
GO    0    19:21:09.812    USDJPY_H1_V1 (USDJPY,H1)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
NN    0    19:21:09.932    USDJPY_H1_V1 (USDJPY,H1)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
LN    0    19:21:10.042    USDJPY_H1_V1 (USDJPY,H1)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
QL    0    19:34:10.405    USDJPY_M15_Keltner (USDJPY,M15)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
NM    0    19:34:10.534    USDJPY_M15_Keltner (USDJPY,M15)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
IM    0    19:34:10.656    USDJPY_M15_Keltner (USDJPY,M15)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
RN    0    19:34:10.772    USDJPY_M15_Keltner (USDJPY,M15)    Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request

On normal mt5 demo accounts without hedging, they run without errors.

Problem is, that my alpari mt5 account has hedging enabled and i cant change this in the configuration.
Is there a solution to solve this problem?

Thank you and best regards.

Re: EA for MT5 dont work in 'Hedging Mode'

please attach the strategy and a screenshot of your FSBPro

I am not so sure that the hedging thing is the problem.

Re: EA for MT5 dont work in 'Hedging Mode'

Hallo,

after more testing, it seems that the EA dont run with demo accounts from metaquotes on mt5.
I have created 2 accounts with hedging and without, same errors like in my first post.

With my mt5 alpari real account and mt5 alpari demo account the ea is partially working, sometimes they place orders without sl and tp. Normaly all orders have set sl and tp. This orders where never closed so after few days the ea ends in a stop out.

On MT4 i dont have this Problems.

Dont know if its just my system that causes this errors.

regards

http://s33.postimg.org/xje4apkfv/FSB_USDJPY_H1_20160531.jpg

Post's attachments

USDJPY_H1_V1.xml 11.83 kb, 4 downloads since 2016-05-31 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Hi,


I have the same with Activtrade demo
Have you find a solution ?

Best regards.

Re: EA for MT5 dont work in 'Hedging Mode'

cybermanu wrote:

Hi,


I have the same with Activtrade demo
Have you find a solution ?

Best regards.

Hallo,

unfortunately i dont find any Solution, so i give up:(
To bad, because i think mt5 is the better platform to backtest exported ea's from fsb.

best regards

Re: EA for MT5 dont work in 'Hedging Mode'

Submit the journal from MT5, I use MT5 a lot and most problems that I find are to do with my errors....

Please let us have a look at MT5 journal and we will locate a solution.

MT5 has recently been revised, there may be a correction needed in the code.


***********************************************************************

There are not many advantages to MT5 over MT4

There are some programming advantages, the software allows some different techniques (if you are a programmer)
The data may be easier to obtain for FSBPro.
You can use the cloud for backtesting which will cost a little bit of money.

Other than those..... not much to warrant using MT5

Metaquotes seems to be giving the most attention to MT4 and it is slowly starting to be similar to MT5, it may be prudent to stay with MT4.  So far there is still quite a bit of resistance to MT5.

Re: EA for MT5 dont work in 'Hedging Mode'

Hi,

Here the journal log of the strategy tester :

2016.06.20 18:44:53.619    2016.01.04 10:07:59   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.619    2016.01.04 10:07:59   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.619    2016.01.04 10:07:59   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.567    2016.01.04 10:07:42   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.567    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.567    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:53.567    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 18:44:28.146    2016.01.01 00:00:00   The expert uses 350 bars.
2016.06.20 18:44:28.143    2016.01.01 00:00:00   Loading data: EURUSD,M30, Minumum bars: 152...
2016.06.20 18:44:28.143    2016.01.01 00:00:00   best1 loaded.
2016.06.20 18:44:28.087      Order_Comment=
2016.06.20 18:44:28.087      Write_Log_File=false
2016.06.20 18:44:28.087      Bar_Close_Advance=15
2016.06.20 18:44:28.087      Protection_Max_StopLoss=0
2016.06.20 18:44:28.087      Protection_Min_Account=0
2016.06.20 18:44:28.087      ExpertSettings__=------------
2016.06.20 18:44:28.087      Slot5IndParam1=4.65
2016.06.20 18:44:28.087      Slot5IndParam0=61
2016.06.20 18:44:28.087      IndicatorName5=Bollinger Bands
2016.06.20 18:44:28.087      Slot4IndParam3=20
2016.06.20 18:44:28.087      Slot4IndParam2=3
2016.06.20 18:44:28.087      Slot4IndParam1=3
2016.06.20 18:44:28.087      Slot4IndParam0=5
2016.06.20 18:44:28.087      IndicatorName4=Stochastics
2016.06.20 18:44:28.087      Slot2IndParam1=146
2016.06.20 18:44:28.087      Slot2IndParam0=52
2016.06.20 18:44:28.087      IndicatorName2=Oscillator of ATR
2016.06.20 18:44:28.087      Slot1IndParam1=30
2016.06.20 18:44:28.087      Slot1IndParam0=40
2016.06.20 18:44:28.087      IndicatorName1=Oscillator of CCI
2016.06.20 18:44:28.087      Slot0IndParam1=71
2016.06.20 18:44:28.087      Slot0IndParam0=30
2016.06.20 18:44:28.087      IndicatorName0=Moving Average
2016.06.20 18:44:28.087      Martingale_Multiplier=0.00
2016.06.20 18:44:28.087      Break_Even=0
2016.06.20 18:44:28.087      Take_Profit=0
2016.06.20 18:44:28.087      Stop_Loss=0
2016.06.20 18:44:28.087      Reducing_Amount=1.00
2016.06.20 18:44:28.087      Adding_Amount=0.01
2016.06.20 18:44:28.087      Maximum_Amount=4.00
2016.06.20 18:44:28.087      Entry_Amount=1.00
2016.06.20 18:44:28.087      StrategyProperties__=------------
2016.06.20 18:44:28.087    EURUSD,M30: testing of Experts\best1.ex5 from 2016.01.01 00:00 to 2016.06.19 00:00 started with inputs:
2016.06.20 18:44:28.086    EURUSD,M30 (MetaQuotes-Demo): every tick generating
2016.06.20 18:44:28.084    EURUSD,M30: history begins from 2015.01.02 09:00
2016.06.20 18:44:28.083    EURUSD,M30: history cache allocated for 18342 bars and contains 12389 bars from 2015.01.02 09:00 to 2015.12.31 20:00
2016.06.20 18:44:27.923    EURUSD: history synchronized from 2015.01.02 to 2016.06.17
2016.06.20 18:44:27.923    EURUSD: load 27 bytes of history data to synchronize
2016.06.20 18:44:27.921    EURUSD: history synchronization started
2016.06.20 18:44:27.921    EURUSD: symbol synchronized, 3384 bytes of symbol info received
2016.06.20 18:44:27.921    EURUSD: symbol to be synchronized
2016.06.20 18:44:27.867    Intel Core i7-3770K  @ 3.50GHz, 16071 MB

I've a metaquote demo account.

Best regards

Post's attachments

best1.mq5 236.65 kb, 1 downloads since 2016-06-20 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Popov will have a look at that error...... I think there is a code that needs to be changed a bit.

Re: EA for MT5 dont work in 'Hedging Mode'

Can you give me a link to the platform that produces this error?
It must be a something special for that platform or account.

Re: EA for MT5 dont work in 'Hedging Mode'

Can you give me a link to the platform that produces this error?
It must be a something special for that platform or account.

Can you try with entry in Lots instead of %?

Re: EA for MT5 dont work in 'Hedging Mode'

I have change the % by static lot. It's the same error :


2016.06.20 21:02:12.858    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 21:02:12.858    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 21:02:12.858    2016.01.04 10:07:41   Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request
2016.06.20 21:01:46.520    2016.01.01 00:00:00   The expert uses 350 bars.
2016.06.20 21:01:46.517    2016.01.01 00:00:00   Loading data: EURUSD,M30, Minumum bars: 152...
2016.06.20 21:01:46.517    2016.01.01 00:00:00   best1_bis loaded.
2016.06.20 21:01:46.483      Order_Comment=
2016.06.20 21:01:46.483      Write_Log_File=false
2016.06.20 21:01:46.483      Bar_Close_Advance=15
2016.06.20 21:01:46.483      Protection_Max_StopLoss=0
2016.06.20 21:01:46.483      Protection_Min_Account=0
2016.06.20 21:01:46.483      ExpertSettings__=------------
2016.06.20 21:01:46.483      Slot5IndParam1=4.65
2016.06.20 21:01:46.483      Slot5IndParam0=61
2016.06.20 21:01:46.483      IndicatorName5=Bollinger Bands
2016.06.20 21:01:46.483      Slot4IndParam3=20
2016.06.20 21:01:46.483      Slot4IndParam2=3
2016.06.20 21:01:46.483      Slot4IndParam1=3
2016.06.20 21:01:46.483      Slot4IndParam0=5
2016.06.20 21:01:46.483      IndicatorName4=Stochastics
2016.06.20 21:01:46.483      Slot2IndParam1=146
2016.06.20 21:01:46.483      Slot2IndParam0=52
2016.06.20 21:01:46.483      IndicatorName2=Oscillator of ATR
2016.06.20 21:01:46.483      Slot1IndParam1=30
2016.06.20 21:01:46.483      Slot1IndParam0=40
2016.06.20 21:01:46.483      IndicatorName1=Oscillator of CCI
2016.06.20 21:01:46.483      Slot0IndParam1=71
2016.06.20 21:01:46.483      Slot0IndParam0=30
2016.06.20 21:01:46.483      IndicatorName0=Moving Average
2016.06.20 21:01:46.483      Martingale_Multiplier=0.00
2016.06.20 21:01:46.483      Break_Even=0
2016.06.20 21:01:46.483      Take_Profit=0
2016.06.20 21:01:46.483      Stop_Loss=0
2016.06.20 21:01:46.483      Reducing_Amount=1.00
2016.06.20 21:01:46.483      Adding_Amount=0.01
2016.06.20 21:01:46.483      Maximum_Amount=4.00
2016.06.20 21:01:46.483      Entry_Amount=1.00
2016.06.20 21:01:46.483      StrategyProperties__=------------
2016.06.20 21:01:46.483    EURUSD,M30: testing of Experts\best1_bis.ex5 from 2016.01.01 00:00 to 2016.06.19 00:00 started with inputs:
2016.06.20 21:01:46.483    EURUSD,M30 (MetaQuotes-Demo): every tick generating
2016.06.20 21:01:46.481    EURUSD,M30: history begins from 2015.01.02 09:00
2016.06.20 21:01:46.480    EURUSD,M30: history cache allocated for 18342 bars and contains 12389 bars from 2015.01.02 09:00 to 2015.12.31 20:00
2016.06.20 21:01:46.314    EURUSD: history synchronized from 2015.01.02 to 2016.06.17
2016.06.20 21:01:46.314    EURUSD: load 27 bytes of history data to synchronize
2016.06.20 21:01:46.312    EURUSD: history synchronization started
2016.06.20 21:01:46.266    Intel Core i7-3770K  @ 3.50GHz, 16071 MB

Here the plateform version :

https://framapic.org/K7dofmEIdGCm/W9BsQjqs2hyH.jpg

Post's attachments

best1_bis.mq5 236.66 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Hallo,

i have backtested the strategy on my alpari mt5 demo account.
The Problem is, that after the first or second order the ea dont place sl and tp anymore.
Not sure this Problem exist only on the backtester.
i have tried with fixed lots and %, but no change in the order execution.

At the moment i try a forwardtest on the demo account, it will take some time for some trades.

With mt5 demo accounts directly from metaqoutes i have the same errors like cybermanu.
no difference between trading in netting or hedging mode.

Post's attachments

EURUSD H1.xml 13.04 kb, 2 downloads since 2016-06-20 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Now logs and screenshoots.

regards

Post's attachments

MT5_EA_Problem.zip 659.75 kb, 1 downloads since 2016-06-20 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

I have join the XML strategy

Post's attachments

best1.xml 15.36 kb, 7 downloads since 2016-06-20 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Hallo,

no differences between "normal" trades´from the forward test and backtest results.

see attached file.

best regards

Post's attachments

MT5_Alpari_Demo_acc_Forward.zip 275.07 kb, 1 downloads since 2016-06-20 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

Hello ForexNoop,

I opened a demo at Alpari - MT5 - Hadging.

Your strategy trades without errors:

http://s32.postimg.org/7afxpsocl/screenshot_1798.png


I tested it also on the MT backtester and it also works without errors.

http://s32.postimg.org/5azbydu0x/screenshot_1798.jpg

http://s32.postimg.org/avbt90sw5/screenshot_1798.png

I cannot reproduce the problem.

Re: EA for MT5 dont work in 'Hedging Mode'

The Problem is, that after the first or second order the ea dont place sl and tp anymore.

I noticed that. I'll inspect the problem.

Re: EA for MT5 dont work in 'Hedging Mode'

Hi all !!!

This morning i have install and create an alpari platform and an account.
The backtest best1 strategy is OK . No errors.

I don't understand why. Maybe the account or the server of Activtrades ...

see you later

Re: EA for MT5 dont work in 'Hedging Mode'

Popov wrote:

The Problem is, that after the first or second order the ea dont place sl and tp anymore.

I noticed that. I'll inspect the problem.

Hallo Popov,

thank you for your effort!

Only on MT5 Demo Accounts from Metaqoutes i get the described errors.
(Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request)

@cybermanu

Are you sure that your ea is working?
On my account, with the backtester your ea opens orders but never close it.

Post's attachments

best1_backtest_20160621.jpg 682.56 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: EA for MT5 dont work in 'Hedging Mode'

hi,

It doesn't work. It doesn't take any position.

https://youtu.be/Rj0L9F5Otjw

best regard

Re: EA for MT5 dont work in 'Hedging Mode'

Thank you for the video,

Can you give me a TeamViewer access to your system. I think I can debug and fix it for 15 minutes on your comp.
The problem is that this problem doesn't happen on my terminal and I cannot guess what is the reason.

Please send me a PM with the login info and at what time is convenient for you.

Re: EA for MT5 dont work in 'Hedging Mode'

I am also having same problem, same error and cannot execute any trades in MetaTrader 5, I opened a MetaTrader 5 demo account from MetaQuotes

(Error: ActionTrade::ManageOrderSend(): OrderCheck(): Invalid price in the request)

Re: EA for MT5 dont work in 'Hedging Mode'

That is weird. I do not specify "Price" for the function OrderCheck because the EA executes only Market Order. It must be correct as per documentation:

Price, reaching which the order must be executed. Market orders of symbols, whose execution type is "Market Execution" (SYMBOL_TRADE_EXECUTION_MARKET), of TRADE_ACTION_DEAL type, do not require specification of price.


The code is:

            MqlTradeRequest request;
            MqlTradeResult result;
            MqlTradeCheckResult check;
            ZeroMemory(request);
            ZeroMemory(result);
            ZeroMemory(check);

            request.action       = TRADE_ACTION_DEAL;
            request.symbol       = _Symbol;
            request.volume       = orderLots;
            request.type         = (type == OP_BUY) ? ORDER_TYPE_BUY : ORDER_TYPE_SELL;
            request.type_filling = ORDER_FILLING_FOK;
            request.deviation    = 10;
            request.sl           = stopLossPrice;
            request.tp           = takeProfitPrice;
            request.comment      = OrderComment;

            bool isOrderCheck = OrderCheck(request, check);
            string retcode = ResultRetcodeDescription(check.retcode);

I'll try to reproduce the error and fix it.

Re: EA for MT5 dont work in 'Hedging Mode'

This is absolutely wrong. The MT5 tester doesn't open trades in "tester" because the "Trade is disabled".

http://s31.postimg.org/6xcjpkglj/screenshot_1817.jpg

What can I do? There is no info on that problem in the MQL forums.

Re: EA for MT5 dont work in 'Hedging Mode'

I opened a topic in the MQL forums. I hope we will receive answer there.