Skip to content

Time interval GetCandlesAsynch not working correct #502

Open

Description

@Speed1972

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.

GetCandlesAsync(string marketSymbol, int periodSeconds, DateTime? startDate = null, DateTime? endDate = null, int? limit = null);

Activity

  1. vslee commented on Dec 3, 2019

    @vslee
    Collaborator

    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.

  2. Speed1972 commented on Dec 5, 2019

    @Speed1972
    Author

    Can you explane yourself a bit more?

  3. vslee commented on Dec 5, 2019

    @vslee
    Collaborator

    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.

  4. Speed1972 commented on Dec 6, 2019

    @Speed1972
    Author

    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

  5. vslee commented on Dec 6, 2019

    @vslee
    Collaborator

    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.

  6. vslee commented on Dec 15, 2019

    @vslee
    Collaborator

    @Speed1972, #504 is an example of how to send us the fix if you don't know how to send a pull request.

  7. PeetCrypto commented on Jan 8, 2020

    @PeetCrypto

    @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:
    image

    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?

  8. vslee commented on Jan 20, 2020

    @vslee
    Collaborator

    @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

    • 1m
    • 3m
    • 5m
    • 15m
    • 30m
    • 1h
    • 2h
    • 4h
    • 6h
    • 8h
    • 12h
    • 1d
    • 3d
    • 1w
    • 1M

    If you can update the code you pasted above with these new values, then I will handle the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions