Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Regions and lines not shwing in Price panel

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

    Regions and lines not shwing in Price panel

    Scenario:

    I have an indicator that draws both line plots and regions. It works fine in it's own panel. If I move the indicator to the price panel the regions and plot lines do not show. I changed DrawOnPricePanel from false to true. But it still won't show the regions or the lines in the price panel.

    Question:
    What do I need to set or unset to get get regions to show in panel 1?

    #2
    Hello,

    Thank you for posting.

    I wanted to check, had you removed the indicator from the chart and re added it or just pressed F5 when making the change to DrawOnPricePanel? If you have only refreshed, likely the indicator is still using the old setting, removing it and re adding it would be the solution in that situation.

    If that is not what is happening, could you tell me the following:
    Is the price for this tool the same as the Close or near it? Would it be visible within the current scaled area in the price panel?
    For the lines and region, are you using AutoScale in the syntax?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jessie

      Hello again to one of my favorite Ninja support people.

      Yes I only did an F5 and did not remove and add it back. You caught me. Will give that a try.

      The regions are not auto scale which is preferred. The lines are auto scale as I couldn't get them to not auto scale even though I set auto scale off . I just did some program logic to not set the lines I didn't want to see and improve performance. Let see what it looks like when I remove the indicator and add it back.

      Cheers

      Comment


        #4
        Jessie

        Removed the indicator and added it back to the same chart. Regions and line plots did not show. I do have one plot (well call it my main plot) is showing so there is something for sure I am not setting right in the other plots. I am using the left Y index for scaling for the indicator as I didn't want to override price on the price bars.

        Comment


          #5
          Hello ct,

          Thanks for trying that.

          Would you be able to provide a sample of the script? I don't see any reason from what you have provided so far as to why the region/lines would not plot.

          I suppose the only other item that I could think of would be if they were plotting at the last condition somewhere on the chart out of view in historical data. Really I believe I would need to see the syntax to better understand what may be happening.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Jessie

            Not sure if it will help but here is a code snippet of the add plot code. I was using a color of transparent on the region boundaries so no boundary separator was shown. The only difference I see between this plot and the one line plot that shows is the color "transparent". Interesting how the behavior changes when I move it from it's own panel to the price panel.

            The regions are Fibonacci regions that are loaded from an array so the zones can be specified or changed by the user.

            for (int idx = 0; idx <= regionRatios.Length -1; idx++)
            {
            Add(new Plot(new Pen(Color.Transparent, 1), PlotStyle.Line, regionRatios[idx].ToString("F2") + "% Region"));
            }

            Here is the draw region code. I set the region color based on a computed gradient rgb color. The LineOffset is computed based on the array length of the number of fib region ratios to be drawn. You can see on the draw region auto scale is set to off which works fine in it's own panel but not the price panel.

            I loop thru the add region code for each fib ratio pair.
            int RegionCount = regionRatios.Length - 1;
            for (int idx = 0; idx < RegionCount; idx++)
            {
            DrawRegion( "RegionUp" + idx , CurrentBars[0], 0 ,Values[idx + LineOffset], Values[idx + LineOffset + 1], upperRegionColorSeperator, RegionColor, RegionOpacity);

            I know I am only giving you selected bits and pieces. I hope it helps.

            Cheers

            Comment


              #7
              Hello,

              Thank you for the reply.

              I can't seem to pick anything out of the example here that would cause a specific difference when applied to the primary panel. For this item, it may be easier to create a new indicator that simply adds lines and a region but does not do other logic. I wouldn't be sure that this is related to your logic, but this type of test could at least initially take your logic out of the question. This may also highlight the reason for the difference.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by lorem, Today, 09:18 AM
              0 responses
              2 views
              0 likes
              Last Post lorem
              by lorem
               
              Started by hazylizard, Today, 08:38 AM
              4 responses
              11 views
              0 likes
              Last Post hazylizard  
              Started by geddyisodin, Today, 05:20 AM
              2 responses
              20 views
              0 likes
              Last Post geddyisodin  
              Started by Max238, Today, 01:28 AM
              5 responses
              47 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by giulyko00, Yesterday, 12:03 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X