Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawHorizontalLine/Autoscale

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

    DrawHorizontalLine/Autoscale

    It appears that autoscale is always set to true when drawing a horizontal line even if false is specified...

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Initialize()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]CalculateOnBarClose = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Overlay = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]PriceTypeSupported = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]DrawHorizontalLine([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"line1"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]], Color.Blue, DashStyle.Solid, [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [/SIZE][/FONT]
    Last edited by hemlock; 05-04-2009, 11:59 AM.

    #2
    I am not getting the behavior you described. I get a line drawn at Close[0] which is expected. As I scroll back the line does not stay in view because AutoScale = false.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      That's odd. It may have something to do with the 'default' for manually drawn lines. Try setting the default to autoscale=true for a manually drawn horz line and then try the script again.
      Last edited by hemlock; 05-04-2009, 12:19 PM.

      Comment


        #4
        hemlock,

        No difference. Manually draw lines should not influence your code. Please ensure you have no other indicators/draw objects on the chart that may give the illusion your line is on AutoScale = true when set to false.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          Hmmm, not true here.

          Preparation:
          1. Close and restart NinjaTrader version 6.5.1000.9.
          2. Close all NT windows except Control Center.
          3. Connect to Interactive Brokers.

          Test #1:
          1. Open ES 5 minute chart using default template (price bars and VOL only)
          2. Press F6 to manually draw horizontal line.
          3. Double click on horizontal line to edit properties.
          4. Turn autoscale ON, click apply, click "set default".
          5. Delete manually drawn line.
          6. Add indicator kpTest3 (see attached).
          7. Double click on script generated horizontal line. Autoscale is set to true (should not be).
          8. Close chart.

          Test #2:
          1. Open ES 5 minute chart using default template (price bars and VOL only)
          2. Press F6 to manually draw horizontal line.
          3. Double click on horizontal line to edit properties.
          4. Turn autoscale OFF, click "apply", click "set default".
          5. Delete manually drawn line.
          6. Add indicator kpTest3 (see attached).
          7. Double click on script generated horizontal line. Autoscale is set to false (correct).
          8. Close chart.
          Attached Files

          Comment


            #6
            We will look into it. Thank you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thank you for bringing this up. It will be addressed in a future version.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CarlTrading, Yesterday, 11:51 AM
              0 responses
              18 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, Yesterday, 11:48 AM
              0 responses
              23 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-25-2026, 09:53 PM
              0 responses
              27 views
              0 likes
              Last Post CaptainJack  
              Started by CaptainJack, 03-25-2026, 09:51 PM
              0 responses
              15 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 03-23-2026, 11:13 AM
              0 responses
              22 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X