Hi,
First of thank you for all the help i’ve gotten from the forum throughout my coding with PRT!
I have several strategies running in the same instrument; with different timeframes and logic. My problem is when they all open positions at or around the same time – my total positon count is to high for my preference.
My question: is there a way for one strategy to know if there are any open positions in the instrument belonging to another strategy, and preferably count them? or any other way to limit the amount of contracts or positions in the instrument at the same time?
Thank you for your answer(s),
Rasmus
Strategies are completely independent of each other so the answer is that there is no way for one strategy to know how many positions another one has open.
The link does not work for me Roberto.
Maybe this one will?
Allow only one strategy to execute a trade
I’d forgotten that thread – I seem to recall us discussing this somewhere before and the only down side to your code was that you would need to list the strategies in some sort of order of priority from best to worst as strategy 1 is given first opportunity to have its conditions met and if they are then strategies 2 and 3 and so on are ignored.
Links don’t work for me either. You have to select them, then copy the selction to the clipborad and paste it in the browser.
As for my post… yes, you need to assign them a priority, in case more than one starategy has conditions met. But if you have 6 strategy and want at most 2 of them open trades at the same time you just have to allow multiple trades (via DEFPARAM CUMULATERORDERS=TRUE) then count trades and only stop when the maximum is reached.
Thank you for your answers Robert and Vonasi!
Guess all strategies in one code is the solution ATM.