Skip to content

Commit ff8babc

Browse files
vsleejjxtra
authored andcommitted
HitBTC: fix 1 month candle conversion (#505)
- allow the input of the seconds equivalent of 28, 30, 31 days - also keep the value for 49 days for backwards compatibility
1 parent 2f6e293 commit ff8babc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ExchangeSharp/API/Exchanges/Hitbtc/ExchangeHitbtcAPI.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ public override string PeriodSecondsToString(int seconds)
4949
case 14400: return "H4";
5050
case 86400: return "D1";
5151
case 604800: return "D7";
52-
case 4233600: return "1M";
53-
default: throw new ArgumentException($"{nameof(seconds)} must be 60, 180, 300, 900, 1800, 3600, 14400, 86400, 604800, 4233600");
52+
case 2419200: return "1M"; // 28 days
53+
case 2592000: return "1M"; // 30 days
54+
case 2678000: return "1M"; // 31 days
55+
case 4233600: return "1M"; // 49 days
56+
default: throw new ArgumentException(
57+
$"{nameof(seconds)} must be 60, 180, 300, 900, 1800, 3600, 14400, 86400, 604800, 2419200, 2592000, 2678000, 4233600");
5458
}
5559
}
5660

0 commit comments

Comments
 (0)