Dear Dukas & community,
I run two strategies, which both both / sell on predefined times,
e.g.
strategy 1 buys at 13:00 and sells at 15:00;
strategy 2 buys at 00.01 and sells at 23:59
I use the following code to open positions
if ((Hour ==0 && Minute ==0 && MonthDay == 3))
{
buy (instrument, engine, profitLimit, lossLimit, volume);
}
and this to close positions
if (Hour ==23 && Minute == 59) order.close();
Both strategies trade EURUSD.
At the moment, I run the strategies on two separate accounts so that the closing of positions on strategy 1 does not close the Strategy 2 positions.
I would like to combine the strategies and run on one account. How do I close positions selectively (I am thinking using the label)?
Thanks