The entries are not happening on the tick but on the 15 min even though I have them summitted to the tick timeframe. I think the problem
is that it is doing the checks to submit the order on the higher timeframe even though I have them submitted to the tick.
It's live the OnBarUpdate only happens once each 15 min.
Do I have to have the smallest timeframe as my base and then add higher timeframes secondarily or is it something else?
Pertinent code included
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
}
else if (State == State.DataLoaded)
{
EMA1 = EMA(Close, 8);
BarCounter1 = BarCounter(Close, true, Brushes.Gray, 14, 50, true);
EMA1.Plots[0].Brush = Brushes.Goldenrod;
BarCounter1.Plots[0].Brush = Brushes.Transparent;
AddChartIndicator(EMA1);
AddChartIndicator(BarCounter1);
SetProfitTarget(@"Long", CalculationMode.Ticks, Target);
SetStopLoss(@"Long", CalculationMode.Ticks, Target, false);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1
|| CurrentBars[1] < 1)
return;
// Set 1
if ((IsFirstTickOfBar == true)
&& (Open[1] > Close[1])
&& (Open[0] < Close[0])
&& (Low[0] < Low[1])
&& (High[0] < High[1])
&& (Close[1] > EMA1[0])
&& (BarCounter1[0] > 60)
&& (BarCounter1[0] < 79))
{
EntryLong = (High[0] + 1) ;
LongConditions = true;
BarBrush = Brushes.Gold;
Print(@"---------Long conditions True");
Print(Convert.ToString(Times[0][0]));
Print(Convert.ToString(BarCounter1[0]));
Print(Convert.ToString(EntryLong));
Print(@"------------------------");
}
// Set 2
if ((LongConditions == true)
&& ((GetCurrentBid(1)) >= EntryLong))
{
EnterLong(1 ,Convert.ToInt32(Contracts), @"Long");
// LongConditions = false;
Print(@"-----entered");
Print(Convert.ToString(Times[0][0]));
Print(Convert.ToString(Closes[1][0]));
Print(@"---------------------");
}
// Set 3
if (Close[0] < EMA1[0])
{
LongConditions = false;
}

Comment