Skip to content

Commit

Permalink
user custom user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarq committed May 24, 2017
1 parent 8703f3e commit 1d55b7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 4 additions & 6 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ def get_ticker_dataframe(pair):
"""
minimum_date = arrow.now() - timedelta(hours=2)
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 = {
'marketName': pair.replace('_', '-'),
'tickInterval': 'OneMin',
'_': minimum_date.timestamp * 1000
}
data = requests.get(url, params).json()
data = requests.get(url, params=params, headers=headers).json()
if not data['success']:
raise RuntimeError('BITTREX: {}'.format(data['message']))

Expand Down Expand Up @@ -57,11 +60,6 @@ def populate_trends(dataframe):
:param dataframe: StockDataFrame
:return: StockDataFrame with populated trends
"""
#dataframe.loc[
# (dataframe['stochrsi'] < 0.20)
# & (dataframe['close_12_ema'] <= dataframe['close_26_ema']),
# 'bullish'
#] = 1
dataframe.loc[
(dataframe['stochrsi'] < 0.20), 'underpriced'
] = 1
Expand Down
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def create_trade(stake_amount: float, exchange):
## Pick random pair and execute trade
#idx = random.randint(0, len(whitelist) - 1)
#pair = whitelist[idx]
pair = None
# Pick pair based on StochRSI buy signals
for p in whitelist:
if get_buy_signal(p):
Expand Down

0 comments on commit 1d55b7d

Please sign in to comment.