Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET /tradingview/history == <Response [404]> แก้อย่างไรครับ #98

Open
piwsook opened this issue Dec 11, 2022 · 0 comments

Comments

@piwsook
Copy link

piwsook commented Dec 11, 2022

    def price_for_moving_average(coin):
        # check server time
        response = requests.get(API_HOST + '/api/servertime')
        ts = int(response.text)
        coin = str(coin + '_THB')
        header = {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
            'X-BTK-APIKEY': API_KEY,
        }
        data = {
            'symbol': str(coin),
            'resolution': '5',
            'from': int(start_time-24*60),
            'to': int(start_time),
            'ts': ts,
        }
        signature = sign(data)
        data['sig'] = signature
        response = requests.get(API_HOST + '/api/tradingview/history', params=coin, headers=header)
        return print(response)

    zzzzzz = price_for_moving_average('BTC')
    print(zzzzzz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant