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

Need little help with Ticks Per minute indicator development

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

    #31
    Originally posted by NinjaTrader_Austin View Post
    Yes, editing will be necessary.
    Thanks Austin.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #32
      cclsys, I see what you're saying. I have a feeling the double plot is caused by re-drawing the plots one bar back. I've commented out the historical .Set commands, and I'm still not quite sure what you're looking for, but there are no more double plots.

      What are you trying to accomplish by setting the current value and the value one bar back every OnBarUpdate()?

      Please see attached picture and code and let me know if that was the problem.
      Attached Files
      AustinNinjaTrader Customer Service

      Comment


        #33
        Originally posted by NinjaTrader_Austin View Post
        cclsys, I see what you're saying. I have a feeling the double plot is caused by re-drawing the plots one bar back. I've commented out the historical .Set commands, and I'm still not quite sure what you're looking for, but there are no more double plots.

        What are you trying to accomplish by setting the current value and the value one bar back every OnBarUpdate()?

        Please see attached picture and code and let me know if that was the problem.
        First I'll answer your question, then I'll open up the code and take a look. Am I right that when I open it up I'll lose my original code? In any case, I'll make backup.

        What I am trying to accomplish? I cannot comment on the code I used since it was lifted from the example you gave me. I don't know exactly what it is saying myself. So in normal english, what I am trying to accomplish is have the bar change color when the maxout condition happens, and the other times just to plot in the default color. Now we have made 2 plots so the first plot is the default color and the second is when it maxes out. It looks from the pic you sent that you have fixed it and I'll comment on the code later and perhaps you can help me to learn to understand what the various elements in the code are saying.

        Thanks.

        Comment


          #34
          He is doing exactly what I was posting about. Stitching two lines together but not using lines, which now causes the problem. This is another big problem with code written to join line colors together. If the user changes the plots from Bar to Line, you will see this problem.
          I commented out two lines:

          if (tpmsys < ATR (21)[0]*6 /TickSize )
          {
          //TPM.Set(1, tpmseries[1]);
          TPM.Set(tpmseries[0]);
          }

          else
          {
          //TPM2.Set(1, tpmseries[1]);
          TPM2.Set(tpmseries[0]);
          }
          Last edited by eDanny; 07-30-2009, 10:20 AM.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #35
            cclsys, eDanny is right. The code you originally had connects line plots together without gaps. That is what redrawing the historical value is for. Sorry for not realizing that earlier.

            Just like eDanny said, if you plot the code I sent back to you as a line (not as bars), there will be gaps when the color changes. If you're only going to be using bars with this indicator (and this does seem like a bars-only type indicator), then the code I posted will work fine.

            Please see the attached pictures that demonstrate the whole "line connecting" idea.
            Attached Files
            AustinNinjaTrader Customer Service

            Comment


              #36
              Originally posted by NinjaTrader_Austin View Post
              cclsys, I see what you're saying. I have a feeling the double plot is caused by re-drawing the plots one bar back. I've commented out the historical .Set commands, and I'm still not quite sure what you're looking for, but there are no more double plots.

              What are you trying to accomplish by setting the current value and the value one bar back every OnBarUpdate()?

              Please see attached picture and code and let me know if that was the problem.
              OK, looked at the code. Thanks. Now, for learning purposes, here is the first version which I extrapolated from the SampleMulti-Colored Plot.

              if (tpmsys < ATR (21)[0]*6 /TickSize )
              {
              TPM.Set(1, tpmseries[1]);
              TPM.Set(tpmseries[0]);
              }

              else
              {
              TPM2.Set(1, tpmseries[1]);
              TPM2.Set(tpmseries[0]);
              }

              Your correction:

              if (tpmsys == ATR (21)[0]*6 /TickSize )
              {
              Print("if");
              // TPM2.Set(1, tpmseries[1]);
              TPM2.Set(tpmseries[0]);
              }

              else //if (tpmsys < ATR (21)[0]*6 /TickSize )
              {
              Print("the else");
              // TPM.Set(1, tpmseries[1]);
              TPM.Set(tpmseries[0]);
              }


              So you have taken out the Set(1,...)s. Question: what were they doing in the original code exactly?

              In the Multi-colored plot example it read:

              if (Rising(SMA(Period)))
              {
              // Connects the rising plot segment with the other plots
              RisingPlot.Set(1, SMA(Period)[1]);

              // Adds the new rising plot line segment to the line
              RisingPlot.Set(SMA(Period)[0]);
              }

              // Plot red if the SMA is falling
              // Falling() returns true when the current value is less than the value of the previous bar.
              else if (Falling(SMA(Period)))
              {
              // Connects the new falling plot segment with the rest of the line
              FallingPlot.Set(1, SMA(Period)[1]);

              // Adds the new falling plot line segment to the line
              FallingPlot.Set(SMA(Period)[0]);
              }
              ...

              Here you see how they have the Set(1,...) and just Set(...).

              I can see that yours works, but now I have no idea why the example one is set up the way it is and would be grateful to understand why it was written that way.

              ++++++++++

              Well, am going to remove the ATR addition and basically it is done. I hope others find it helpful. One disadvantage with tick charts is that they do take time out of the equation visually (that is also an advantage in many ways as well). But sometimes it is hard to see from the bars alone the degree to which the market is really moving. This indicator works similar to the Time Histogram supplied, but IMO does so quite a bit better.

              Instead of the original name in the first edition (TickTime), it is now called 'RPM' meaning Range per Minute. There might be a more intelligent way to determine the level of the limiter for plotting purposes than the simple ATR-based option I have used. My original concept was that if the current range was more than double the average but since at the time I did not have a series I couldn't do it. Now I have made an additional data series I will try that out and, assuming it works, post the finished indicator here again.

              Thanks for all your help (though I am still hoping to learn one more lesson from the Sample MultiColored Plot indicator query above).

              Comment


                #37
                Cyberspace is lovely how messages can pass each other and no one notices... anyways, I posted what the Set(1,...) is for in the above post. It is just used to connect line plots together.
                AustinNinjaTrader Customer Service

                Comment


                  #38
                  Yes Austin, and the sample is for SMA Line plots. That is why the code was not working for Bar plots. This is why the problem has to be fixed on NT7.
                  eDanny
                  NinjaTrader Ecosystem Vendor - Integrity Traders

                  Comment


                    #39
                    Originally posted by NinjaTrader_Austin View Post
                    Cyberspace is lovely how messages can pass each other and no one notices... anyways, I posted what the Set(1,...) is for in the above post. It is just used to connect line plots together.
                    The subsequent posts must have come in whilst I was typing my reply or something.

                    So thanks to you and Danny, now understand about the line and bar business. Makes perfect sense and I should have figured that out myself.

                    Have now changed the code to
                    a) get rid of the irrelevant ATR line which is not so helpful in the context of this RPM (range per minute) concept because skews things visually with tick bars that are way beneath or above one minute.

                    b) Have based the governor on the average data series by adding in a Plot Max of the average * 3 and the bar changes color if exceeds the average * 1.5. I forgot to add in menu-adjustable variables for this.

                    For menus I did, however, add in

                    c) BackColor
                    d) Average period.

                    So I think it should be good as is for any tick chart, probably also range and even minute charts, although with minute charts a basic ATR works fine - albeit personally I think ATR is better when displayed in ticks versus points.

                    Thanks again to all and sundry and the latest, and probably final, RPM Indicator V.1 is now attached below. Picture to follow.

                    PS As per following post, there is a problem with the average no longer being 'governed'. So first I will fix that, then post the Indicator.

                    Austin. I got a PM but my browser disallowed the popup and I couldn't get it back even after I gave permission. Vanished!
                    Last edited by cclsys; 07-30-2009, 11:16 AM.

                    Comment


                      #40
                      Oh-oh. The markets I was looking at whilst reconfiguring were not fast. After posting this, there was a burst of fast market activity and the way the average is now set based on real underlying RPM value (versus before it was based on the limited value), it can go so high so fast as to make the subsequent bars invisible. So I will have to retool this again to fix that meaning the last uploaded version should be ignored (I will remove if I can).

                      Comment


                        #41
                        Great to hear cclsys. Its hard to believe you were saying earlier in this thread, "I can't get any print output." This indicator has come a long way from that point.

                        The PM was a thank you note. Personally, I found this indicator helpful and just wanted to say thank you for sharing it.
                        AustinNinjaTrader Customer Service

                        Comment


                          #42
                          Originally posted by NinjaTrader_Austin View Post
                          Great to hear cclsys. Its hard to believe you were saying earlier in this thread, "I can't get any print output." This indicator has come a long way from that point.

                          The PM was a thank you note. Personally, I found this indicator helpful and just wanted to say thank you for sharing it.
                          Yes, it's a good indicator. Now that it's made (and even though perhaps it could be improved somehow) it seems like something that should be supplied as a default indicator. Seeing the Range per Minute on a tick chart is helpful. The spike bars are a problem and the only solution I have found is to impose a limit on them meaning that the values during such periods are no longer accurate (they are in ticks). But visually it works fine now even if when things are extreme the bars are not showing the full value of the RPM.

                          Such periods don't last long, however, and in any case such values are probably not all that helpful at that point (i,e, what practical difference does it make if for 2 seconds the RPM is 500 ticks but only displays as 50 when the typical RPM is around 4-6?). They are helpful in more normal markets, and also the indicator helps show when a market is moving versus treading water in a way that the bars alone sometimes do not.

                          In any case, here is the latest version. I went back to using ATR to effect an initial governance on the underlying RPM bar, and then calculated the average based on those reduced bars. I have attached the code and will also try to attach a picture to show how it looks for anyone else who comes to this thread and wants a quick idea of what it is before bothering to download it or not.

                          Thanks again.
                          Attached Files

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by andrewtrades, Today, 04:57 PM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by chbruno, Today, 04:10 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post chbruno
                          by chbruno
                           
                          Started by josh18955, 03-25-2023, 11:16 AM
                          6 responses
                          436 views
                          0 likes
                          Last Post Delerium  
                          Started by FAQtrader, Today, 03:35 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post FAQtrader  
                          Started by rocketman7, Today, 09:41 AM
                          5 responses
                          19 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Working...
                          X