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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    147 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    284 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X