Any ideas?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
MarketPosition.Flat with long or short position open
Collapse
X
-
MarketPosition.Flat with long or short position open
Hi! My Strategy uses "Position.MarketPosition == MarketPosition.Flat" to check the position status as a primary means of activating or deactivating different stages in its progression. Unfortunately, after the Strategy opens a position (either long or short) it inaccurately returns "MarketPosition.Flat", which somewhat disrupts the rest of its job. Interestingly, it didn't (and doesn't still - just checked) do this when I was testing it in a Playback connection; but it does it without fail in both Simulation and Live modes.
Any ideas?1 PhotoTags: None
-
Hello Borogove,
Are you waiting for at least 1 OnBarUpdate event before printing the position? If you are printing that right after submitting the order then that would be the reason, you have to wait at least 1 OnBarUpdate event for the position to change, it won't change immediately after submitting an order.
- Likes 1
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
80 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment