• 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

DrawRegion not plotting

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

    DrawRegion not plotting

    This looks simple enough, but there is never any output on the chart.
    What did I do wrong?

    The attached png shows an example of what I am trying to do...
    simply highlight the space between two bars if the 2nd bar is an inside or an outside bar...

    BTW, I am testing in 6.5 as that is what is installed.
    Attached Files

    #2
    In your code you use CurrentBar. This is a problem for you when you use it in the DrawRegion() parameters. CurrentBar basically increments up from 0 till the current bar. The left most bar on your chart is 0 and the latest bar will be 100 or 200 or however many bars you have on the chart. When you input CurrentBar into a parameter that is working in the "bars ago" direction you effectively bring it back to the very beginning of the chart. In your code what you are saying is this right now "draw the region between CurrentBars ago where CurrentBar = the beginning of the chart".

    Instead you want to just do 0 and 1 where 0 is the latest bar (0 bars ago means current bar) and where 1 means the previous bar.

    That was a long winded response, but hope it makes sense. Merry Christmas Eve!
    JoshNinjaTrader Customer Service

    Comment


      #3
      Also,

      Instead of passing in High and Low, use the following:

      MAX(High, 0)
      MAX(Low, 0)

      High and Low are not valid parameters for this method at this time. I believe they should be and will check into it. The above alternative accomplishes the same thing for now.
      RayNinjaTrader Customer Service

      Comment


        #4
        Thanks, Josh.
        For the (int startBarsAgo, int endBarsAgo) section, I originally tried (CurrentBar, 0) then (CurrentBar-1, CurrentBar) now (1,0). None generate output to screen; however, my data is no longer running so it may be that I need to wait until Wednesday to test.

        Thank you for your very prompt response, and have a Merry Christmas!

        Comment


          #5
          Ray, I saw your post after I answered Josh -- that seems to have done it...

          I am surprised: The help says series, series1, series2
          Any DataSeries type object such as an indicator, Close, High, Low etc.. The value of the object will represent a y value.


          Thank you! I will keep playing with it...

          Comment


            #6
            I just tried this and got the same error, saying "...series1 has to be from type DataSeries".

            However, the intellisense prompt says it needs to be an "IDataSeries".

            High & Low are DataSeries, not IDataSeries, thus the error that's displayed in the log (see screen clip).

            Is there a way to convert from DataSeries to IDataSeries?
            Attached Files

            Comment


              #7
              This is a bug.

              DataSeries objects implement the interface IDataSeries. It should work thus it is a bug and will be resolved with our next update.
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Hagar, Today, 06:52 PM
              0 responses
              1 view
              0 likes
              Last Post Hagar
              by Hagar
               
              Started by vivekniwas, Today, 04:56 PM
              0 responses
              6 views
              0 likes
              Last Post vivekniwas  
              Started by dtl-saw, Today, 03:36 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by williamzz, Today, 02:04 PM
              2 responses
              13 views
              0 likes
              Last Post williamzz  
              Started by jtrading82, Today, 01:55 PM
              3 responses
              27 views
              0 likes
              Last Post NinjaTrader_Tyler  
              Working...
              X