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

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rainmakersg, Today, 02:09 AM
    0 responses
    7 views
    0 likes
    Last Post Rainmakersg  
    Started by frantic, 01-21-2020, 02:34 PM
    75 responses
    4,622 views
    0 likes
    Last Post Brockjava  
    Started by siddhugaddi, Yesterday, 10:48 AM
    2 responses
    24 views
    0 likes
    Last Post siddhugaddi  
    Started by Bob-Habanai, 09-14-2024, 08:10 AM
    2 responses
    23 views
    0 likes
    Last Post Bob-Habanai  
    Started by go2toa, 09-14-2024, 05:43 AM
    2 responses
    22 views
    0 likes
    Last Post go2toa
    by go2toa
     
    Working...
    X