Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to get a real-time profit/loss for a session?

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

  • pstrusi
    replied
    Hi Patrick,

    Thanks for your complete answer, now I know what I needed to code right.

    Regards

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for your post.

    1. RealtimeTrades are those that were actually taken on the account the strategy is assigned. AllTrades are all trades, historical, real-time, long or short in the collection.

    2. The variables would be reset to 0 at the start of the strategy, but during the historical data process the values for AllTrades would be pulled over the historical data for any trades that may have been taken.

    3. They are reset to 0 on a new instance.

    The AllTrades collection will reset to 0 on the new instance of the strategy, but during the historical backtest that is performed before the real-time bars you would see AllTrades update.

    RealtimeTrades would not update until the first trade on the real-time bars is performed on the account.

    Leave a comment:


  • pstrusi
    started a topic How to get a real-time profit/loss for a session?

    How to get a real-time profit/loss for a session?

    Hi Ninjas,

    My goal is to get a reliable real-time profit-loss value for just one session.

    In order to achieve this I'm working with similar system variables that I don't still fully understand.

    Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit

    and

    Performance.AllTrades.TradesPerformance.Currency.C umProfit



    So, here my questions, waiting for answers to code this right

    1. What is the difference between them? it seems that they are both the same

    2. If I stop a Strategy, and re-run it again, would they be these variables values reset to zero for a new session or they keep cumulative?

    3. Under which conditions would these variables reset to zero?

    Thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by Skifree, Yesterday, 06:35 PM
1 response
9 views
0 likes
Last Post NinjaTrader_Gaby  
Started by algospoke, 05-13-2024, 06:53 PM
7 responses
69 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by Option Whisperer, 03-20-2024, 07:01 AM
8 responses
177 views
0 likes
Last Post johnathanhebert  
Started by bsbisme, Yesterday, 03:42 PM
1 response
8 views
0 likes
Last Post NinjaTrader_Gaby  
Started by Taddypole, Yesterday, 12:56 PM
3 responses
13 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X