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

How to access the NetProfit sum in the Strategy Analyzer?

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

  • pstrusi
    replied
    I thank you very much Patrick for your great assistance, as always NT support team is excellent!

    Regards,
    ps

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for the additional information.

    It would not be possible to export the results from the backtest through the script. However, it is possible to pull the TradesPerformance and store these values in an external file to read form on the next run of the strategy.

    For information on the TradesPerformance values please visit the following link: http://www.ninjatrader.com/support/h...erformance.htm

    For a reference sample on reading and writing to an external file please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3477

    Please let me know if I may be of further assistance.

    Leave a comment:


  • pstrusi
    replied
    Nope. I have a certain experience programming my codes but I´m not a programmer, just economist who learned some from tutorials, books and being helped by this forum. But Whenever I need to go into more complicated internal dynamics I struggle to do a fine job. However I try to keep my work simple.

    Patrick I appreciate your help but don't worry if this is out of your duty as support. I'm trying to solve through an excel macro..but since I have to optimize 3^10 combinations and assigning those input into my code, I tried to get support from this limitations in lines of code in NT. Above 80.000 NT begins to give memory-issues.

    If by any chance you could give me some reference in how to get access to internal results from an historical backtest, let me know

    Best regards

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for your response.
    Originally posted by pstrusi View Post
    When I was working until 8 variables there wasn`t problem cause I designed a fix code with 27.000 lines, but now that I need to add more variables I hit a limit.
    Are you developing this in the Strategy Wizard?

    I look forward to your response.

    Leave a comment:


  • pstrusi
    replied
    Let me explain it because I'm sure that NT might allow a better way.

    I run a backtest with my code, I get a results, and those results ( with a simple work with them in excel give a Trend depending of the combination of my input variables. After I need to put into my code that for certain combination the code should be: buy, neutral or sell a position. My problem is that I don't know how to automatize using the backtest results into my code in automatic way. As you can see there's a manual work.

    Do you understand it? I hope to have it explained simple

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for your response.

    So I may better assist you in this area please advise why you would not just use the Strategy Analyzer results? What are you attempting to do here? What is the end result? Are you planning to hav ethe data automatically exported to another file?

    I look forward to your response.

    Leave a comment:


  • pstrusi
    replied
    When I´m backtesting, thus I must input: Value for Bar, dates...etc In order to automate the code, I need to use those results and then changing certain input values in my code. When I was working until 8 variables there wasn`t problem cause I designed a fix code with 27.000 lines, but now that I need to add more variables I hit a limit.
    Last edited by pstrusi; 07-24-2013, 01:45 PM.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for your response.

    In this case you would need to build you own internal calculations within the strategy to do this. Are you trying to do this for when your are backtesting in the Strategy Analyzer or just in running the strategy in real-time and want the historical trade values?

    I look forward to your response.

    Leave a comment:


  • pstrusi
    replied
    Patrick your tip is very useful if working in real time, but how to do when you want to optimize values on historical data?

    Leave a comment:


  • pstrusi
    replied
    Thanks Patrick for indicating how to get it, now an obvious question:

    how can I submit in my code, as if it was in the strategy analyzer, certain values in the optimizer, such as: value for Bar, dates set for the study..etc in order to get the NetProfit ?

    Thanks

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello pstrusi,

    Thank you for your post.

    You can use the TradesPerformance values of GrossLoss and GrossProfit to factor the NetProfit as GrossProfit - GrossLoss.

    You can find the TradesPerformance values at the following link: http://www.ninjatrader.com/support/h...erformance.htm

    Please let me know if you have any questions.

    Leave a comment:


  • How to access the NetProfit sum in the Strategy Analyzer?

    Hi Ninjas, since I hit with a limitation of a max number of lines in a code, I`m trying to solve in other way my problem.

    Imagine that you have a code with a certain simultaneous combination of ten or more variables, which each one of them might be -1, 0 or 1. When I run whatever input combination of this variables in the strategy analyzer as a code, I get a result of multiple fields, but the most important to me is the NetProfit, and I´d like to know if I could get this result internally in a variable that I could use, without taking it from the strategy analyzer result page.

    Thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by bortz, 11-06-2023, 08:04 AM
47 responses
1,605 views
0 likes
Last Post aligator  
Started by jaybedreamin, Today, 05:56 PM
0 responses
8 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
4 views
0 likes
Last Post Jon17
by Jon17
 
Started by Javierw.ok, Today, 04:12 PM
0 responses
13 views
0 likes
Last Post Javierw.ok  
Working...
X