I saw a code somewhere here… and unfortunately I can’t find it anymore. It’s about the following: If my strategy makes a loss of, say, 1% during the day, the strategy should stop working for that day and only start working again the next day. Optionally, the strategy should pause for that day if it has a following number of losing trades. Both individually or combined. Can someone help me please?
Hi Phoentzs
You can use this, but keep in mind that it works like everything at close, so if by any chance you have a loss of 0.95% it does not freeze, but make another trade and if the next one loses 2% on the day you have lost 2.90%.
Here is a version which robertogozzi kindly wrote which works on a monthly basis, and can be adapted to run on a daily basis. It currently runs on notional value of loss;