Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

call once on strategy execution

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

    call once on strategy execution

    I'm attempting to monitor my profits from within the strategy and using
    Code:
    Print ("Account Size is " + GetAccountValue(AccountItem.CashValue)); 
    			Print ("Performance is " + Performance.AllTrades.TradesPerformance.Currency.CumProfit);
    However, while a position is open, the GetAccountValue shows inaccurate information. CumProfit works fine but does not carry into the next contract so profits are back to zero. What I would like to do is call the Account Size - Starting Account Size. The starting account size would be an int and I would like to call the Account Size. What can I use to get accurate Account size information?

    #2
    Hello Tdschulz,

    Could you clarify what you are expecting to see inside GetAccountValue(AccountItem.CashValue)?

    While in a trade the Initial Margin will affect Cash Value.

    For a reference sample you may view the following thread on using trade performance statistics for money management.
    http://www.ninjatrader.com/support/f...ead.php?t=4084

    Note that CumProfit will return the Realized PnL: http://www.ninjatrader.com/support/h...?cumprofit.htm

    For unrealized PnL you may use GetProfitLoss(): http://www.ninjatrader.com/support/h...profitloss.htm

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X