// ENTRY CONDITIONS
if (BarsInProgress==0) {
if (
( Position.MarketPosition == MarketPosition.Flat &&
(
(Closes[0][0]-Opens[0][0] >= (10*TickSize)) && (Closes[0][0]-Opens[0][0] <= (40*TickSize))
)
|| (
(Closes[1][0]-Opens[1][0] >= (7*TickSize) && Closes[1][0]-Opens[1][0] <= (40*TickSize))
)
&& (BarsSinceExit(3,"Long",0) == -1 || BarsSinceExit(3,"Long",0) > 0)
)
//2. The volume on the bar is greater than 50k contracts
&& (VOL()[0] > 50000)
)
{
EnterLong(3, 1,"Long");
EnterLong(3, 1,"LockedLong");
}
}
//PROFIT EXIT
//Position will exit on the following conditions
if (BarsInProgress==0) {
if (
// #1. The high of a 20 minute bar is less than 4 ticks below the last
(Highs[0][0] < Highs[0][1] - (4*TickSize))
// #2. The high of a 10 minute bar is less than 8 ticks below the last
|| (Highs[1][0] < Highs[1][1] - (8*TickSize))
// #3. The high of a 5 minute bar is less than 8 ticks below the last
|| (Highs[2][0] <= Highs[2][1] - (8*TickSize))
)
{
ExitLong(3, 1, "ExitLockedLong", "Long");
ExitLong(3, 1, "ExitLong", "LockedLong");
}
}

Comment