This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_atr_rma_from_list(candles: list, length: int) -> float: | |
""" | |
Вычисление ATR по методу RMA Уайлдера из списка строк в формате: timestamp, open, high, low, close, ... | |
""" | |
trs = [] | |
for i in range(1, len(candles)): | |
try: | |
high = float(candles[i][2]) # high | |
low = float(candles[i][3]) # low | |
prev_close = float(candles[i - 1][4]) # previous close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Rectangle | |
# Базовый URL Bybit API | |
BYBIT_BASE = "https://api.bybit.com" | |
symbol = "ETHUSDT" | |
def fetch_100_bars(symbol=symbol, category="linear"): |