I am just beginning to construct a multi time frame strategy and am having some trouble starting off.
I am just looking to set a series of doubles for certain time periods but get the error message "cannot apply indexing with [] to an expression of type 'double'".
As is usual, it is probably a simple error, but would appreciate any advice as to how to obtain the required doubles so they can be utilised for the strategy.
The required code is written below.
protected override void Initialize()
{
// add a 1 day bars object - BarsInProgress index = 1
Add(PeriodType.Day, 1);
// Add a 100 tick Bars object - BarsInProgress index = 2
Add(PeriodType.Minute, 1);
//Check to see the importance of the BuySellPressure
//BuySellPressure().CalculateOnBarClose = false;
// Sets a trail stop of 2 percent
SetTrailStop(CalculationMode.Percent, 0.02);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Checks if OnBarUpdate() is called from an update on the primary Bars
if (BarsInProgress == 0)
{
double lastDayHigh = High[1][0];
double secondLastTick = Close[2][1];
double lastTick = Close[2][0];
Many thanks for any advice
4blue

Comment