It’s doing exactly what you tell it to do. Since your trigger is High[0] > vah
or Low[0] < val
then every time it goes over or under it’ll trigger. You’ll need to consider additional filtering based on your definition of conviction. If you want to get more fancy, you can create your own machine learning model and let it tell you the most important features you have for your strategy. For example, what I like to do is this. I have a strategy that have a bunch of calculations to produce some metrics I want. I run the strategy in the strategy analyzer for x amount of historical data. The strategy only does the calculations for each bar in that historical range, so it doesn’t actually enter trades. It saves every bar into a local SQLite database. I then can use those saved data in a machine learning model that I create and have it trained on the data itself. It then lets me know what were the top features it used to make it’s decision. This is an example. Now, I can use those features for the strategy itself or just rely on the trained model for decisions.
Top 10 features for strong trend:
Close_lag0: 5977.6006
TrendStrength_lag0: 2713.8914
ReturnOnVolatility_lag0: 2162.0530
IsHigherHigh_lag1: 1105.6960
LogReturnClose_lag0: 959.9912
AtrZScore_lag1: 257.2226
DeltaRocStd_lag2: 232.4423
CloseRocStd_lag6: 219.6402
MaxDelta_lag2: 205.5814
PocZScore_lag3: 195.5316
I just thought about your far too many trades comment. Initially, I thought that it was just entering normally every time it hit. So, maybe 10 within a few minutes. Then I thought more about it and maybe your far too many trades is entering 1000 times within a few minutes. If that’s the case, what you need to do is keep track of the entry bar. You need to put a guard in so that it doesn’t enter again within the same entry bar. You can use whatever guard you want, but I usually just keep track of the entry and exit bars and don’t allow re-entries within the both bars.