Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
|
Donovan2580,
one idea that might work for you would include storing the net profit of your strategy on a date change in a variable and then comparing the current net profit against this variable.
Once the different is greater than your target, set a boolean flag to true and use this flag's value to exit any open positions and also to prevent new entries from being taken. Just keep in mind to set the boolean flag to false on a date change, too - otherwise your strategy wouldn't trade anymore after a profit exit.
Regards,
ABCTG
|