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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
59 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment