plug candle store and bot
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
using static Managing.Common.Enums;
|
||||
using Managing.Core;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Domain.Candles;
|
||||
|
||||
public static class CandleExtensions
|
||||
public static class CandleHelpers
|
||||
{
|
||||
|
||||
public static Candle SetupClosingCandle(this Candle candle)
|
||||
{
|
||||
|
||||
return candle;
|
||||
}
|
||||
|
||||
public static DateTime GetBotPreloadSinceFromTimeframe(Timeframe timeframe)
|
||||
{
|
||||
return timeframe switch
|
||||
@@ -96,4 +90,15 @@ public static class CandleExtensions
|
||||
_ => throw new NotImplementedException()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCandleStoreGrainKey(TradingExchanges exchange, Ticker ticker, Timeframe timeframe)
|
||||
{
|
||||
return string.Join("-", exchange, ticker, timeframe);
|
||||
}
|
||||
|
||||
public static (TradingExchanges exchange, Ticker ticker, Timeframe timeframe) ParseCandleStoreGrainKey(string grainKey)
|
||||
{
|
||||
var components = grainKey.Split('-');
|
||||
return (MiscExtensions.ParseEnum<TradingExchanges>(components[0]), MiscExtensions.ParseEnum<Ticker>(components[1]), MiscExtensions.ParseEnum<Timeframe>(components[2]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user