Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print Events Sum

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

    Print Events Sum

    Hello NT - Thanks for a great forum.
    I'm using an indicator on NT7 to compute and display predictions of certain events on a price chart. In order to count and compare target and predicted events I use SreamWriter to download all occurrences to a file, and then sum it up in Excel.

    Would it be possible to have the sums printed to the output window ?

    Here is the type of data I use:

    targetSignal = (target == true) ? 1:0;
    modelSignal = (model == true) ? 1:0;

    scoreTP = (targetSignal + modelSignal == 2) ? 1:0;
    scoreFP = (targetSignal == 0 && modelSignal == 1) ? 1:0;

    What I need is the sum of each - scoreTP and scoreFP.

    Anybody...…??
    Last edited by bkool; 02-13-2017, 03:32 AM.

    #2
    Hello bkool,

    Thank you for your post.

    You could store the values in a Series or List and then sum the values that way or you could have another variable for each that was the sum and then add the value each time.

    For example:
    Code:
    scoreTPSUM = scoreTPSUM + scoreTP;
    scoreFPSUM = scoreFPSUM + scoreFP;
    Then you can print the values using Print(scoreTPSUM) or Print(scoreFPSUM).

    Please let me know if you have any questions.

    Comment


      #3
      Hi Patrick H,
      Thanks for the response.
      May be I wasn't clear in my question.
      There are more than a million data points and I need the bottom line printed out.
      Could the SUM() class be of use in this case?

      Comment


        #4
        Hello bkool,

        Thank you for your response.

        To utilize SUM we would need a series of the values. So in this case you could assing the scorTP and scoreFP to their own series each and then pass that series as the Input Series of the SUM.
        Code:
        SumTP[0] = scoreTP;
        Print(SUM(SumTP, SumTP.Count)[0]);
        For information on Series please visit the following link: http://ninjatrader.com/support/helpG...us/seriest.htm

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        111 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        59 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        38 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        42 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        78 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X