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

performance info error change Time Range on source code

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

    performance info error change Time Range on source code

    Hello,

    I have changed the time frame range in the optimizer backtest by source code using params.

    Code:
    protected override void Initialize()
    ..
    BackTestFrom = new DateTime(YearFrom, MonthFrom, 1); 
    BackTestTo = new DateTime(YearFrom, MonthFrom+1, 1);
    But the performance windows don't show true info:
    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    And don't print the true info

    Code:
    protected override void OnBarUpdate()
    ..
     if ((base.CurrentBar == (base.Bars.Count - 2)) && !this.infoShow)
                        {
                            this.infoShow = true;
                            base.Print(" \x00b7 Start Date: " + BackTestFrom.ToString());
                            base.Print(" \x00b7 End Date: " + BackTestTo.ToString()); 
                            base.Print(" \x00b7 Total Profit: " + base.Performance.AllTrades.TradesPerformance.Currency.CumProfit + " $/€ "); 
    ..
    · Start Date: 01/02/2016 0:00:00
    · End Date: 01/03/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/04/2016 0:00:00
    · End Date: 01/05/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/01/2016 0:00:00
    · End Date: 01/02/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/03/2016 0:00:00
    · End Date: 01/04/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/06/2016 0:00:00
    · End Date: 01/07/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/05/2016 0:00:00
    · End Date: 01/06/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/07/2016 0:00:00
    · End Date: 01/08/2016 0:00:00
    · Total Profit: 769,999999999975 $/€
    · Start Date: 01/07/2016 0:00:00
    · End Date: 01/08/2016 0:00:00
    · Total Profit: 2270 $/€
    · Start Date: 01/02/2016 0:00:00
    · End Date: 01/03/2016 0:00:00
    · Total Profit: 419,999999999995 $/€
    · Start Date: 01/03/2016 0:00:00
    · End Date: 01/04/2016 0:00:00
    · Total Profit: 2360,00000000001 $/€
    Best Regards
    David

    #2
    Hello,

    Thank you for the question.

    Unfortunately the images leave out any relevant information such as the values used for the properties you are asking about.

    In order to make sense of the prints, I would need to both see the exact syntax used and also the values used for the test being shown. Could you provide a simplified example of a single property and how you are currently using it? I could then check the syntax to see what may be happening.

    Our support does not provide debugging services so I may be unable to say why the whole script is failing, but if you can excerpt the logic for just the Time restriction you are using, I may be able to see what is happening with that.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    3 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Working...
    X