Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Removing auto stop and Re-entry
Collapse
X
-
Hello Gerardc1,
Thank you for your post.
You would need to code your strategy logic to prevent further trades until your stop or target has been hit.
You can check the MarketPosition of your strategy. For example,
Code:if (<conditions for long entry> && Position.MarketPosition == MarketPosition.Flat) { EnterLong(1, "long"); SetStopLoss(CalculationMode. ...); SetProfitTarget(CalculationMode ...); }
Please let us know if you have any further questions.
-
Hello,
Thank you for your post.
Was this strategy created or edited by an AI tool?
Remove lines 31 and 32 from the using statements. As the compile error implies, 'Strategy' and 'StrategyAnalyzer' do not exist in the NinjaTrader.NinjaScript namespace.
In the future, use the NinjaScript Wizard to begin creating your scripts. It will automatically create the correct and necessary skeleton code for your script
Comment
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
134 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
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment