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