protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                // If the Filter and CrossoverSMA signal the trade, we buy at market.
                OrderUpdate buyOrder = trading.ExecuteFullMarketOrderBuy(FirstPair);

                return(new InTradeState(buyOrder));
            }
Beispiel #2
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                var pair = AlgorithmConfiguration.TradingPairs.First();

                trading.ExecuteFullMarketOrderBuy(pair);
                WaitForNextCandle();
                return(new NothingState <KeiraNightlyConfiguration>());
            }
Beispiel #3
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                trading.ExecuteFullMarketOrderBuy(FirstPair);
                for (var i = 0; i < AlgorithmConfiguration.CandleCount; i++)
                {
                    WaitForNextCandle();
                }

                trading.ExecuteFullMarketOrderSell(FirstPair);
                return(new CheckState());
            }
Beispiel #4
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                // If the Filter and CrossoverSMA signal the trade, we buy at market.
                trading.ExecuteFullMarketOrderBuy(FirstPair);

                for (var i = 0; i < AlgorithmConfiguration.WaitTime; i++)
                {
                    WaitForNextCandle();
                }

                return(new SetStopState());
            }
Beispiel #5
0
            protected override State <Config> Run(TradingProvider trading, DataProvider data)
            {
                OrderUpdate buyOrder =
                    trading.ExecuteFullMarketOrderBuy(AlgorithmConfiguration.TradingPairs.First());
                Portfolio portfolio = trading.GetPortfolio();

                _limitSell = trading.PlaceLimitOrderSell(
                    AlgorithmConfiguration.TradingPairs.First(),
                    portfolio.GetAllocation(AlgorithmConfiguration.TradingPairs.First().Left).Free,
                    buyOrder.AverageFilledPrice * AlgorithmConfiguration.TakeProfit);
                SetTimer(TimeSpan.FromHours(AlgorithmConfiguration.StopTime));
                return(new NothingState <Config>());
            }
 protected override State <Config> Run(TradingProvider trading, DataProvider data)
 {
     trading.ExecuteFullMarketOrderBuy(FirstPair);
     return(new MeanSellState());
 }
Beispiel #7
0
 protected override State <Config> Run(TradingProvider trading, DataProvider data)
 {
     _buyOrder = trading.ExecuteFullMarketOrderBuy(_pair);
     SetTimer(TimeSpan.FromHours(AlgorithmConfiguration.HoldTime));
     return(new NothingState <Config>());
 }