You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running a Backtest with BarSeriesManager a amount is provided and used as the quantity of each trade.
When running a VersusEnterAndHoldCriterion it always uses 1 as the amount (or quantity) for the buy and sell trade.
If comparing with a non-percentage criterion it will be a non-useful comparison.
Lets see an example:
Run a backtest with BarSeriesManager with amount 10 (quantity).
Then run a new VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecord)
and it will produce a value 10 times greater than it actually is, due to not creating the "enter and hold" with same amount (quantity).
To Reproduce
Steps to reproduce the behavior:
Run a backtest with BarSeriesManager and use amount=10 and assign result to variable tradingRecordTen
Run a new backtest with BarSeriesManager and use amount=1 and assign result to variable tradingRecordOne
Run new VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecordTen) and compare result when you run new VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecordOne).
Be amazed that the higher quantity used, the better you are than Buy and Hold
Expected behavior
Expect that VersusEnterAndHoldCriterion comparison should give same result no matter what amount is used per trade, since I expect enter and hold always uses same amount as its compared to.
The text was updated successfully, but these errors were encountered:
I have checked existing issues and wiki
Describe the bug
When running a Backtest with
BarSeriesManager
aamount
is provided and used as the quantity of each trade.When running a
VersusEnterAndHoldCriterion
it always uses 1 as theamount
(or quantity) for the buy and sell trade.If comparing with a non-percentage criterion it will be a non-useful comparison.
Lets see an example:
Run a backtest with
BarSeriesManager
withamount
10 (quantity).Then run a
new VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecord)
and it will produce a value 10 times greater than it actually is, due to not creating the "enter and hold" with same
amount
(quantity).To Reproduce
Steps to reproduce the behavior:
BarSeriesManager
and useamount=10
and assign result to variabletradingRecordTen
BarSeriesManager
and useamount=1
and assign result to variabletradingRecordOne
new VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecordTen)
and compare result when you runnew VersusEnterAndHoldCriterion(new ProfitLossCriterion()).calculate(barSeries, tradingRecordOne)
.Expected behavior
Expect that
VersusEnterAndHoldCriterion
comparison should give same result no matter whatamount
is used per trade, since I expect enter and hold always uses sameamount
as its compared to.The text was updated successfully, but these errors were encountered: