I'm looking for a solution how to program (set up) exits from strategy in section Edit NinjaScript-Strategy. I want to exit on the second consecutive bar against position (price candle color change). That means for long position two consecutive red bars and vice versa.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Exit in Strategy without PT (Woodies Exit)
Collapse
X
-
Exit in Strategy without PT (Woodies Exit)
Good Day,
I'm looking for a solution how to program (set up) exits from strategy in section Edit NinjaScript-Strategy. I want to exit on the second consecutive bar against position (price candle color change). That means for long position two consecutive red bars and vice versa. -
Thank you very much for your flawless customer service.
One more question: How to combine your solution with my strategy entries?
Let me describe: To go long enter if CCI 50 crosses above -100 and CCI 14 crosses above 0 line
To exit the position: the second consecutive bar against position (price candle color change).
Please have a look at the attached


Both don't work properly. Entry is carried out on the very second bar after "SET 1 condition" bar and Exit occurs randomly... I don't understand and most likely I loose something in there.
Comment
-
Hello ZdenaVyzila,
Thank you for your response.
I have created a short video detailing this item at the following link: http://screencast.com/t/ZefEU43z
Please let me know if you have any questions.
Comment
-
Hi,
your solution doesn't work for my strategy... Please have a look at the picture below and you see what I mean. Thank you.
Comment
-
-
Great Solution!
But with one tiny problem: Strategy sells one bar after demanded bar to exit...And don't you know how to set entering a position on close instead of open or how to set enters generally? Strategy enters on a bar after one where strategy signalling...have a look at the attached and you'll see what I mean..
Comment
-
Hello ZdenaVyzila,
Thank you for your response.
You will then wish to use the same conditions as Matthew had detailed where Close[0] < Open[1] and Close[1] < Open[2] (see attached screenshot #1).
For the order entries, if you would like to them to enter intra-bar you may wish to use CalculateOnBarClose = false, which can be set by unchecking the CalculateOnBarClose option on the General tab (see attached screenshot #2).
Please let me know if you have any questions.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
662 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
376 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|


Comment