Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Today's Total Realized Gains wrong on Sim Accounts

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

    Today's Total Realized Gains wrong on Sim Accounts

    When calling the data from my Simulator (Sim101) account I want the Total Realized gains from Today's trades but it returns an incorrectly high number before trades even happen. Code is (SystemPerformance.AllTrades.TradesPerformance.Tic ks.CumProfit > Realized_Profit_Ticks). Is there a way to set the Realized gains to zero before trading for the day and call the realized gains from the account in real-time in Strategy Builder or do I need to use the Ninjascript editor? I found a NinjaScript of (SystemPerformance.RealTimeTrades.TradesPerformanc e.Ticks.CumProfit > Realized_Profit_Ticks) that might work but I wanted to stay in Strategy builder to do it if possible. Will this same code pull the correct Realized Profit ticks from a Real Live account unlike the SIM account? I am nervous to put on a real account in case it fails to pull the Realized Profit ticks as Zero when the strategy starts at the beginning of the day as it does with Sim accounts. I need to start the day at zero Realized Gains and trigger when reaching my "Realized_Profit_Ticks setpoint for the day. I have it printing the starting number on the chart and it has a starting value at some number above my trip point most days.

    if ((Stop_Trading == false)
    && (SystemPerformance.AllTrades.TradesPerformance.Ticks.CumProfit > Realized_Profit_Ticks)
    && (Times[0][0].TimeOfDay > Start_Time.TimeOfDay)
    && (Times[0][0].TimeOfDay < End_Time.TimeOfDay)
    && (Trades_Have_Occured == true))
    ​

    #2
    Hello Sawmillbill,

    When using the TradesPerformance information that includes all trades so that also has historical performance. There is a sample in the following link which shows how to isolate that to a single trading session.



    You can also do this using the builder: https://ninjatrader.com/support/foru...ples#post93881

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    104 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    52 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    34 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    38 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    74 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X