Update interval from timeframe
This commit is contained in:
@@ -32,14 +32,18 @@ public static class CandleExtensions
|
|||||||
|
|
||||||
public static int GetIntervalFromTimeframe(Timeframe timeframe)
|
public static int GetIntervalFromTimeframe(Timeframe timeframe)
|
||||||
{
|
{
|
||||||
return timeframe switch
|
var seconds = timeframe switch
|
||||||
{
|
{
|
||||||
Timeframe.OneDay => 3600000, // 1h
|
Timeframe.OneDay => 86400,
|
||||||
Timeframe.FiveMinutes => 120000, // 2min
|
Timeframe.FourHour => 14400,
|
||||||
Timeframe.FifteenMinutes => 60000, // 1 min
|
Timeframe.OneHour => 3600,
|
||||||
Timeframe.OneHour => 900000, // 15min
|
Timeframe.ThirtyMinutes => 1800,
|
||||||
_ => 300000, // 5min
|
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)
|
public static int GetUnixInterval(this Timeframe timeframe)
|
||||||
|
|||||||
Reference in New Issue
Block a user