Is there some control via property/moethod available to only start when all dependant bars are loaded in other referenced modules.
I was getting inconsistent results with bar data loading in chained indicators - .ie. one which is called by another - it was neccessarty to hit F5 to get them to load daily bars before the other indicator/strategy ran - the ends result was the daily bars loaded at some point in the other indicator after the primary bars had loaded and were plotted on the chart up to the current bar.
The attached images show successful operation and failed operation - which is resolved by pressing F5
The reason to load secondary bars within indicators called by others is to negate the need to load the extra bars within the calling indicator/strategy by encapsulating the logic with am indiator that can be used many times by many modulss etc...
Import attachment and add MTTest1 adn MTTest2 to a 10Min chart with 30days of data
Scenario
#1 Indicator HTFATR
Run on a 10Min chart or any intraday time series min chart.
It loads on initialise DailyBars
It plots the seconday bars ATR within the primary bars Plot.
E.G Dailly ATR set in the 10Min values[0]
When tested on its own it always loads daily data and displays ok.
#2 Indicator HTF ATR Watcher
This will test on each bar update on a 10min chart it will test the HTFATR().value
to see if the current day range >= HTFATR().value and plot if so.
#3 Strategies
Several strategies will use indicator #2 to only trade when the HTFATRWatcher()[0] is set. If the daily bars do not load in #1 then #2 will always be false for historical testing
I am assuming this is a valid use of secondary bars.
I have found that #2 does not always respond as the bars loading in #1 have not completed and the primaary bars go ahead and plot without it - then on the current ba and !historical it will start to plot
Comment