Skip to content

Commit 0f1cd06

Browse files
committed
Merge branch 'develop'
2 parents b937798 + 740d526 commit 0f1cd06

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ experiments/testing_ppo_sinusoid.py
3737
- [Introduction to FinRock package](https://youtu.be/xU_YJB7vilA)
3838
- [Complete Trading Simulation Backbone](https://youtu.be/1z5geob8Yho)
3939
- [Training RL agent on Sinusoid data](https://youtu.be/JkA4BuYvWyE)
40-
- [Training RL agent on Sinusoid data and indiciators](https://youtu.be/...)
40+
- [Included metrics and indicators into environment](https://youtu.be/bGpBEnKzIdo)
4141

4242
# TODO:
4343
- [ ] Train model on `continuous` actions (control allocation percentage)

Tutorials/04_Indicators_and_Metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</p>
77

88
### Link to YouTube video:
9-
https://youtu.be/...
9+
https://youtu.be/bGpBEnKzIdo
1010

1111
### Link to tutorial code:
1212
https://github.com/pythonlessons/FinRock/tree/0.4.0

finrock/data_feeder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from finrock.state import State
33
from finrock.indicators import Indicator
44

5+
56
class PdDataFeeder:
67
def __init__(
78
self,

finrock/indicators.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,6 @@ def compute(self):
214214
rs = ema_up / ema_down
215215
self._data['RSI'] = 100 - (100 / (1 + rs))
216216

217-
def default_render_options(self):
218-
return {name: RenderOptions(
219-
name=name,
220-
color=(100, 100, 255),
221-
window_type=WindowType.MAIN,
222-
render_type=RenderType.DOT,
223-
min=self.min,
224-
max=self.max
225-
) for name in self._names}
226-
227217
def default_render_options(self):
228218
custom_options = {
229219
"RSI0": 0,

finrock/metrics.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ def reset(self, prev_state: State=None):
8585

8686

8787
class MaxDrawdown(Metric):
88+
""" The Maximum Drawdown (MDD) is a measure of the largest peak-to-trough decline in the
89+
value of a portfolio or investment during a specific period
90+
91+
The Maximum Drawdown Ratio represents the proportion of the peak value that was lost during
92+
the largest decline. It is a measure of the risk associated with a particular investment or
93+
portfolio. Investors and fund managers use the Maximum Drawdown and its ratio to assess the
94+
historical downside risk and potential losses that could be incurred.
95+
"""
8896
def __init__(self, name: str="max_drawdown") -> None:
8997
super().__init__(name=name)
9098

@@ -112,6 +120,13 @@ def reset(self, prev_state: State=None):
112120

113121

114122
class SharpeRatio(Metric):
123+
""" The Sharpe Ratio, is a measure of the risk-adjusted performance of an investment or a portfolio.
124+
It helps investors evaluate the return of an investment relative to its risk.
125+
126+
A higher Sharpe Ratio indicates a better risk-adjusted performance. Investors and portfolio managers
127+
often use the Sharpe Ratio to compare the risk-adjusted returns of different investments or portfolios.
128+
It allows them to assess whether the additional return earned by taking on additional risk is justified.
129+
"""
115130
def __init__(self, ratio_days=365.25, name: str='sharpe_ratio'):
116131
self.ratio_days = ratio_days
117132
super().__init__(name=name)

0 commit comments

Comments
 (0)