Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Profit target reached, how to stop strategy?
Collapse
X
-
Profit target reached, how to stop strategy?
I am running a simple automated system on the eminis with a single indicator, built with the Strategy Wizard. My question concerns profit targets. My goal is for the system to reach a given profit target and then to stop trading for the day once it has been reached even if the original entry condition is still true on the following bars. My problem is that I can't get it to stop entering trades even after the target is reached. I have tried to correct this using "realized PnL" (i.e. don't enter if the PnL for the day has hit $700) but it doesn't backtest properly with the Strategy Optimizer. Is there any other way to accomplish this or am I using "realized PnL" incorrectly?Tags: None
-
I can't think of an approach in the wizard that could be done easily. Of course this can be done programattically.
Here is a reference sample for this - http://www.ninjatrader-support.com/v...ead.php?t=4084RayNinjaTrader Customer Service
-
Thanks, I've output the code from the Strategy Wizard and added your suggested lines. However, when I go to compile, I'm getting CSO103 errors for "priorTradesCumProfit" and "priorTradesCount":
"The name "priorTradesCount" does not exist in the current context."
Any suggestions (admittedly I don't know much about this area, my first foray out of the safety of the Wizard)? Thanks very much.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bmartz, 03-12-2024, 06:12 AM
|
4 responses
31 views
0 likes
|
Last Post
by bmartz
Today, 08:02 AM
|
||
Started by Aviram Y, Today, 05:29 AM
|
4 responses
12 views
0 likes
|
Last Post
by Aviram Y
Today, 07:57 AM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
3 responses
28 views
0 likes
|
Last Post Today, 07:41 AM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by cls71, Today, 04:45 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:25 AM |
Comment