If I create a strategy for example, one that places a trade when on MA is above of the other, the problem is that, once it reaches the target, is continues to place orders as long as the MA is above. Is it there a way, in the strategy builder to limit this to a certain number of trades? I do not want a cross over, would be one MA on top of another. Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Help with NT Strategy builder
Collapse
X
-
Help with NT Strategy builder
Hello,
If I create a strategy for example, one that places a trade when on MA is above of the other, the problem is that, once it reaches the target, is continues to place orders as long as the MA is above. Is it there a way, in the strategy builder to limit this to a certain number of trades? I do not want a cross over, would be one MA on top of another. Thanks!Tags: None
-
Hi mestril, thanks for your note.
You can use the MarketPosition object under the Strategy folder and only perform the action when flat.
e.g.: https://clauber.tinytake.com/tt/Mzk0NjMwNV8xMjEwOTQ2Nw
-
This does not work, unless I am not doing it right.Originally posted by NinjaTrader_ChrisL View PostHi mestril, thanks for your note.
You can use the MarketPosition object under the Strategy folder and only perform the action when flat.
e.g.: https://clauber.tinytake.com/tt/Mzk0NjMwNV8xMjEwOTQ2Nw
Comment
-
How do I get to the EntriesPerDirection option in strategy builder. I do not see it in the Conditions.Originally posted by NinjaTrader_ChrisL View PostHi mestril, thanks for your reply.
If your EntriesPerDirection is set to 1 then you should not get any further entries if you are already long. I can test your script if you export it and post it (Tools>Export>NinjaScript)
Comment
-
-
Here is the script. Let me know.Originally posted by mestril View Post
It is set to 1, but still places more than one. I will post the script.
Thanks
Attached Files
Comment
-
Hello,Originally posted by NinjaTrader_ChrisL View PostHi mestril, thanks for posting that. I'm not getting the same problem, the script submits only 1 order at a time. Please confirm you have the strategy set up in the same way I do:
https://clauber.tinytake.com/tt/Mzk0NjczMl8xMjExMDU4MQ
I do have it the same way, however I think we are not talking about the same issue. The strategy places one order at a time, yes, however, once that position is closed, and a new candle opens, it will place another one and then another. I want the strategy to place just one order per signal and not every time a candle opens. Does that make sense? Thanks a lot!
Comment
-
How does this help?Originally posted by NinjaTrader_ChrisL View PostHi mestril, thank you I understand now.
The builder has a bars since entry and bars since exit in the Misc folder. You can limit when the next trade takes place using these properties.
I need one trade per signal, now, it is placing a trade once is closed, and placing another one, resulting on several trades per signal. My question is, is it there anything I can do to make this happen? just one trade per signal!
Thanks
Comment
-
Hello mestril,
Thanks for your reply.
You could create a single bool variable that you use to control the trades to one per direction. For example in your entry conditions for a long set you would check to see if the bool is true and in the short entry you would check to see if it is false. In the action of the long set, besides placing the order you would change the bool to false which means no more long trade. Once false, if your other short entry conditions occurs the short order would be placed and you would then set the bool to true.
Written out it would look something like (I called the bool FlipFlop):
if (your long conditions are true and FlipFlop equals True)
{
place long order here
set FlipFlop equal to False // prevent further longs until a short has been taken
}
if (your short conditions are true and FlipFlop equals False)
{
place short order here
set FlipFlop equal to True // prevent further shorts until a long has been taken
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment