Example #1
0
        public static bool Activate(string strategy, decimal pnl, RollingBB indicator)
        {
            var day = indicator.Current.EndTime.Day;

            if (_pday != day)
            {
                _pday = day;
                if (pnl < indicator.LowerBand)        // || indicator > 0)
                {
                    _activated.Remove(strategy);
                }
                else if (pnl >= indicator.UpperBand)
                //else if  (pnl >= (indicator.UpperBand * 0.5m + indicator.LowerBand * 0.5m))
                {
                    _activated.Add(strategy);
                }
            }
            var value = _activated.Contains(strategy);

            return(value);
        }
Example #2
0
        public override void Initialize()
        {
            var res = TimeSpan.FromHours(1);

            foreach (var s in symbols)
            {
                AddEquity(s, Resolution.Minute).SetLeverage(2);

                // pfe[s] = new PolarisedFractalEfficiency();
                // Algo.RegisterIndicator(s, pfe[s], res);

                // ppfe[s] = 0;

                // eit[s] = new EhlerInstantaneousTrend();
                // Algo.RegisterIndicator(s, eit[s], res);
                RBB[s] = new RollingBB();
                Algo.RegisterIndicator(s, RBB[s], res);

                // pvalue[s] = 0;
                // activate[s] = false;
            }
        }