Topic: Limit the number of open trades

Hi all, I plan to install several strategies based on fractals daily for several currency pairs, the problem is that in the case of opening different operations on the same day, could result in a margin call.

My question is, could someone please tell me how I could avoid opening two operations in one day?

I hope your responses, greetings and thank you very much.

Re: Limit the number of open trades

Use "Enter Once" indicator.

Re: Limit the number of open trades

Sorry but I think I explained well. I put several different strategies in different pairs and I will have no operations until they have closed all operations of all strategies. Is this possible?

Re: Limit the number of open trades

Find OpenNewPosition function in the expert. It's on line 720 of Expert v1.10
Put this code in the beginning of OpenNewPosition.

for (int i = 0; i < OrdersTotal(); i++)
    OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
    if (OrderType() == OP_BUY || OrderType() == OP_SELL)
        LastError = 0;
        return (0);

This code is not tested!!!

Re: Limit the number of open trades

Sorry, but when compiling I get error messages. Could you please put the mq4 file?

Many thanks for your help.

Re: Limit the number of open trades

This version of the expert has additional option: One_Position_Only.
Its default value is false and the expert works normally.
When you set One_Position_Only = true, the expert will cancel every entry order if there is already open position. Expert takes into account open positions even with other MagicNumber, ID or Symbol.

Post's attachments

MT4-FST Expert v1.12 OnePos.mq4 80.41 kb, 10 downloads since 2012-04-09 

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

Re: Limit the number of open trades

Thank you very much, I've been testing and it works great. But I have a small problem, in the case of multiple daily with fractals strategy, how I can give priority to a currency pair over another?. By trying to make a logic input to a second pair to enter beginning at 00:01 hours, but does not work.

Thank you very much again.