Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
add price plot
Browse files Browse the repository at this point in the history
update rsi variable names
  • Loading branch information
CelestialCrafter committed Oct 25, 2023
1 parent 6dcf42a commit 70a3cdb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions plots/price.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import numpy as np
import matplotlib.pyplot as plt
import plots.colors as colors

def plot(prices):
indicies = np.arange(0, prices.shape[0])
plt.plot(indicies, prices, color=colors.mainline())

return plt
16 changes: 8 additions & 8 deletions plots/rsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import plots.colors as colors

def plot(prices):
rsi_data = rsi(prices)
rsi_indicies = np.arange(0, rsi_data.shape[0])
data = rsi(prices)
indicies = np.arange(0, data.shape[0])

plt.plot(rsi_indicies, rsi_data, color=colors.mainline())
plt.plot(indicies, data, color=colors.mainline())

# Thresholds
rsi_upper = np.full(rsi_data.shape, 70)
rsi_lower = np.full(rsi_data.shape, 30)
upper = np.full(data.shape, 70)
lower = np.full(data.shape, 30)

plt.fill_between(rsi_indicies, rsi_upper, rsi_lower, color='grey', alpha=0.3)
plt.plot(rsi_indicies, rsi_upper, linestyle='dashed', color=colors.upper())
plt.plot(rsi_indicies, rsi_lower, linestyle='dashed', color=colors.lower())
plt.fill_between(indicies, upper, lower, color='grey', alpha=0.3)
plt.plot(indicies, upper, linestyle='dashed', color=colors.upper())
plt.plot(indicies, lower, linestyle='dashed', color=colors.lower())

return plt

0 comments on commit 70a3cdb

Please sign in to comment.