Update interval from timeframe

This commit is contained in:
2025-04-30 19:34:20 +07:00
parent 7bbf4dd001
commit 262d205d25

View File

@@ -32,14 +32,18 @@ public static class CandleExtensions
public static int GetIntervalFromTimeframe(Timeframe timeframe)
{
return timeframe switch
var seconds = timeframe switch
{
Timeframe.OneDay => 3600000, // 1h
Timeframe.FiveMinutes => 120000, // 2min
Timeframe.FifteenMinutes => 60000, // 1 min
Timeframe.OneHour => 900000, // 15min
_ => 300000, // 5min
Timeframe.OneDay => 86400,
Timeframe.FourHour => 14400,
Timeframe.OneHour => 3600,
Timeframe.ThirtyMinutes => 1800,
Timeframe.FifteenMinutes => 900,
Timeframe.FiveMinutes => 300,
_ => 300,
};
// Run every 1/5th of the candle duration
return seconds / 5 * 1000; // milliseconds
}
public static int GetUnixInterval(this Timeframe timeframe)