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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
62 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment