Exemple #1
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                decimal stopPrice = data.GetLowestLow(FirstPair, AlgorithmConfiguration.Loss);

                stopLoss = trading.PlaceFullStoplossSell(FirstPair, stopPrice);

                return(new InTradeState(_buyOrder, stopLoss));
            }
Exemple #2
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                // Get the lowest low from the last y hours.
                decimal shortTermTimePrice = data.GetLowestLow(FirstPair, AlgorithmConfiguration.ShortTermTime);

                // Set first stop loss order at DCMin.
                _stoploss = trading.PlaceFullStoplossSell(FirstPair, shortTermTimePrice);
                return(new CheckState(_stoploss));
            }
Exemple #3
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                var pair  = AlgorithmConfiguration.TradingPairs.First();
                var price = data.GetCurrentPriceTopBid(pair);

                _stoploss = trading.PlaceFullStoplossSell(pair, price * AlgorithmConfiguration.StopTrail);
                SetTimer(TimeSpan.FromHours(AlgorithmConfiguration.WaitTime));
                return(new NothingState <KeiraNightlyConfiguration>());
            }