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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
30 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment