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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X