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

SystemPerformance.RealTimeTrades.Count;

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

    SystemPerformance.RealTimeTrades.Count;

    I can get for the life in me to get this to print any trades count or session cumprofits. I am using a strategy which that uses a ATM

    So first question in Playback mode will the script work and second why is it not working with a ATM entry,



    // Store the strategy's prior cumulated realized profit and number of trades
    priorTradesCount = SystemPerformance.RealTimeTrades.Count;
    priorTradesCumProfit = SystemPerformance.RealTimeTrades.TradesPerformance .Currency.CumProfit;


    Print("Total Amount Trades is " + priorTradesCount + " and Total Profit is " + priorTradesCumProfit);​

    #2
    Yes, the script would work in Playback. Did you look in the Log tab for any errors your script might be throwing?
    RayNinjaTrader Customer Service

    Comment


      #3
      Hello nettony,

      Thank you for your post.

      As Ray stated, yes the script should work in Playback. That said, you did mention that this is related to an ATM entry. As mentioned on the "Using ATM Strategies" page, "Executions from ATM Strategies will not have an impact on the hosting NinjaScript strategy position and PnL - the NinjaScript strategy hands off the execution aspects to the ATM, thus no monitoring via the regular NinjaScript strategy methods will take place (also applies to strategy performance tracking)"



      You could try keeping a manual count of entries submitted by the strategy by incrementing an int variable when an entry is filled. As for CumProfit, we have a reference sample that shows how to get PnL from an ATM strategy in NinjaScript here:


      Please feel free to reach out with any additional questions or concerns.
      Emily C.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 02:12 AM
      3 responses
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      7 responses
      27 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by samish18, 04-17-2024, 08:57 AM
      17 responses
      65 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by briansaul, Today, 05:31 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PaulMohn, Today, 03:49 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X