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

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!
    Josh P.NinjaTrader 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 Kaledus, Today, 01:29 PM
              0 responses
              3 views
              0 likes
              Last Post Kaledus
              by Kaledus
               
              Started by PaulMohn, Today, 12:36 PM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by yertle, Yesterday, 08:38 AM
              8 responses
              37 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by rdtdale, Today, 01:02 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by alifarahani, Today, 09:40 AM
              3 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X