I have a strategy that uses 2 series. The first series is a 10-tick series while the second is a 480-minute one (Note: I selected the 10-tick series as an attempt to catch the price movement as fast as possible. If there’s a better way, kindly suggest).
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);
}
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();
}
The problem is that the code doesn’t always execute my condition (when the current price is higher than 480 minute high). In so many cases, it does. However, not all the time. There were times when the current price exceeded with 20 ticks difference, and the buy position was not placed!! I intend to make my profit target as 20-ticks
Is this attributed to the volatility of the market?
Is this a little problem in the code?
How can I ensure there’s no delay in placing my order?
Thanks
Comment