Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
continual trade but stop when and if a stop limit order happens
Collapse
X
-
continual trade but stop when and if a stop limit order happens
i have in my strategy a AllowEntry bool so a trade doesn't keep happening after it reaches profit target (or, stop loss) in the same bar. But, I'd like it to keep trading actually. i found it useful when i was profitable on large candle movements. but, horrible on stop losses if it was a big candle movement in the wrong direction and kept entering and the would get another stop loss. is there a way to have a bool that okays the trade to keep happening if its profitable but doesn't if its not (that includes my profit trigger / profit captures partially to desired profit acquisition)?Tags: None
-
Hello SteveReiza,
Thanks for your post.
The SystemPerformance collection could be used to get the performance of the last trade made. If the last trade made has a negative ProfitCurrency value then you could set the bool to true to stop trades from being placed.
If the last trade made has a positive ProfitCurrency value and the price is moving in your favor then you could keep the bool set to false and trades would continue to be placed.
For example, you your last trade was long, you could detect if the price is moving in your favor by checking if the current Close price (Close[0]) is greater than the previous Close price (Close[1]).
See the help guide documentation for more information and sample code.
SystemPerformance: https://ninjatrader.com/support/help...erformance.htm
TradeCollection: https://ninjatrader.com/support/help...collection.htm
Trade: https://ninjatrader.com/support/help.../nt8/trade.htm
TradesPerformance: https://ninjatrader.com/support/help...erformance.htm
TradesPerformanceValues: https://ninjatrader.com/support/help...ancevalues.htm<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
88 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
135 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment