Skip to content

Instantly share code, notes, and snippets.

View arevalirio's full-sized avatar

Alirio Arevalo arevalirio

  • EPA
  • Valencia, Venezuela
View GitHub Profile
@arevalirio
arevalirio / kalman.py
Created November 1, 2025 13:37 — forked from manicai/kalman.py
Simple example of 1 dimensional Kalman filtering in Python
from random import normalvariate
##########################################################################
# "Real world" that we're trying to track
class RealWorld:
def __init__(self):
self.position = 0.0
self.velocity = 0.5
self.time_step = 0.1
self.time = 0.0
@arevalirio
arevalirio / file.py
Created July 23, 2024 00:14 — forked from jericbas/file.py
Chandelier Exit in Python
def avg_true_range(self, df):
ind = range(0,len(df))
indexlist = list(ind)
df.index = indexlist
for index, row in df.iterrows():
if index != 0:
tr1 = row["High"] - row["Low"]
tr2 = abs(row["High"] - df.iloc[index-1]["Close"])
tr3 = abs(row["Low"] - df.iloc[index-1]["Close"])