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

Markers in Indicator Panels

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

    Markers in Indicator Panels

    I want to draw markers (Diamonds, arrows, squares) in an indicator panel(like MACD) upon certain conditions. I can successfully find the conditions and make a sound play, but cannot make any marker appear in the MACD panel. I have been able to use similar conditions and make markers appear in the price panel.

    I am putting the right panel number when I set up the indicator but no joy.

    For example, I've tried:

    string myTag = "myTag" + TagNbr.ToString();
    DrawDiamond(myTag, 0, MACD(Fast,Slow,Smooth)[0] + .01, Color.Red);
    TagNbr = TagNbr + 1;

    Nothing appears. Can this be done?

    #2
    Yes, this can be done. You have to set the following property in your custom indicator's Initialize() method:

    DrawOnPricePanel = false;

    Here is additional information - http://www.ninjatrader-support.com/H...ceOnPanel.html
    RayNinjaTrader Customer Service

    Comment


      #3
      Thank you. By the way, note that the description of this in the help dialogue does not tell you WHERE to put this as you have below.

      Comment


        #4
        Thanks, I will ammend the documentation to make it more clear.
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          Yes, this can be done. You have to set the following property in your custom indicator's Initialize() method:

          DrawOnPricePanel = false;

          Here is additional information - http://www.ninjatrader-support.com/H...ceOnPanel.html
          Overlay =false;
          DrawOnPricePanel = false or true

          DrawLine(CurrentBar.ToString(),0,0,0,800,Color.Red ,DashStyle.Solid,1);

          always draw on price panel.

          Or did I do something wrong?

          Comment


            #6
            Likely did something wrong.

            I added this to one of my custom indicators and it worked as expected. Keep in mind, my indicator did have a value of 0.4 on it so my line displayed.

            Code:
            if (CurrentBar > 2)
                DrawLine("Tag1", 2, 0.4, 0, 0.4, Color.Red, DashStyle.Solid, 2);
            RayNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Ray View Post
              Likely did something wrong.

              I added this to one of my custom indicators and it worked as expected. Keep in mind, my indicator did have a value of 0.4 on it so my line displayed.

              Code:
              if (CurrentBar > 2)
                  DrawLine("Tag1", 2, 0.4, 0, 0.4, Color.Red, DashStyle.Solid, 2);

              if you toggle DrawOnPricePanel=false/ture, does your line move to price panel, move to indicator panel accordingly?

              I am just trying to draw a vertical line on the bottom indicator panel. The height of the line varies with indicator's value. It keeps drawing on price panel. I am doing this to work around the bug that I need to Add() mutiple plots to change color. See my other posts. http://www.ninjatrader-support.com/v...ead.php?t=2936

              With everything else stays the same. I tested DrawText(), DrawRectangle(), these all work just as expected, but DrawLine() does not.

              Here is the bare minimum test script. compare the image with the *.cs file. The vertical line shoud appear at the bottom.
              Attached Files
              Last edited by gregiii; 08-26-2007, 09:04 PM.

              Comment


                #8
                Your script works as expected. If you make changes to your script, to see these changes in the chart on an already active indicator, you must reload it by pressing F5 in your chart.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  This is absolutely strange!

                  Not only I reload with F5, I also shut down NT and rebooted machine today. It consistently produces the chart I posted. Vertical line never goes to the bottom indicator chart. And if you commented out DrawLine(..) statement, DrawText() works as expected. But with DrawLine(..) active, DrawText() does not work either, ie, no character "a" is seen anywhere in the chart.

                  Can you post an image of chart just with my script loaded, with DrawOnPricePanel = false and DrawOnPricePanel = true.

                  Thanks

                  Comment


                    #10
                    See images.

                    Also, managing a lot of draw objects is not optimal, especially if you have many bars on your chart. I would do one of two things -

                    - Use a plot with style bar or;
                    - Limit the number of lines drawn to no more than a few hundreded
                    Attached Files
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      The other image.
                      Attached Files
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Thanks Ray.

                        I don't know what to say...

                        I have not been able to produce a chart with vertical line at the bottom at all. Not even a single line. My original code has if () condition so only a few vertical line would be drawn if DrawLine() works for me.

                        I know to use bar style to draw indicator. But I only want to draw a few line on the indicator when certain conditions meet.

                        So with my script, you can generate a correct chart, but I can't! Any suggestions?
                        Last edited by gregiii; 08-27-2007, 12:13 PM.

                        Comment


                          #13
                          I would then speculate that the indicator you are working with on the chart is not the one you are modifying in the Editor.

                          Try creating a brand new indicator with a different name to confirm.
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            I am taling about just using the ttt.cs script I posted. Nothing else is on the chart. The same way you did. But I can't produce the same result as you did. Ture or False, these vertical line always show up at the price panel. Never goes to the bottom panel.

                            And Yes, I recompiled, reloaded, restarted NT etc. Result is the same.

                            And yes it is the same indicator as in editor, because I can change the color of the line, just not the location.


                            That's what's puzzuling
                            Last edited by gregiii; 08-27-2007, 12:52 PM.

                            Comment


                              #15
                              I don't doubt you.

                              To debug, we always need to start at the most basic level. The function for sure works as expected. Therefore, there *MUST* be something on your PC different than mine.

                              Therefore, create a new indicator with a new name and test this. Assuming this works, then we know there is something with your indicator.
                              RayNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rhyminkevin, Today, 04:58 PM
                              3 responses
                              47 views
                              0 likes
                              Last Post Anfedport  
                              Started by iceman2018, Today, 05:07 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post iceman2018  
                              Started by lightsun47, Today, 03:51 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post lightsun47  
                              Started by 00nevest, Today, 02:27 PM
                              1 response
                              14 views
                              0 likes
                              Last Post 00nevest  
                              Started by futtrader, 04-21-2024, 01:50 AM
                              4 responses
                              50 views
                              0 likes
                              Last Post futtrader  
                              Working...
                              X