Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scale justification overlay

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

    Scale justification overlay

    Hi all,

    is there a piece of code to set the scale justification of an indicator to overlay in a strategy?
    Otherwise it messes up my chart.

    Thank you,
    chris

    #2
    Originally posted by ch9090 View Post
    Hi all,

    is there a piece of code to set the scale justification of an indicator to overlay in a strategy?
    Otherwise it messes up my chart.

    Thank you,
    chris
    In the strategy, create and use a named instance of the indicator. Set the Scale Justification of the named instance.

    Comment


      #3
      Hi Chris,

      Yes, please see available properties for ScaleJustification:


      For an indicator added to a strategy:
      Add(SMA(7));
      SMA(7).ScaleJustification = ScaleJustification.Overlay;
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Wunderbar! Many thanks

        Comment


          #5
          Hi Ryan,

          I am coming back to you with a small issue I've been trying to solve for the last hour.

          Add(EMA(Vma1));
          EMA(Vma1).Overlay = true;
          EMA(Vma1).Plots[0].Pen.Color = Color.DarkOrange;

          Add(VolumeUpDown());
          VolumeUpDown().Panel = 2;
          // VolumeUpDown().Overlay = true;
          // VolumeUpDown().ScaleJustification = ScaleJustification.Left;

          Add(EMA(Volume, Vma4));
          EMA(Volume, Vma4).Panel = 2;
          // EMA(Volume, Vma4).Overlay = true;
          // EMA(Volume, Vma4).ScaleJustification = ScaleJustification.Left;
          EMA(Volume, Vma4).Plots[0].Pen.Color = Color.DarkCyan;

          Add(RSI(Vperiodin, 3));
          RSI(Vperiodin, 3).Panel = 3;
          RSI(Vperiodin, 3).Lines[0].Value = Vleveldown;
          RSI(Vperiodin, 3).Lines[1].Value = Vlevelup;
          RSI(Vperiodin, 3).Plots[1].Pen.Color = Color.Transparent; //smooth line
          Problem with this simple piece of code is that panel 2 is empty; volume and its EMA are on panel 3 and RSI on panel 4. The EMA is ok though. Why is panel 2 empty?

          An alternative would be to draw the volumeupdown and its EMA on the price chart but I don't know how to code it.

          Any brilliant ideas?

          Comment


            #6
            Hello ch9090,
            You have not assigned anything in the Panel 1.

            The EMA is plotted in pane 0 (price pane), VolumeUpDown and EMA of Volume is plotted in pane 2 while RSI is plotted in pane 3.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Thank you for the quick and efficient reply, I thought the panel price was 1!

              Now I've put the volumeupdown as an overlay in the panel price but it is taking to much real estate. Is there a simple way to reduce the (left) scale by e.g. a factor 2 or another trick so that it sits unobtrusively at the bottom?

              Comment


                #8
                Hello ch9090,
                Unfortunately nothing that comes to my mind. You have to further edit the indicator to do it.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Ok, I'll take another look at it because I first thought about fixing the scale but it would only work for stocks having a volume ranging in that scale. The alternative is to plot it on another panel and reduce its size.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Irukandji, 05-06-2024, 03:06 PM
                  3 responses
                  26 views
                  0 likes
                  Last Post NinjaTrader_Kimberly  
                  Started by RamiRK86, 05-06-2024, 08:05 AM
                  2 responses
                  30 views
                  0 likes
                  Last Post RamiRK86  
                  Started by synthhokie, Today, 09:24 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by sofortune, Yesterday, 09:49 PM
                  4 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by phayes, Today, 09:13 AM
                  2 responses
                  24 views
                  0 likes
                  Last Post phayes
                  by phayes
                   
                  Working...
                  X