Topic: Filter Your Strategy Collections by Stop Loss (Free Script)
Hi fellow traders!
Because this is currently not possible in EA Studio, I've created a simple Python/PowerShell script that automatically filters your strategy collections based on the maximum stop loss you want.
Here's what it does:
- Processes all JSON strategy collections in your current directory
- Creates new filtered versions with "-SL-XX-Pips" in the filename
- Keeps only strategies with stop losses below your specified maximum
- Shows you exactly how many strategies were filtered out
- Super fast and reliable (I use it myself all the time)
Using it is super simple:
1. Download the script (attached below)
2. Open it in any text editor
3. Change the MAX_STOP_LOSS value at the top (default is 65 pips)
4. Put the script in the folder with your JSON strategy files
5. Run it with Python
For example, if you want to keep only strategies with stop losses up to 50 pips, just change this line at the top:
Python:
MAX_STOP_LOSS = 50 # Change this to whatever you want
PowerShell:
[double]$MAX_STOP_LOSS = 50
The script will create new files with names like "MyStrategies-SL-50-Pips.json" containing only the strategies that meet your criteria. The original files stay untouched.
Hope this helps some of you streamline your strategy management! Let me know if you have any questions or suggestions for improvements.
Happy trading!
Cheers,
Lorenz
Python version: