• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Looking for the Proper Syntax

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

    Looking for the Proper Syntax

    "double T3Average3 = T3Average(Stochastics(7, 14, 3).K, 0.7, 12)[0];"

    I am trying to put a T3Average on the %K Stochastics via the code. The above syntax compiles without errors, but when I add a T3Average (by clicking the "Indicators" icon) with the same settings to panel 3 for comparison, using the Stochastics as the input series to verify that it's working properly, the compared values are not even close to being the same.

    In other words, I print out the T3Average/Stochastic values in the Output window from my coding and compare it with T3Average/Stochastic values that was manually added to the chart. The 2 don't match. The manually added T3Average/Stochastics is correct. The one from the code isn't.

    Technically, it's working. It's just not giving the correct values.

    Can someone tell me if the above setup for the "double" correct? If not, what can I do to correct the problem?

    Please aware that I'm a novice at programming. Please respond in laymen's terms. Any help would be much appreciated.
    Last edited by RookieTrader; 07-03-2013, 07:02 AM. Reason: for Clarity

    #2
    Hello RookieTrader,

    I am not familiar with this indicator or how it is being calculated. The only thing that I can speculate what is going on is that typically by default, NinjaTrader will add an IDataSeries object that you may pass into an Indicator that the Indicator will use that data for the calculations instead of regular input series divided by the Stochastic.K or any DataSeries that you pass into it.

    You may verify this by plotting the T3Average Indicator on the chart with the same settings and change the Input Series to the Stochastic.K. Here is a video demonstrating how you may do this.
    http://www.youtube.com/watch?v=zQRxn...140D7&index=19

    If they match then you may want to calculate it manually inside of the Indicator.
    JCNinjaTrader Customer Service

    Comment


      #3
      JC,

      The method you described and that is demonstrated in the video is exactly what I compared my code inside the indicator to (see jpeg "T3AverageSto Example").

      The syntax seems to be virtually the same:
      syntax from jpeg image (manually added in accordance with video link you sent)
      = T3Average(Stochastics($EURUSD(10 Range),7,14,3).K,0.7,12)
      Code in the indicator = T3Average(Stochastics(7, 14, 3).K,0.7,12)[0]

      Is there any other ways that you can think of to correct the inconsistency?
      Attached Files
      Last edited by RookieTrader; 07-03-2013, 09:14 AM.

      Comment


        #4
        Hello RookieTrader,

        From the screenshot I see that you are using the Stochastic.D instead of the Stochastics.K.

        Could you confirm that the settings are the same?
        JCNinjaTrader Customer Service

        Comment


          #5
          JC,

          The reason that their different, I was trying to set up a proprietary indicator and didn't want to use the actual settings, so I wrote the settings in by hand on both. But I can assure you that the actual settings on both are the identical, both using %K.

          Comment


            #6
            Hello RookieTrader,

            That for the clarification. Unfortunately, I would not know how the T3Average indicator is going to be calculating its values so it would be hard for me to tell what to expect.

            If you would like to share the indicator I can take a quick look to see if I can get them to match, otherwise, you may want to contact the vendor for more information about this.

            Happy to be of further assistance.
            JCNinjaTrader Customer Service

            Comment


              #7
              JC,

              Thanks for the help JC. I'll try to figure it out on my own.

              Have a good night.

              Comment


                #8
                JC,

                Just for future reference, on the off chance someone else runs into this problem, the issue was that the T3AverageUp, T3AverageDown & T3AverageNeutral values in the indicator had to be set back to zero after each finished plotting in order to calculate the values correctly.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by hir04068, Today, 06:58 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jim  
                Started by aprendiz, Today, 07:25 AM
                0 responses
                3 views
                0 likes
                Last Post aprendiz  
                Started by vivekniwas, Yesterday, 10:21 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by escobar63, Yesterday, 05:06 PM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by Brutus, Today, 06:00 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Working...
                X