Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

is there a way to refresh PositionAccount?

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

    is there a way to refresh PositionAccount?

    hi experts, need your help in this.

    [Scenario 1:]
    I started my strategy, then 1 place a long trade manually via chart-trader. When my strategy checks for PositionAccount.MarketPosition, it returns MarketPosition.Flat

    [Scenario 2:]
    I place a long trade manually via chart-trader, then i start my strategy. When my strategy checks for PositionAccount.MarketPosition, it returns MarketPosition.Long

    It seems like in Scenario 1, the PositionAccount.MarketPosition doesn't get refreshed. Is there anyway I can trigger a refresh ?

    #2
    Hello elirion,

    The PositionAccount is updated when the account position updates. There is not a way to change the position through code other than an order execution changing the position.

    It might an issue of when you are printing the PositionAccount.MarketPosition.

    Below is a link to a video demonstrating.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Wow thanks a million!

      i move the check into OnBarUpdate() and it gets updated now

      Comment

      Latest Posts

      Collapse

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