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 jaybedreamin, Today, 05:56 PM
        0 responses
        7 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
        9 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