Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw not working ??

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

    Draw not working ??

    This is very strange...I merged two indicators and everything is working fine...except it is not drawing horizontal lines...I put Print traces in and the code before and after the draw statement so evidently it is being executed...but there is no draw on the chart....this is a horizontal line and if I substitute a vertical line it is not drawn either...I've check all the parameters and they seem are correct...the vertical line is at bar 0, so at least that should draw...but it does not...

    how can I debug this...I have no idea where to start...???

    no messages in the Log

    the Draw is inside OnOrderUpdate, but it works just find in the original Indicator.


    Draw.HorizontalLine
    (
    this,
    positionPointerLabel,
    true, // autoscale
    e.AverageFillPrice,
    Brushes.Black,
    DashStyleHelper.Dash,
    4
    );​

    #2
    type "it works just fine in the original indicator"

    Comment


      #3
      Ok, more info....it seems it is drawing the horizontal line...at the bottom of the chart, not at the price I indicate...it is anchored correctly when I look at the properties...but it is not drawn at the anchor...it is at the bottom of the visible chart panel....and it stays at the bottom when I move the right price axis....

      the Locked property is checked

      Comment


        #4
        Ok, well, now the HorizontalLine is not showing on the chart..

        but surely the Draw is being executed....and the anchor is correct...but the line is either drawn at the bottom of the chart or does not appear at all....

        any ideas?

        Comment


          #5
          Hello llanqui,

          Thanks for your notes.

          You would need to further debug your logic in the script to understand exactly how it is behaving. To understand why the script is behaving as it is, such as not drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

          One line above the condition to call the Draw method, print out all the values of all the conditions being used.

          One line above the Draw method, print out the value the draw method is being drawn at to see how it is evaluating.

          Below is a link to a forum post that demonstrates how to use prints to understand behavior.
          https://ninjatrader.com/support/foru...121#post791121
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment


            #6
            yes, I've done that....am going to give up on this one and not combine the two indicators... :-)

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X