Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i = ind_ratio[0]
- deltalog_vs_sell = []
- without_buy = 0
- metric_log = []
- while (i < len(ind_ratio) - 1):
- j = ind_ratio[i] + 1
- buy, sell = 0, 0
- buy_amount, sell_amount = 0, 0
- while (j < ind_ratio[i + 1]):
- if 'INFO' in logs[j]:
- if 'BUY' in logs[j]:
- buy += 1
- buy_amount += float(logs[j].split(' ')[8][:-1])
- elif 'SELL' in logs[j]:
- sell += 1
- sell_amount += float(logs[j].split(' ')[8][:-1])
- j += 1
- if buy == 0:
- without_buy += 1
- log_ratio = logs[ind_ratio[i]].split(' ')[7].strip('\n')
- pressure = sell_amount - buy_amount
- metric_log.append(log_ratio)
- # print('delta log =', delta_log)
- # print('buy =', buy, 'buy_amount =', buy_amount)
- # print('sell =', sell, 'sell_amount = ', sell_amount)
- # print('sell - buy =', pressure)
- # print()
- deltalog_vs_sell.append([delta_log, buy]) # delta log увеличился -> sell_amount увеличился
- i += 1
- without_buy / len(ind_ratio)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement