Hedge Mode #5
Replies: 1 comment
-
Hi Markus, nice to meet you. To simplify the system and allow for easy backtesting, consider one order at a time. This has strong limitations with complex strategies, like those based on multiple orders (f.e. simultaneous buy and sell or multi-level), but helps a lot in understanding and using a basic strategy. Combining different strategies is indeed the right way, but it forces you to merge the results at the end to get the complete picture. But which in the end is not exactly handy. In my case, I use this framework to train neural networks and learning agents, which align well with this backtesting approach. If you think you need a multi-order strategy (opening/managing multiple orders at once), we could evolve run-strategy.ts. However, we need to understand how the orders will behave and whether it makes sense to execute the sell orders using order IDs for convenience. This approach would allow us to close various positions and provide the developer with more flexibility. Anyway, it's very interesting ... 🤔 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Davide,
first of all, I am really liking your efforts on this project, using it for a couple of days now. Many thanks.
I ran into a problem, when trying to hedge. So I got this error
Cannot define a take profit if in a long and a short
running the strategy, while having longs and shorts in the same time. I assume its to how positions are handled internally, they seem to be represented as a single position, so this makes it easier for statistics at the end. Any idea how to workaround this other than running 2 different strategies and then merging the results programmaticaly?Best
Markus
Beta Was this translation helpful? Give feedback.
All reactions