I have certain trades in which I would like to change the exit conditions during the trade according to market conditions. So I have two trading ideas x & y. I enter a trade with idea x and price continues to move in my direction until the entry condition for idea y is triggered. Instead of a new entry I'd like to "blend" idea x into idea y and use idea y's exit conditions. Any suggestions on how that would be accomplished? Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
"blending" trades
Collapse
X
-
"blending" trades
Hello,
I have certain trades in which I would like to change the exit conditions during the trade according to market conditions. So I have two trading ideas x & y. I enter a trade with idea x and price continues to move in my direction until the entry condition for idea y is triggered. Instead of a new entry I'd like to "blend" idea x into idea y and use idea y's exit conditions. Any suggestions on how that would be accomplished? Thanks.Tags: None
-
CaptainAmericaXX,
Thank you for your post.
If I am following you correctly, you should be able to accomplish this by using a different stop strategy with each condition.
Here is some pseudo code to help you get started...
if (MyXCondition)
//doMyXExit
if (MyYCondition)
//doMyYExit
As long as your Y condition is true, it will use the Y exit.MatthewNinjaTrader Product Management
-
So if I understand you correctly your saying that if I'm in x trade and the conditions for y become true, the y trade will not fire and the x trade exit conditions will be automatically disregarded in favor of the y exit?
In my experience both trades will fire independently with the separate exit working as well. If there are unique names for the conditions one exit will not recognize the other.
Comment
-
So I would need to say something like:
if(x trade == true)
Exit conditions
else(x trade == true
&& y conditions == true)
Exit(with y condition)
is this correct?
Comment
-
Assuming you are going long...
Code:// In variables section above Initialize() private bool useYExits = false; // In OnBarUpdate() if (x trade entry conditions == true) EnterLong(); if (Position.MarketPosition == MarketPosition.Long) { if (y entry conditions == true) useYExits = true; if (useYExits == false && x exit conditions == true) ExitLong(); else if (useYExits == true && y exit conditions == true) ExitLong(); } if (Position.MarketPosition == MarketPosition.Flat && useYExits == true) useYExits = false;Josh P.NinjaTrader Customer Service
Comment
-
Sweet!
Thanks Josh and thank you to everyone at NT. A year ago I had absolutely no clue how to program.(I"m still very green) The staff at NT has been a huge help to me. Thanks for everything! I don't know how else to send a "Thank you" card. I know I'll still need a lot of help before my ideas materialize, but I wanted to take a moment and thank you all.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
169 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
328 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
252 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
353 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
181 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment