Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Filter for strategy
Collapse
X
-
Filter for strategy
I've created an automated strategy, backtested it, and forward tested it. It runs quite well, but I would like to filter out some of the bad trades. It's a trending system, so it tends to get stopped out when the market is choppy, and a bit volatile. My idea for a filter is, after x number of losing trades, wait for a breakout from this range, and then resume strategy. One idea I had was placing an OCO order. How can I define the range, say from the close of the last winning trade? Any help would be appreciated. Thanks.Tags: None
-
Thanks Bertrand. I've tried to develop some code to work into the strategy based on performance. I decided to that on execution if there were 7 consecutive losing trades, wait for a new high or low breakout.
OnExecution()
if(Performance.AllTrades.TradesPerformance.MaxCons ecLoser < 7)
Next step I will exit current position to be flat.
Then I set some new entry conditions, but this would need to be OnBarUpdate(). I'm not sure how to do this, a subroutine? After the order is executed I would like to revert back to the original strategy. Also not sure how to do this.
Comment
-
You could work with the Performance class in the OnBarUpdate(), too. I suggest you check into this sample here, as it offers ideas for halting and restarting your strategy upon hitting your conditions - http://www.ninjatrader-support2.com/...ead.php?t=4804
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
661 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
375 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
579 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment