protected override void OnStrategyStart() { Portfolio.Account.Deposit(AllocationPerInstrument, CurrencyId.USD, "Initial allocation"); bbu = new BBU(Bars, Length, K); bbl = new BBL(Bars, Length, K); sma = new SMA(Bars, Length); AddGroups(); }
public static double Value(ISeries input, int index, int length, double k, BarData barData = BarData.Close) { if (index >= length - 1) { var bbl = BBL.Value(input, index, length, k, barData); var bbu = BBU.Value(input, index, length, k, barData); return((input[index, barData] - bbl) / (bbu - bbl)); } return(double.NaN); }