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