This NOT work:
if( Position.MarketPosition == MarketPosition.Long )
{
if( Close[0] > upperBand )
{
ExitLong();
EnterShort();
}
}
else if( Position.MarketPosition == MarketPosition.Short )
{
if( Close[0] < lowerBand )
{
ExitShort();
EnterLong();
}
}
else //Flat
{
if( Close[0] < lowerBand )//Long
{
EnterLong();
}
if( Close[0] > upperBand )//Short
{
EnterShort();
}
}
Comment