Skip to content

Commit

Permalink
New server Binance
Browse files Browse the repository at this point in the history
  • Loading branch information
“Andrey87-09” committed Mar 31, 2018
1 parent c818805 commit 53aa979
Show file tree
Hide file tree
Showing 17 changed files with 2,694 additions and 2 deletions.
23 changes: 23 additions & 0 deletions project/OsEngine/Entity/CandleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Windows;
using OsEngine.Logging;
using OsEngine.Market.Servers;
using OsEngine.Market.Servers.Binance;
using OsEngine.Market.Servers.BitMex;
using OsEngine.Market.Servers.Kraken;
using OsEngine.Market.Servers.Oanda;
Expand Down Expand Up @@ -320,6 +321,28 @@ private void CandleStarter()
series.UpdateAllCandles();
series.IsStarted = true;
}
else if (serverType == ServerType.Binance)
{
BinanceServer binance = (BinanceServer)_server;
if (series.TimeFrameSpan.TotalMinutes < 1 ||
series.TimeFrame == TimeFrame.Tick ||
series.TimeFrame == TimeFrame.Delta)
{
List<Trade> allTrades = _server.GetAllTradesToSecurity(series.Security);
series.PreLoad(allTrades);
}
else
{
List<Candle> candles = binance.GetCandleHistory(series.Security.Name,
series.TimeFrameSpan);
if (candles != null)
{
series.CandlesAll = candles;
}
}
series.UpdateAllCandles();
series.IsStarted = true;
}
}
}
}
Expand Down
Loading

0 comments on commit 53aa979

Please sign in to comment.