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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
59 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
143 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment