hi @backtrader thanks for the response.
I'll try and expand and be clearer on some points:
As @ab_trader said, this is what I have found when using Backtrader-
you can be either in a LONG or SHORT position or FLAT (no position).
That's not because you are using Backtrader. That's the reality of life.
However- the root of the question lies in the ability to have each order being independant of each other. i.e
Order are always independent. The problem is that you want to issue orders which undo the actions of other orders
I understand what you are saying here (a SELL order closes a LONG order and vice versa).
However in other platforms a SELL order is a market order independent of a LONG order. This is where hedging comes in- you can have a LONG and SHORT order open at the same time.
Q: Is there any future scope, or any way to modify the current cerebro engine to allow this?
- Allowing each order have its own stop loss/profit target
Orders do not have stop loss/profit target. You can have orders which allow you reach a profit or loss target when you already have an open position. You can use bracket orders and have stop loss/profit target orders be activated if a position is entered.
I am aware the orders do not have stops/profit targets- they are set with respective (separate) stop and limit orders. bracket orders solves this, sorry missed this in documentation, thanks!
- Having the ability to select a specific order from an order book (where multiple orders exist on the same instrument)
Call your broker and ask it if you have can multiple conflicting orders on the same asset and only select and execute those which are of your interest.
many brokers do allow this but more specifically in the spot FX and CFD space. Futures/stockbrokers rare to find due to FIFO rules (in the same account)
But this feature (only for backtesting) is very handy for various types of strategies where the goal would be to deploy across multiple accounts.
- Have multiple strategies trading on the same instrument
i.e Strategy 1 - BUY
i.e Strategy 2 - BUY
i.e Strategy 3 - BUY
i.e Strategy 4 - BUY
That's already built-in from day 1 in backtrader
I hope this makes sense, happy to explain in more detail if necessary.
Most of it doesn't make any sense at all.
Thanks again, look forward to your reply.