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 ezrollin, Today, 11:20 AM
        0 responses
        5 views
        0 likes
        Last Post ezrollin  
        Started by ErikY, Today, 11:12 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by ericson, Today, 11:11 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by Tradarr, Yesterday, 06:23 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by Behungr101, Today, 10:17 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_JustinD  
        Working...
        X