My primary timeframe is set to 1 Min
Secondary Time Frame is Set up to 1 Tick
When back testing my strategy on historical data
I would like to recalculate 1 Minute based Sar indicator on each Tick.
Even just a recalculation of Sar on opening of 1 min bar would be a good starting point.
So as I receive each tick within a new minute,
I collect new tick values and keep in my variables the actual
high and low of new uncompleted, 1 minute bar, which is still developing.
At any tick I would like to launch Sar calculation and pass to it the value of newly developing, not yet completed 1 min bars.
Parabolic Sar uses bar high and bar low for its calculations.
I am unable to pass my barlow and barhigh to Sar indicator and need suggestions on how to do that and how to adjust sar formula itself
I adjusted Sar indicator and added two attributes
in strategy code
...
if (BarsInProgress == 1)
{
// TICK DATA Analysis
as reciving new ticks keep adjusting barHigh and barLow variables
...
//recalculate Sar - 1 min Sar
sar = Sar2(BarsArray[0], Init, Max, Delta
barHigh, barLow
)[1]; <- not sure if I need to reference previous bar;
[0] would be incorrect as it refers to 1 min bar which is in the future at the time when I process tick data
in sar indicator
- I added two attributes Barlow and BarHigh and in my call to sar from strategy I pass my barLow and barHigh to the indicator
somewhere in the sar indicator code
I need to replace Low[0] and High[0] references with
Barlow and BarHigh
that has to be done only for the LAST 1 Minute Bar
I am not sure how to identify in sar indicator code that I am processing last bar
when I globaly replaced all refrences in indicator from Low[0] to LowBar and High[0] to BarHig attributes all got wrong.
so please suggest:
1 how to pass a value to 1 min based bar indicator from secondary time frame
2. how to tell the indicator to only recalculate last bar ( as I can see all history is recalculated)
3 how to identify in indicator that I am processing last bar?
I would appreciate any suggestions
as I have no idea how to resolve those problems
Comment