This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import colors | ||
|
||
def plot(bot_profit): | ||
bot_profit = np.array(bot_profit) | ||
indicies = np.arange(0, bot_profit.shape[0]) * 5 | ||
plt.plot(indicies, bot_profit, color='lightcoral') | ||
plt.plot(indicies, bot_profit, color=colors.upper()) | ||
|
||
return plt | ||
return plt |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def mainline(): | ||
return 'plum' | ||
|
||
def secondaryline(): | ||
return 'mediumpurple' | ||
|
||
def upper(): | ||
return 'lightcoral' | ||
|
||
def lower(): | ||
return 'darkturquoise' | ||
|
||
def inner(): | ||
return 'grey' |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from algorithms.rsi import algorithm as rsi | ||
import colors | ||
|
||
def plot(prices): | ||
rsi_data = rsi(prices) | ||
rsi_indicies = np.arange(0, rsi_data.shape[0]) | ||
|
||
plt.plot(rsi_indicies, rsi_data, color='plum') | ||
plt.plot(rsi_indicies, rsi_data, color=colors.mainline()) | ||
|
||
# Thresholds | ||
rsi_upper = np.full(rsi_data.shape, 70) | ||
rsi_lower = np.full(rsi_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='lightcoral') | ||
plt.plot(rsi_indicies, rsi_lower, linestyle='dashed', color='darkturquoise') | ||
plt.plot(rsi_indicies, rsi_upper, linestyle='dashed', color=colors.upper()) | ||
plt.plot(rsi_indicies, rsi_lower, linestyle='dashed', color=colors.lower()) | ||
|
||
return plt |