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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    96 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    24 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    35 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    37 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X