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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X