if ( Short [ i ] )
{
priceatshort = ShortPrice[ i ];
LowsinceShort = 0;
lowsinceshort = Min( Low[ i ], lowsinceshort );
shortAdjusted[ i ] = 1;
shortPriceAdjusted[ i ] = ShortPrice[ i ];
FirstProfitTargetArrayS[ i ] = priceatshort - FirstProfitTargetS;
for (j = i + delay; j < BarCount; j++)
{ LowsinceShort = Min( Low[ j ], LowsinceShort );
lowSinceshortArray[ j ] = lowsinceshort;
FirstProfitTargetArrayS[ j ] = priceatshort - FirstProfitTargetS;
if( High[ j ] >= TrailStopArrayS[ j ] )
{ Cover[ j ] = 1;
CoverPrice[ j ] = Max( Open[ j ], TrailStopArrayS[ j ] );
i = j;
break; }
if( exitType == 0 AND Low[ j ]<= (priceatshort - FirstProfitTargetS) )
{
// first profit target hit - scale-out
exitType = 1;
ShortAdjustedScale[ j ] = sigScaleOut;
ShortPriceAdjusted[ j ] = Min( Open[ j ], (priceatshort - FirstProfitTargets) );
}
if (j == BarCount - 1)
{ i = BarCount; }
}
}