Skip to content

Commit

Permalink
re added that sr_fib and rr_ratio parameters in backtest
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmarkacala committed Aug 1, 2021
1 parent 99ecf32 commit cf72e30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/fastquant/backtest/backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def backtest(
plot=True,
fractional=False,
rr_ratio=None,
sr_fib=None,
verbose=1,
sort_by="rnorm",
sentiments=[],
Expand Down Expand Up @@ -151,7 +152,8 @@ def backtest(
symbol=symbol,
allow_short=allow_short,
fractional=fractional,
# rr_ratio=rr_ratio,
rr_ratio=rr_ratio,
sr_fib=sr_fib,
short_max=short_max,
**params,
)
Expand All @@ -176,7 +178,8 @@ def backtest(
channel=channel,
symbol=symbol,
fractional=fractional,
# rr_ratio=rr_ratio,
rr_ratio=rr_ratio,
sr_fib=sr_fib,
allow_short=allow_short,
short_max=short_max,
**kwargs,
Expand Down
4 changes: 3 additions & 1 deletion python/fastquant/strategies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class BaseStrategy(bt.Strategy):
("init_cash", INIT_CASH),
("buy_prop", BUY_PROP),
("sell_prop", SELL_PROP),
("fractional", False),
("fractional", False),
("rr_ratio", None),
("sr_fib", None),
("commission", COMMISSION_PER_TRANSACTION),
("stop_loss", 0), # Zero means no stop loss
("stop_trail", 0), # Zero means no stop loss
Expand Down

0 comments on commit cf72e30

Please sign in to comment.