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

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
          Brandon H.NinjaTrader Customer Service

          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 JoMoon2024, Today, 06:56 AM
            0 responses
            6 views
            0 likes
            Last Post JoMoon2024  
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            17 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            5 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,786 views
            0 likes
            Last Post Leafcutter  
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Working...
            X