Hi, Is it possible to input a line of code so that a new trade does not execute if there is already a trade open on the instrument? I am finding in testing on shorter timeframe charts such as 1 minute or 2 minute if stops are set quite wide, trades are not lasting their full course due to new trades executing. Any help would be appreciated. Many thanks.
StefParticipant
Average
defparam cumulateorders=false
or you can test if you have an open position with one of these
if not onmarket and <rest of your conditions>
or...
if not shortonmarket and <rest of your conditions>
or...
if not longonmarket and <rest of your conditions>
Thanks Stef, that’s a great help.