forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


(Page 2 of 2)

Forex Software → Help and Support → EA for MT5 dont work in 'Hedging Mode'

Pages Previous 1 2

You must login or register to post a reply

RSS topic feed

Posts: 26 to 34 of 34

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

Doesn't MT tester test because of the BREXIT vote today?

http://s31.postimg.org/kfjg1usqz/disabled_trade.png

Do I have to make FSB stop generating on Sundays or on holidays?

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

Popov wrote:

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

I added to the thread, and another person has also commented.

My 'secret' goal is to push EA Studio until I can net 3000 pips per day....

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

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

Please make a small modification and test if this error will disappear.

Open you MQL5 expert in the editor and search the following (use Ctrl + F ): ORDER_FILLING_FOK
Open a new line after that code and add the following line:

 request.price = (type == OP_BUY) ? tick.bid : tick.ask;

Your code must look like that:

http://s31.postimg.org/aqxqgj8p7/screenshot_1827.png

Please report the result.

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

You are a god wink

It ok for me. The open position is good (buy and sell) but now it's the closing of the position it doesn't work with no message in the history.

We're going forward.

Sorry for my english wink

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

the closing of the position it doesn't work with no message in the history.

I have an idea for the reason. I'll try to fix it during the weekend (if my MT5 starts testing/trading).

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

Hallo Popov,
I have tested your Solution on my Metaqoutes Demo-Accounts.

Demo in netting mode -> works perfecly, opens orders, set Sl and TP, close orders -> no Problem

Demo in Hedging mode -> now open orders, only the first one with SL and TP, opens many orders in the same time,
                                        the orders never closed.

On my Alpari Demo Account cant test it, because trading is disabled.

There is a article that describes the netting and hedging mode in mt5

https://www.mql5.com/en/articles/2299

best regards

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

Yes, I read it already. I suppose that we have to give the current position as a parameter.

But I don't know (yet) how to detect if the MT works in a hedging mode.

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

i think you can add code for hedging that also runs in netting mode.

position — position ticket. Fill it when changing and closing a position for its clear identification while trading in hedging mode. In the netting system, filling the field does not affect anything since positions are identified by a symbol name.

from here:
http://www.metaquotes.net/en/metatrader5/news/4696

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

I'm working on that problem, but still cannot make it right.
The problem is that there is no working examples and the MQL documentation is very vague on that.

As per documentations I set the current position Ticket to the new order and it should Add, Reduce, Close, and Reverse but unfortunately only the reduce is working normally.

I opened a thread in the MQL forum here: https://www.mql5.com/en/forum/89553

However, as we know, the MetaTrader guys never solve the real problems.

Posts: 26 to 34 of 34

Pages Previous 1 2

You must login or register to post a reply

Forex Software → Help and Support → EA for MT5 dont work in 'Hedging Mode'

Similar topics in this forum