Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Getting Accumulated Realized Amount for a Simulated Account Over the Days?

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

    Getting Accumulated Realized Amount for a Simulated Account Over the Days?


    Hi there, how can I get the realized amount for a particular strategy running for a few days in row, on a shared simulated account?

    I leave my strategies running during the week, resetting only during the weekend. On simulated accounts, I notice the Realized amount on the Strategies tab is cumulative. For example, if I lose -$100 on Monday, Tuesday, and Wednesday, at the start of the trading day on Thursday, there's already -$300 showing in the Realized amount. It's that -$300 value I desire to get, and I'm running into two obstacles.

    First, I know that I can use the Account.Get method. However, I'm running a couple hundred strategies in test mode on a sim account. It'd be a pain to run each one of those on their own simulated account.

    Second, I could also use Postion.GetUnrealizedProfitLoss; however, this only tells me what hasn't been realized yet. So, at the start of the trading day, this value will be $0.

    Therefore, the only method I can think of, is to keep a running total of the realized profit/loss in that strategy over the days. I'd rather not do this. Rather, given a particular strategy on a shared account, how can I obtain the realized amount for that particular strategy at any particular instance? Thanks,






    Attached Files

    #2
    Hello timmbbo,

    The Account.Get() method will not provide information about the strategy performance, and only gives information about the account.

    You can track the PnL in a strategy and reset this any time you would like.

    Below is a link to an example 'DailyLossLimitExample' that uses the Realized and Unrealized PnL. You could use similar logic to track the PnL and reset after several days.
    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    4 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X