I am attempting to utilize 2 DataSeries to compare my current candles Low to the low of a specific time
of day. If the current candles low does indeed show that it is lower, then i check to see if the candle
close is less than the lower Bollinger band. I am confused with how to look back at a particular time within the second array to get the low of the particular set time i have stored. Can anyone help?
In one array i am setting the low of say Time 3:01 and the array length is one since it only needs to keep one Value. The other DataSeries would keep multiple values and check against the shorter
array. As time advances i will check back to 301 again and again until it is time to reset 301 for the next day.
private DataSeries[]EntryLow; // Short Array
private DataSeries myDataSeries; // Long Array
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
EntryLow = new DataSeries[1];// Array Size
//EntryLow = new DataSeries(this);
myDataSeries = new DataSeries(this, MaximumBarsLookBack.Infinite);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
myDataSeries.Set(Low[0]);
if(ToTime(Time[0]) == ToTime(3,01,0))
{
EntryLow.Set(Low[0]);
}
if(ToTime(Time[0]) > ToTime(3,01,0)
&& myDataSeries[0] < EntryLow [0] //Not sure how to call EntryLow stored value
&& Low[0] < Bollinger(2, 14).Lower[0])
{
DrawHorizontalLine("My horizontal line" + CurrentBar, 5, Color.Chartreuse);
}
}
Comment