Thx
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
stop trading after 2 consecutive losses
Collapse
X
-
Will this Work?
Ninja Trader,
I have spent several hours yesterday looking at posts and the help files for a way to stop trading after consecutive losses. I found the code below in the help files.
if (Performance.RealtimeTrades.TradePerformance.MaxCo nsecLoser > 2)
return;
Is this enough to stop trading or does it require something else I may have overlooked. It seems so much easier than what I ve seen on the forum todate.
BigMike
Comment
-
For regular NinjaScript strategies you can work with the Performance class correct, a sample into this would be found here - http://www.ninjatrader-support2.com/...ad.php?t=19289
The snippet you posted should work for realtime trading to return out of the OnBarUpdate() after 2 consecutive losing trades.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
3 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
Comment