user custom user agent
This commit is contained in:
parent
8703f3ebe6
commit
1d55b7d452
10
analyze.py
10
analyze.py
@ -23,12 +23,15 @@ def get_ticker_dataframe(pair):
|
|||||||
"""
|
"""
|
||||||
minimum_date = arrow.now() - timedelta(hours=2)
|
minimum_date = arrow.now() - timedelta(hours=2)
|
||||||
url = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks'
|
url = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks'
|
||||||
|
headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
||||||
|
}
|
||||||
params = {
|
params = {
|
||||||
'marketName': pair.replace('_', '-'),
|
'marketName': pair.replace('_', '-'),
|
||||||
'tickInterval': 'OneMin',
|
'tickInterval': 'OneMin',
|
||||||
'_': minimum_date.timestamp * 1000
|
'_': minimum_date.timestamp * 1000
|
||||||
}
|
}
|
||||||
data = requests.get(url, params).json()
|
data = requests.get(url, params=params, headers=headers).json()
|
||||||
if not data['success']:
|
if not data['success']:
|
||||||
raise RuntimeError('BITTREX: {}'.format(data['message']))
|
raise RuntimeError('BITTREX: {}'.format(data['message']))
|
||||||
|
|
||||||
@ -57,11 +60,6 @@ def populate_trends(dataframe):
|
|||||||
:param dataframe: StockDataFrame
|
:param dataframe: StockDataFrame
|
||||||
:return: StockDataFrame with populated trends
|
:return: StockDataFrame with populated trends
|
||||||
"""
|
"""
|
||||||
#dataframe.loc[
|
|
||||||
# (dataframe['stochrsi'] < 0.20)
|
|
||||||
# & (dataframe['close_12_ema'] <= dataframe['close_26_ema']),
|
|
||||||
# 'bullish'
|
|
||||||
#] = 1
|
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(dataframe['stochrsi'] < 0.20), 'underpriced'
|
(dataframe['stochrsi'] < 0.20), 'underpriced'
|
||||||
] = 1
|
] = 1
|
||||||
|
1
main.py
1
main.py
@ -208,7 +208,6 @@ def create_trade(stake_amount: float, exchange):
|
|||||||
## Pick random pair and execute trade
|
## Pick random pair and execute trade
|
||||||
#idx = random.randint(0, len(whitelist) - 1)
|
#idx = random.randint(0, len(whitelist) - 1)
|
||||||
#pair = whitelist[idx]
|
#pair = whitelist[idx]
|
||||||
pair = None
|
|
||||||
# Pick pair based on StochRSI buy signals
|
# Pick pair based on StochRSI buy signals
|
||||||
for p in whitelist:
|
for p in whitelist:
|
||||||
if get_buy_signal(p):
|
if get_buy_signal(p):
|
||||||
|
Loading…
Reference in New Issue
Block a user