It seems to have trouble to re-enter the market on Mondays. Could you please check the code in my sample strategy.
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
{
if (Time[0].DayOfWeek == DayOfWeek.Monday && ToTime(Time[0]) >= 060000)
{
// Condition set 1
if (SMA(Close, Fast)[0] > SMA(Close, Slow)[0])
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (SMA(Close, Fast)[0] < SMA(Close, Slow)[0])
{
EnterShort(DefaultQuantity, "");
}
}
}
if (Time[0].DayOfWeek == DayOfWeek.Friday && ToTime(Time[0]) >= 200000)
{
ExitLong();
ExitShort();
}
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int Fast
{
get { return fast; }
set { fast = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int Slow
{
get { return slow; }
set { slow = Math.Max(1, value); }
}
#endregion

Comment