I want to get the High of x sessions (not days) ago on an 60min chart. Is this possible? I basically just need to store the CurrentBar of each session and then reference to it via PriorDayOHLC().PriorHigh
So I tried to create an int-series and access the High via the PriorDayOHLC() statement:
private Series<int> Session;
if (State == State.Configure)
{
protected override void OnBarUpdate()
{
if (Bars.IsFirstBarOfSession)
Session[0] = CurrentBar;
if (PriorDayOHLC().PriorHigh[CurrentBar - Session[1])
do something
}
I thought I could access the first bar of x sessions ago with Session[x]. However, this doesn't work. How can I store every first bar of session and access it afterwards on intrady data? Is there a way to solve this problem?
I also tried PriorDayOHLC().PriorHigh[CurrentBar - Bars.GetBar(Time[1].AddDays(-1))]. But I dont like this because of weekends and holidays. I want to use this strategy for various of instruments and trading hour templates, so I really want to access the High of each session.
Would very much appreciate your help!
Comment