Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketPosition.Flat with long or short position open

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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.

    Comment


      #3
      Ah! Thank you very much! You are absolutely right! I guess this means something else about my code is bollucksed up, but at least I'm not haring off in the wrong direction any more!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      42 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X