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 argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment