Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Preventing Strategy from taking a trade in the opposite direction
Collapse
X
-
Hello demo166130,
Thanks for your post.
To be clear you have posted in the NinjaTrader7 strategy development area so my reply will be based on using the NinjaTrader7 strategy wizard. If you are using NinjaTrader8 and the strategy builder, the answer will be relatively the same.
In each set where you have an entry condition, add another condition that specifies the strategy position must be "flat" (so not long or short). In the conditions window, add the condition on the left side expand the strategy selection and select "Current market position", in the center select ==, on the right side select again the strategy selection and select "Flat". What the strategy wizard will show is: Position.MarketPosition == MarketPosition.Flat.
When your strategy is in a position and if the opposite MACD condition occurs, no order can be placed because you are not flat, thus allowing your trade to end naturally on a profit or stop.
Leave a comment:
-
Preventing Strategy from taking a trade in the opposite direction
Hello,
I've got a basic strategy which involves taking trades according to MACD crosses, but I would like the trade to run it's course according to the stop loss and profit targets set, however when the trade moves in the opposite direction and the MACD crosses against the trade direction the builder automatically closes out the position and reverses the direction. How would I use the Strategy Builder to prevent this from happening?
RegardsTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by love2code2trade, 04-17-2024, 01:45 PM
|
4 responses
31 views
0 likes
|
Last Post Yesterday, 10:31 PM | ||
Started by cls71, Today, 04:45 AM
|
2 responses
10 views
0 likes
|
Last Post
by eDanny
Today, 11:11 AM
|
||
Started by proptrade13, Today, 11:06 AM
|
0 responses
4 views
0 likes
|
Last Post
by proptrade13
Today, 11:06 AM
|
||
Started by kulwinder73, Today, 10:31 AM
|
1 response
10 views
0 likes
|
Last Post Today, 11:01 AM | ||
Started by RookieTrader, Today, 09:37 AM
|
3 responses
15 views
0 likes
|
Last Post Today, 10:32 AM |
Leave a comment: