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 NullPointStrategies, Today, 05:17 AM
|
0 responses
42 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment