Replies: 3 comments
-
So: import pandas as pd
from poloniex import Poloniex
from time import time
polo = Poloniex()
# If you want the 'all time high' for a particular dataset, you will want more than 1 candle (I'm getting 3)
df = pd.DataFrame(polo.returnChartData('USDT_BTC', period=86400, start=time()-polo.DAY*3)) Here is my dataframe of 3 candles:
Here are todays high and the highest of the 3 days: print("Today High : %s" % str(df.iloc[-1]['high']))
# Today High : 4354
print('Largest High in dataframe : %s' % str(df['high'].max()))
# Largest High in dataframe : 4489.20999994 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks its working very well |
Beta Was this translation helpful? Give feedback.
0 replies
-
now = polo.returnTicker()[coin]['last']
btc = polo.returnTicker()["USDT_BTC"]['last']
bid = polo.returnTicker()[coin]['highestBid']
ask = polo.returnTicker()[coin]['lowestAsk']
2017-08-18 21:22 GMT+02:00 s4w3d0ff <notifications@github.com>:
… df.iloc[-1] should give you the last row of the dataframe and
df['high'].max() will give you the largest high within that dataframe.
So:
import pandas as pdfrom poloniex import Poloniexfrom time import time
polo = Poloniex()
# If you want the 'all time high' for a particular dataset, you will want more than 1 candle (I'm getting 3)
df = pd.DataFrame(polo.returnChartData('USDT_BTC', period=86400, start=time()-polo.DAY*3))
Here is my dataframe of 3 candles:
close date high low open \
0 4380.99999999 1502841600 4395.55499999 3926 4146.00000001
1 4262 1502928000 4489.20999994 4180 4380.99999999
2 4030.96000001 1503014400 4354 4028.11 4262.00000001
quoteVolume volume weightedAverage
0 9680.75941664 40427286.664403 4176.04496966
1 10911.64942838 47385213.473242 4342.62608822
2 8224.45277183 34815963.585895 4233.22554725
Here are todays high and the highest of the 3 days:
print("Today High : %s" % str(df.iloc[-1]['high']))# Today High : 4354
print('Largest High in dataframe : %s' % str(df['high'].max()))# Largest High in dataframe : 4489.20999994
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/s4w3d0ff/python-poloniex/issues/156#issuecomment-323439881>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQ4TJuuVegj2XC4bX7JGVakxTDFpwuDPks5sZeR6gaJpZM4O757i>
.
--
Greetings Mantas
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I am trying to get todat high/low price and all times High price how can i do that with ticker ?
I tried this but not working like what i want.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions