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 kinfxhk, 07-14-2026, 09:39 AM
|
0 responses
10 views
0 likes
|
Last Post
by kinfxhk
07-14-2026, 09:39 AM
|
||
|
Started by kinfxhk, 07-13-2026, 10:18 AM
|
0 responses
59 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 10:18 AM
|
||
|
Started by kinfxhk, 07-13-2026, 09:50 AM
|
0 responses
41 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 09:50 AM
|
||
|
Started by kinfxhk, 07-13-2026, 07:21 AM
|
0 responses
47 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 07:21 AM
|
||
|
Started by kinfxhk, 07-11-2026, 02:11 AM
|
0 responses
38 views
0 likes
|
Last Post
by kinfxhk
07-11-2026, 02:11 AM
|

Comment