I have a multi-time frame strategy.
Add(PeriodType.Minute, 60); // BIP 1
Add(PeriodType.Minute, 30); // BIP 2
Add(PeriodType.Minute, 10); // BIP 3
for each BarsInProgress (BIP) I have an entry and exit calculations logic. All BIP should generally enter and exit independently of each other.
I have for example the following entry orders for BIP1:
if (myLimit31 == null)
{
myLimit31 = EnterLongLimit(2,true,EntrySize,Limit1,"EL30-1");
}
if (myLimit32 == null)
{
myLimit32 = EnterLongLimit(2,true,EntrySize,Limit2,"EL30-2");
}
if (myLimit33 == null)
{
myLimit33 = EnterLongLimit(2,true,EntrySize,Limit3,"EL30-3");
}
Now if I would like to exit only the positions from entry orders EL30-1 to EL30-3, but not any other position entered on any other BIP timeframe. How would I do this?
I have tried with Positions[2].Quantity (not working):
ExitOrder30 = ExitLongStopLimit(Positions[2].Quantity, Lows[2][0] - 0.01,Lows[2][0] - 0.01,"XL30+" + CurrentBar,"");
Can I try something with "EL30*" whereby all orders which start with "EL30" will be exited? Obviously I could also add an entry counter per BIP, but I thought there is probably a better solution.
Thank you
whotookmynickname

Comment