I am creating a strategy using BoolSeries with BarsArray using a 15 and 60 minute chart. The basic idea is if bullIndication is true on a 15 and a 60 minute chart, then go long. The code works fine using one chart (without using BarsArray), but I can not get it with BarsArray. Here is what I have:
Indicator Code:
bullIndication.Set(true);
bearIndication.Set(false);
I had to create an instance so I can access the BoolSeries.
Strategy Code:
#region Variables
private double multiplier = 2.;
private int rangePeriod = 14;
private int basePeriod = 13;
private Indicator.myIndicator ABC;
private double lastStopValue;
#endregion
protected override void Initialize()
{
ExitOnClose = false;
Add(PeriodType.Minute, 15);
Add(PeriodType.Minute, 60);
ABC = myIndicator(basePeriod, multiplier, rangePeriod);
Add(ABC);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (ABC.BullIndication[0](BarsArray[1] && ABC.BullIndication[0](BarsArray[2]));
EnterLong(DefaultQuantity, "");
I can not figure out the code to call the BoolSeries with the BarsArray. Could someone please help me with the correct code for this section:
-----
if (ABC.BullIndication[0](BarsArray[1] && ABC.BullIndication[0](BarsArray[2]));
-----
Thank you very much.
Comment