Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SystemPerformance.AllTrades.count no funciona

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

    SystemPerformance.AllTrades.count no funciona

    Hello,I can't get SystemPerformance.AllTrades.count to display trade values always returns 0, I use it within the OnBarUpdate() but I can't get any value

    #2
    Hello GerardoAC,

    Are you waiting until one bar after the position has changed?

    The position takes time to change. Before the position can even change, it also takes time for an order to be submitted, accepted, become working, execution a fill, and then trigger the account and strategy position to change.

    When the order changes states, this will update OnOrderUpdate().

    When the position changes, this will update OnPositionUpdate().

    The position will not have changed after an order method is called in the same run of OnBarUpdate() as the order does not fill instantaneously and position do not change instantaneously.
    If you wait until the order fills, then updates OnPositionUpdate with the new position and performance, then the next bar close after these events will show the new position and new performance.

    Below is a link to the help guide on OnPositionUpdate().


    Below is a link to a reference sample with OnOrderUpdate() sample code.
    https://ninjatrader.com/support/help...and_onexec.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X