You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Time interval GetCandlesAsynch not working correct #502
Api interval now a days has interval letter added to the time interval string.
Example Binance:
intervalNum describes the amount of the interval. For example, intervalNum 5 with intervalLetter M means "Every 5 minutes".
The Defined GetCandleAsync (in ExchnageAPI) has only the period Seconds without the intervalletter.
Not the prettiest fix, but you could send us a PR which uses a switch on periodSeconds. If it is a valid value, then it would send the appropriate corresponding string (w/ intervalLetter M) to Binance.
If Binance is the exchange you use, then send us an updated version of OnGetCandlesAsync() and possibly CryptoUtility.SecondsToPeriodString(). If you do change CryptoUtility.SecondsToPeriodString(), please make sure you don't break any other exchanges in the process of fixing Binance.
I was supposed to help you with potential problems in the open source code that you wrote.
But you want me to solve those problems too?
Do you also want me to look at another code from you to solve the problems there too?
Or rewrite part of the code?
We welcome code contributions / pull requests. Like you, we do this in our free time. We then share our results with the community for free.
If you're not interested, then we can close this issue. There's no need for you to have attitude or get upset.
@vslee how would you like this isseu to be soulved if i do not know how to code but inderstand what must be changed?
Binance uses Intervaltellers:
Just like the change #504 the secondes must be changed to interval letters. Just like in the code of HitBTC the code must look like:
public override string PeriodSecondsToString(int seconds)
{
switch (seconds)
{
case 60: return "M1";
case 180: return "M3";
case 300: return "M5";
case 900: return "M15";
case 1800: return "M30";
case 3600: return "H1";
case 14400: return "H4";
case 86400: return "D1";
case 604800: return "D7";
case 4233600: return "1M";
default: throw new ArgumentException($"{nameof(seconds)} must be 60, 180, 300, 900, 1800, 3600, 14400, 86400, 604800, 4233600");
}
}
Exact the same way like in the HitBTC code (ExchangeHitbtcAPI.cs) the code must be inster into the binance code. How to do that? Maybe it is a cut/past for you?
Activity
vslee commentedon Dec 3, 2019
Not the prettiest fix, but you could send us a PR which uses a
switchonperiodSeconds. If it is a valid value, then it would send the appropriate corresponding string (w/ intervalLetter M) to Binance.Speed1972 commentedon Dec 5, 2019
Can you explane yourself a bit more?
vslee commentedon Dec 5, 2019
If Binance is the exchange you use, then send us an updated version of
OnGetCandlesAsync()and possiblyCryptoUtility.SecondsToPeriodString(). If you do changeCryptoUtility.SecondsToPeriodString(), please make sure you don't break any other exchanges in the process of fixing Binance.Speed1972 commentedon Dec 6, 2019
I was supposed to help you with potential problems in the open source code that you wrote.
But you want me to solve those problems too?
Do you also want me to look at another code from you to solve the problems there too?
Or rewrite part of the code?
PS. Not only Binance uses Interval Letters
vslee commentedon Dec 6, 2019
We welcome code contributions / pull requests. Like you, we do this in our free time. We then share our results with the community for free.
If you're not interested, then we can close this issue. There's no need for you to have attitude or get upset.
vslee commentedon Dec 15, 2019
@Speed1972, #504 is an example of how to send us the fix if you don't know how to send a pull request.
PeetCrypto commentedon Jan 8, 2020
@vslee how would you like this isseu to be soulved if i do not know how to code but inderstand what must be changed?

Binance uses Intervaltellers:
Just like the change #504 the secondes must be changed to interval letters. Just like in the code of HitBTC the code must look like:
public override string PeriodSecondsToString(int seconds)
{
switch (seconds)
{
case 60: return "M1";
case 180: return "M3";
case 300: return "M5";
case 900: return "M15";
case 1800: return "M30";
case 3600: return "H1";
case 14400: return "H4";
case 86400: return "D1";
case 604800: return "D7";
case 4233600: return "1M";
default: throw new ArgumentException($"{nameof(seconds)} must be 60, 180, 300, 900, 1800, 3600, 14400, 86400, 604800, 4233600");
}
}
Exact the same way like in the HitBTC code (ExchangeHitbtcAPI.cs) the code must be inster into the binance code. How to do that? Maybe it is a cut/past for you?
vslee commentedon Jan 20, 2020
@CryptoP2345
The pasted code only works for HitBTC. In Binance, the allowed parameters are (scroll down to the ENUM definitions):
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
If you can update the code you pasted above with these new values, then I will handle the rest.