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 Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X