I have problem using my custom indicator inside my strategy:
Indicator looks:
if (State == State.Configure) {
Calculate = Calculate.OnEachTick;
IsAutoScale = false;
IsOverlay = true;
Name = indicatorName;
AddPlot(new Stroke(Brushes.Lime), PlotStyle.Dot, "Potential_Long");
AddPlot(new Stroke(Brushes.PaleVioletRed), PlotStyle.Dot, "Potential_Short");
// Add Range Bars Time Frame [timeFrameRB]
AddDataSeries(BarsPeriodType.Range, iTFrbPeriod);
// Add Minutes Time Frame [timeFrameMinute]
AddDataSeries(BarsPeriodType.Minute, iTFminutePeriod);
// Inicializace objektu s nastavením, buď dle strategie a nebo dle trhu
initFailed = false;
longGaps = new List<GapItem>();
shortGaps = new List<GapItem>();
}
i have strategy which uses also multi time frames looks:
Strategy
else if (State == State.Configure)
{
// Add Volumetric Time Frame [timeFrameVolumetric]
AddVolumetric("ES JUN23", BarsPeriodType.Range, iRangeBarSize, VolumetricDeltaType.BidAsk, 1);
// Add Entry Time Frame [timeFrameEntry]
AddDataSeries(BarsPeriodType.Range, iRangeBarSize);
// Add Daily Chart [timeFrameDaily]
AddVolumetric("ES JUN23", BarsPeriodType.Day, 1, VolumetricDeltaType.BidAsk, 1);
// Add Entry Ticks [timeFrameTicks]
AddDataSeries(BarsPeriodType.Tick, 1);
And I want to use GAP indicator inside strategy
using:
else if (State == State.DataLoaded)
{
Print("Strategy updated (State.DataLoaded) Account: " + Account.Name);
string strategySettings = "";
strategySettings += "Range bars: " + iRangeBarSize + "\n";
strategySettings += "Account: " + Account.Name + "\n";
tradesLogger.Store(tradesLoggerCsvHeader);
if (Account.Name != "Sim101")
SendMail("RB" + this.RangeBarSize + " Starting on Account: " + Account.Name, strategySettings, true);
// Add EMA indicator to strategy
emaIndicator = EMA(BarsArray[timeFrameEntry], iEmaPeriod);
emaIndicator.Plots[0].Brush = bEmaColor;
// Add LevelsSR indicator
levelsSRIndicator = Saskuj_LevelsSR(BarsArray[timeFrameEntry]);
// Add GAP Indicator
gapIndicatorA = Saskuj_GAP(BarsArray[timeFrameEntry], iFilterGapLookbackDays, iFilterGapMinimumSizeTicks, iTFrbPeriod, iFilterGapTFminutePeriodA, iFilterGapCancelCloseTicks, iFilterGapCancelApproachTicks, iFilterGapCancelDistancedTicks);
<b>
| 'Saskuj_GAP' tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load ES 06-23 Globex: 6 Range |
I specify tf in gapIndicatorA = .... as parameter iTFrbPeriod and iFilterGapTFminutePeriodA
How should i solve this?

Comment