Advertisement
den4ik2003

Untitled

Nov 14th, 2024
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. i = ind_ratio[0]
  2. deltalog_vs_sell = []
  3. without_buy = 0
  4. metric_log = []
  5.  
  6. while (i < len(ind_ratio) - 1):
  7. j = ind_ratio[i] + 1
  8. buy, sell = 0, 0
  9. buy_amount, sell_amount = 0, 0
  10. while (j < ind_ratio[i + 1]):
  11. if 'INFO' in logs[j]:
  12. if 'BUY' in logs[j]:
  13. buy += 1
  14. buy_amount += float(logs[j].split(' ')[8][:-1])
  15. elif 'SELL' in logs[j]:
  16. sell += 1
  17. sell_amount += float(logs[j].split(' ')[8][:-1])
  18. j += 1
  19.  
  20. if buy == 0:
  21. without_buy += 1
  22.  
  23. log_ratio = logs[ind_ratio[i]].split(' ')[7].strip('\n')
  24. pressure = sell_amount - buy_amount
  25. metric_log.append(log_ratio)
  26. # print('delta log =', delta_log)
  27. # print('buy =', buy, 'buy_amount =', buy_amount)
  28. # print('sell =', sell, 'sell_amount = ', sell_amount)
  29. # print('sell - buy =', pressure)
  30. # print()
  31. deltalog_vs_sell.append([delta_log, buy]) # delta log увеличился -> sell_amount увеличился
  32. i += 1
  33.  
  34. without_buy / len(ind_ratio)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement