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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      160 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      81 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      125 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      206 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      184 views
      0 likes
      Last Post CarlTrading  
      Working...
      X