//set out of area

        protected override void Initialize()
        {
            RSINow = Indicators.RelativeStrengthIndex(SourceSeries, RSI_period);
            seriesH1 = MarketData.GetSeries(TimeFrame.Daily);
            ATR = Indicators.AverageTrueRange(seriesH1, ATR_period, MovingAverageType.Simple);

        }
Esempio n. 2
0
 protected override void Initialize()
 {
     _trend            = new int[1];
     _upBuffer         = CreateDataSeries();
     _downBuffer       = CreateDataSeries();
     _averageTrueRange = Indicators.AverageTrueRange(Period, MovingAverageType.WilderSmoothing);
 }
Esempio n. 3
0
        protected override void Initialize()
        {
            if (EnableATRInfo)
            {
                atr = Indicators.AverageTrueRange(14, MovingAverageType.Exponential);
            }

            if (EnableD1)
            {
                seriesD1 = MarketData.GetSeries(TimeFrame.Daily);
                macdD1   = Indicators.MacdCrossOver(seriesD1.Close, 26, 12, 9);
                mmD1     = Indicators.ExponentialMovingAverage(seriesD1.Close, 200);
            }

            if (EnableH4)
            {
                seriesH4 = MarketData.GetSeries(TimeFrame.Hour4);
                macdH4   = Indicators.MacdCrossOver(seriesH4.Close, 26, 12, 9);
                mmH4     = Indicators.ExponentialMovingAverage(seriesH4.Close, 200);
            }

            if (EnableH1)
            {
                seriesH1 = MarketData.GetSeries(TimeFrame.Hour);
                macdH1   = Indicators.MacdCrossOver(seriesH1.Close, 26, 12, 9);
                mmH1     = Indicators.ExponentialMovingAverage(seriesH1.Close, 200);
            }

            if (EnableM5)
            {
                seriesM5 = MarketData.GetSeries(TimeFrame.Minute5);
                macdM5   = Indicators.MacdCrossOver(seriesM5.Close, 26, 12, 9);
                mmM5     = Indicators.ExponentialMovingAverage(seriesM5.Close, 200);
            }
        }
Esempio n. 4
0
 protected override void Initialize()
 {
     _trend = new int[1];
     _upBuffer = CreateDataSeries();
     _downBuffer = CreateDataSeries();
     _averageTrueRange = Indicators.AverageTrueRange(Period, MovingAverageType.WilderSmoothing);
 }
        /// <summary>
        /// CALLED WHEN THE ROBOT FIRST STARTS, IT IS ONLY CALLED ONCE.
        /// </summary>
        protected override void OnStart()
        {
            // TRADE MANAGER DECLERATION
            //tm = new TradeManager(this);

            // INSTANTIATE THE INDICATORS
            VindIchi   = Indicators.IchimokuKinkoHyo(9, KijunSen, 52);
            VchaikinMF = Indicators.ChaikinMoneyFlow(ChaikinPeriod);
            //  CUSTOM INDICATORS
            Vosma = Indicators.GetIndicator <OSMA>(OsMAShort, OsMALong, OsMASignal);
            Vatr  = Indicators.GetIndicator <AverageTrueRange>(ATRFast, ATRSlow);
        }
Esempio n. 6
0
 protected override void Initialize()
 {
     //Algoline here
     _trendlong             = new int[1];
     _trendshort            = new int[1];
     _upBufferlong          = CreateDataSeries();
     _downBufferlong        = CreateDataSeries();
     _upBuffershort         = CreateDataSeries();
     _downBuffershort       = CreateDataSeries();
     _averageTrueRangelong  = Indicators.AverageTrueRange(LongPeriod, MovingAverageType.WilderSmoothing);
     _averageTrueRangeshort = Indicators.AverageTrueRange(ShortPeriod, MovingAverageType.WilderSmoothing);
 }
Esempio n. 7
0
        protected override void Initialize()
        {
            series1m    = MarketData.GetSeries(TimeFrame.Minute);
            series5m    = MarketData.GetSeries(TimeFrame.Minute5);
            series15m   = MarketData.GetSeries(TimeFrame.Minute15);
            series60m   = MarketData.GetSeries(TimeFrame.Hour);
            seriesdaily = MarketData.GetSeries(TimeFrame.Daily);

            atr      = Indicators.AverageTrueRange(21, MovingAverageType.Exponential);
            atr1m    = Indicators.AverageTrueRange(series1m, 21, MovingAverageType.Exponential);
            atr5m    = Indicators.AverageTrueRange(series5m, 21, MovingAverageType.Exponential);
            atr15m   = Indicators.AverageTrueRange(series15m, 21, MovingAverageType.Exponential);
            atr60m   = Indicators.AverageTrueRange(series60m, 21, MovingAverageType.Exponential);
            atrdaily = Indicators.AverageTrueRange(seriesdaily, 21, MovingAverageType.Exponential);
        }
Esempio n. 8
0
 protected override void Initialize()
 {
     ma  = Indicators.MovingAverage(Source, MAPeriods, MAType);
     atr = Indicators.AverageTrueRange(ATRPeriods, MovingAverageType.Simple);
 }
 protected override void Initialize()
 {
     averageTrueRange = Indicators.AverageTrueRange(Periods, MAType);
 }
Esempio n. 10
0
 protected override void Initialize()
 {
     _ma = Indicators.MovingAverage(Source, MaPeriod, MaType);
     _atr = Indicators.AverageTrueRange(AtrPeriod, MovingAverageType.Simple);
 }
Esempio n. 11
0
 protected override void Initialize()
 {
     ma = Indicators.MovingAverage(Source, MAPeriods, MAType);
     atr = Indicators.AverageTrueRange(ATRPeriods, MovingAverageType.Simple);
 }
Esempio n. 12
0
 protected override void Initialize()
 {
     _trend            = new bool[1];
     _ema              = Indicators.ExponentialMovingAverage(Source, Period);
     _averageTrueRange = Indicators.GetIndicator <AverageTrueRange>(Period);
 }
Esempio n. 13
0
 protected override void Initialize()
 {
     _averageTrueRange         = Indicators.GetIndicator <AverageTrueRange>(PeriodAtr);
     _exponentialMovingAverage = Indicators.ExponentialMovingAverage(MarketSeries.Close, PeriodEma);
 }
Esempio n. 14
0
 protected override void Initialize()
 {
     _calculateValue = TimeFrame == "calculateValue";
     _trend = new int[MarketSeries.Close.Count];
     _atr = Indicators.GetIndicator<AverageTrueRange>(ATRPeriod);
 }
Esempio n. 15
0
 protected override void Initialize()
 {
     atr       = Indicators.AverageTrueRange(MarketData.GetSeries(AtrTimeFrame), AtrPeriod, AtrMaType);
     AtrSeries = MarketData.GetSeries(AtrTimeFrame);
 }
Esempio n. 16
0
 protected override void Initialize()
 {
     _ma  = Indicators.MovingAverage(Source, MaPeriod, MAType);
     _atr = Indicators.GetIndicator <AverageTrueRange>(AtrPeriod);
 }
Esempio n. 17
0
        //public  event EventHandler<EventArgs<int>>  CalcFinished = delegate {} ;

        protected override void Initialize()
        {


            _averageTrueRange = Indicators.GetIndicator<AverageTrueRange>(atrPeriod);
        }
Esempio n. 18
0
 protected override void Initialize()
 {
     _globalSeries = MarketData.GetSeries(Symbol, GlobalTimeFrame);
     _globalTr = Indicators.TrueRange(_globalSeries);
     _globalAtr = Indicators.AverageTrueRange(_globalSeries, AtrPeriod, AtrMovingAverageType);
 }
Esempio n. 19
0
 protected override void Initialize()
 {
     _weightedMovingAverage = Indicators.WeightedMovingAverage(MarketSeries.Close, 21);
     _averageTrueRange      = Indicators.GetIndicator <AverageTrueRange>(100);
     _simpleMovingAverage   = Indicators.SimpleMovingAverage(TMA, smaPeriod);
 }
 protected override void Initialize()
 {
     averageTrueRange = Indicators.AverageTrueRange(Periods, MAType);
 }
Esempio n. 21
0
 protected override void Initialize()
 {
     _weightedMovingAverage = Indicators.WeightedMovingAverage(MarketSeries.Close, 21);
     _averageTrueRange = Indicators.GetIndicator<AverageTrueRange>(100);
     _simpleMovingAverage = Indicators.SimpleMovingAverage(TMA, smaPeriod);
 }
Esempio n. 22
0
 protected override void Initialize()
 {
     _calculateValue = TimeFrame == "calculateValue";
     _trend          = new int[MarketSeries.Close.Count];
     _atr            = Indicators.GetIndicator <AverageTrueRange>(ATRPeriod);
 }
        //set out of area

        protected override void Initialize()
        {
            RSINow   = Indicators.RelativeStrengthIndex(SourceSeries, RSI_period);
            seriesH1 = MarketData.GetSeries(TimeFrame.Daily);
            ATR      = Indicators.AverageTrueRange(seriesH1, ATR_period, MovingAverageType.Simple);
        }
Esempio n. 24
0
 protected override void Initialize()
 {
     _ma  = Indicators.MovingAverage(Source, MaPeriod, MaType);
     _atr = Indicators.AverageTrueRange(AtrPeriod, MovingAverageType.Simple);
 }
Esempio n. 25
0
        protected override void OnStart()
        {
            DragonID = "Golden Dragon " + Symbol.Code + "-" + DragonNumber;

            Count = BuyWait;
            BuyVolume = OpeningLotSize;
            Quantity = BuyVolume;
            OpeningBalance = Account.Balance;

            MaxLong = MaxLongTrades;
            MaxShort = MaxShortTrades;

            cog = Indicators.GetIndicator<BelkhayatePRC>(cogDegree, cogPeriod, Inner, Middle, Outer);
            hull = Indicators.GetIndicator<HMA>(HullPeriod);

            if (atr1Period > 0 && atr2Period > 0)
            {
                atr1 = Indicators.AverageTrueRange(atr1Period, atr1Type);
                atr2 = Indicators.AverageTrueRange(atr2Period, atr2Type);
            }

            Message(0, "Dragon awakening...");

            foreach (var position in Account.Positions)
            {
                if (position.Label == DragonID)
                {
                    BotBalance += position.GrossProfit;
                    switch (position.TradeType)
                    {
                        case TradeType.Buy:
                            LongPositions++;
                            break;
                        case TradeType.Sell:
                            ShortPositions++;
                            break;
                    }
                }
            }

            if (LongPositions > 0 || ShortPositions > 0)
                Message(0, "Found " + LongPositions + " half-eaten eagle(s) and " + ShortPositions + " rotting sheep");
            else
                Message(0, "No open trades found");

            ChartRefresh();

            filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), DragonID + ".txt");

            if (MartingaleEnabled && File.Exists(filePath))
            {
                _fileReader = File.OpenText(filePath);
                MartingaleActive = Int32.Parse(_fileReader.ReadLine());
                Message(0, "Martingale Level : " + MartingaleActive);
                _fileReader.Close();
            }
        }
Esempio n. 26
0
 protected override void Initialize()
 {
     _atr = Indicators.AverageTrueRange(Period, MaType);
 }
Esempio n. 27
0
        //public  event EventHandler<EventArgs<int>>  CalcFinished = delegate {} ;

        protected override void Initialize()
        {
            _averageTrueRange = Indicators.GetIndicator <AverageTrueRange>(atrPeriod);
        }
Esempio n. 28
0
 protected override void Initialize()
 {
     _weightedMovingAverage = Indicators.WeightedMovingAverage(MarketSeries.Close, 21);
     _averageTrueRange      = Indicators.GetIndicator <AverageTrueRange>(100);
     _relativeStrengthIndex = Indicators.RelativeStrengthIndex(TMA, rsiPeriod);
 }
Esempio n. 29
0
 protected override void Initialize()
 {
     atr = Indicators.AverageTrueRange(MarketData.GetSeries(AtrTimeFrame), AtrPeriod, AtrMaType);
 }
 protected override void Initialize()
 {
     _globalSeries = MarketData.GetSeries(Symbol, GlobalTimeFrame);
     _globalTr     = Indicators.TrueRange(_globalSeries);
     _globalAtr    = Indicators.AverageTrueRange(_globalSeries, AtrPeriod, AtrMovingAverageType);
 }
Esempio n. 31
0
 protected override void Initialize()
 {
     _atr = Indicators.AverageTrueRange(Period, atrMaType);
 }
Esempio n. 32
0
 protected override void Initialize()
 {
     atr = Indicators.AverageTrueRange(14, MovingAverageType.Exponential);
 }
Esempio n. 33
0
 protected override void Initialize()
 {
     _averageTrueRange = Indicators.GetIndicator<AverageTrueRange>(PeriodAtr);
     _exponentialMovingAverage = Indicators.ExponentialMovingAverage(MarketSeries.Close, PeriodEma);
 }
Esempio n. 34
0
 protected override void Initialize()
 {
     _ma = Indicators.MovingAverage(Source, MaPeriod, MAType);
     _atr = Indicators.GetIndicator<AverageTrueRange>(AtrPeriod);
 }
Esempio n. 35
0
 protected override void Initialize()
 {
     _trend = new bool[1];
     _ema = Indicators.ExponentialMovingAverage(Source, Period);
     _averageTrueRange = Indicators.GetIndicator<AverageTrueRange>(Period);
 }
Esempio n. 36
0
 protected override void Initialize()
 {
     _weightedMovingAverage = Indicators.WeightedMovingAverage(MarketSeries.Close, 21);
     _averageTrueRange = Indicators.GetIndicator<AverageTrueRange>(100);
     _relativeStrengthIndex = Indicators.RelativeStrengthIndex(TMA, rsiPeriod);
 }