I am currently running the following hourly charts however on the ProBackTest it enters into a new contract every hour even if it is already in a position.
I want to limit the strategy to being maximum 1 contract long or short at any given time and not continue to accumulate contracts.
My current code is below. Does anyone know how to help with this?
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read. Thank you 🙂
As to your code, it’s impossible that “it enters into a new contract every hour even if it is already in a position“. To accomplish that you should replace line 2 by:
1
DEFPARAMCumulateOrders=True
So, did you already backtest it? How could you spot more than 1 position at a time?
append this line to your code to monitor the number of positions accumulated:
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.