I have a strategy that uses 2 series. The first series is a 10-tick series while the second is a 480-minute one. My buy condition is a straightforward one. Simply the moment current price (high of the first series 10-tick) is higher than the High of the 480-minute candle (second series), take a buy position. So, here’s how I described it in the code:
else if (State == State.Configure)
{
AddDataSeries(FirstSeries);
AddDataSeries(SecondSeries);
}
else if (State == State.DataLoaded)
{
Brush1 = new SolidColorBrush((Color)ColorConverter.ConvertFromS tring("#FFCCCCCC"));
Brush1.Freeze();
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1 || BarsInProgress == 2)
return;
if (CurrentBars[1] < 2)
return;
if (CurrentBars[2] < 2)
return;
If (Highs[1][0]>Highs[2][0])
{
EnterLong();
Draw.ArrowUp(this, Up + Convert.ToString(CurrentBars[0]), true, 0, (Low[0] + (-55 * TickSize)) , Brushes.White);
}
I noticed a difference in my order execution when I change the window time frame. If I open a 10-tick window and apply my strategy, results are different than the ones when I open a 20-minute window.
I added the drawing order to track the code execution. I noticed that the code works almost perfectly when I use the smaller window (10-tick). However, when I open the 20-minute window, even if the current price exceeds the high of the 480-minute candle (2nd series), it doesn’t execute it unless a close of a 20-minute candle is higher than the high of the 2 series!!
I thought the strategy is usually applied regardless which window is open
How can I open a 20-minute window and ensure a proper execution of my order (when the high of the 10-tick is higher than the high of the 480-minute)?
Thanks
Comment