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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    161 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    308 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    245 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    349 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X