Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backtest with fixed entry amount like a new BarSeriesManager or Strategy #1131

Open
2 tasks done
Cashmeiser opened this issue Feb 16, 2024 · 0 comments
Open
2 tasks done
Labels
enhancement Issue describing or discussing an enhancement for this library

Comments

@Cashmeiser
Copy link

I have checked existing issues and wiki

The current BarSeriesManager uses amount as the quantity to use of the price on the instrument.
For example if amount is 1 and closePrice $10 then the entry is on $10. and lets say exit becomes at $11. Next entry the price can be $15 and exit $16.
In these backtest I only find the PnL-percentage valuable, but not the PnL it self. Saying the profit is (in the example above) $2 says nothing in the context of a backtest running on an instrument for x years.

I find it more useful with a BarSerierManager that create trades on a specific amount (with or without re-investing) for example; always enter with $1000. Here both the PnL and PnL-percentage will make sense.

I'm about to write a custom FixedPositionSizeBarSeriesManager which takes a Num value (like 1000) for the entry-amount and then reuse the BarSeriesManager-logic except that the amount value sent to the tradeExecutionModel is re-calculated each time by amount / entryValue.

I dont know yet if it will be as expected a FixedPositionSizeBarSeriesManager or a TradeExecutionModel or just a wrapping Streategy

Is there something similar to what I want to achieve that i missed? If not, and I do this implementation, is it interesting to provide to the lib?

@Cashmeiser Cashmeiser added the enhancement Issue describing or discussing an enhancement for this library label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue describing or discussing an enhancement for this library
Projects
None yet
Development

No branches or pull requests

1 participant