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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
152 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
131 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
127 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment