Skip to content

Instantly share code, notes, and snippets.

View cryptocodein's full-sized avatar

cryptocodein

  • Joined Sep 6, 2025
View GitHub Profile
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
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"):