Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw objects vs Plots

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

    Draw objects vs Plots

    Ok, I don't know if this has been suggested before. Draw objects like dots, triangles, arrows look great on a chart but they have severe limitations. For example, if you have CalculateOnBarClose = false you have to jump through hoops and add lots of code to test if the prior condition is still true on the first tick of next bar or you may leave the object in place. Many times you could have two opposing objects since both conditions triggered during the bar. Extra code to test, remove if needed, or redraw at the correct distance from the bar is clumsy. However, using Plots to achieve the same thing is simple and streamlined but you can only have so many different size and color Dots Plotted before it is very confusing. How about either providing more shapes that can be Plotted? Option 2: add another set of Draw commands that will allow an object to act like a plotted object. This means keeping the correct distance from bars on every tick and removing themselves (every time) automatically when the condition is no longer true.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    #2
    eDanny,

    Draw objects are placed wherever your code tells them to be placed. If your code decides to move it then it will move. There is no way around this. Please ensure your code places, removes, moves objects as you desire.

    Thank you for the suggestion of more plot styles. We will add it to the list of future considerations.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      eDanny,

      Draw objects are placed wherever your code tells them to be placed. If your code decides to move it then it will move. There is no way around this. Please ensure your code places, removes, moves objects as you desire.

      Thank you for the suggestion of more plot styles. We will add it to the list of future considerations.
      You are correct, and that is the problem. To handle Draw objects is much more work and code than to do the exact same thing with a Plot.
      An example is an indicator I downloaded to try which plots arrows on price. If I change the Calculate on bar close to false I start seeing arrows on top and bottom of candles sometimes. Adding two plots and replacing the two Draw statements with Values[0].Set() and Values[1].Set() statements lets it plot like a charm although the cool looking Arrows are replaced with ugly dots with no outlines. The problem is the code was not written to be updated by tick and many more lines would be needed to accomplish what I did by adding two lines and replacing two lines.
      Last edited by eDanny; 03-24-2009, 03:41 PM.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment


        #4
        eDanny,

        Draw objects were never designed or meant to do what a plot does. They are completely separate things with different uses. If CalculateOnBarClose messes up your code logic there is no other way, but to address it in your code. This is what it is. Draw objects are meant to place a marker onto a chart when you see fit. If the condition renders it no longer suitable then you will have to remove the object if you do not want to see it any more.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I realize that but there are many indicators in the sharing section using Draw objects like plots and they cannot be used correctly if Calculate on bar close = false. Saying they were never meant to be used like plots doesn't stop the practice. That is why I suggested making them more like plots. I guess adding other Plot styles would pretty much accomplish the same thing so I'm looking forward to plotting arrows, triangles, diamonds, smiley faces or what ever is added.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            eDanny,

            I understand your concern, but unfortunately changing the behavior will break as many indicators as it would "fix". I have already added additional plotstyles onto our list of future considerations.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Great but you misunderstood what I first posted. Yes changing the Draw command would break things but I suggested adding something different that can be used in new indicators or edited into existing indicators. Something lie "PDraw" which would use Draw objects but let them act like Plots. Probably would be too difficult anyway.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #8
                eDanny,

                That would be confusing as to when to use which one. Right now everything works as designed. If the script author fails to address the subtleties of CalculateOnBarClose there is nothing we can do about that indicator not working in that mode. It is up to the author to address these scenarios if they are trying to mimic a plot.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Lumbeezl, 01-11-2022, 06:50 PM
                31 responses
                817 views
                1 like
                Last Post NinjaTrader_Adrian  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                5 responses
                14 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by swestendorf, Today, 11:14 AM
                2 responses
                6 views
                0 likes
                Last Post NinjaTrader_Kimberly  
                Started by Mupulen, Today, 11:26 AM
                0 responses
                7 views
                0 likes
                Last Post Mupulen
                by Mupulen
                 
                Started by Sparkyboy, Today, 10:57 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X