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

DrawOnPricePanel

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

    DrawOnPricePanel

    Working on what should be a simple add-on, but the output is not working as programmed. If you look at the photo, you will see the 'CrossAbove' is plotting on the indicator panel (as programmed), but the 'CrossBelow' will only post in the price panel (it is also suppose to be in the indicator panel). I have changed the syntax order...putting 'CrossBelow' on top (and on bottom); did a cut-and-paste, deleted the cut-and-paste, typed it in fresh, added it to different charts, but the 'CrossBelow' will not print on the indicator panel. Any suggestions?

    Thanks in advance!!!!

    if (CrossAbove(K, 35, 1))
    { DrawVerticalLine("CrossUp", 0, Color.Blue, DashStyle.DashDotDot,5);
    DrawOnPricePanel = false;
    }

    if (CrossBelow(K, 65, 1))
    { DrawVerticalLine("CrossDown", 0, Color.Black, DashStyle.DashDotDot,5);
    DrawOnPricePanel = false;
    }
    Attached Files
    Last edited by phoenix; 05-06-2010, 11:32 PM.

    #2
    Hi phoenix,

    In most cases DrawOnPricePanel = false; should be put in the Initialize(), unless you have a specific reason not to.

    Otherwise, put it before your Draw statement....

    if (CrossBelow(K, 65, 1))
    {
    DrawOnPricePanel = false;
    DrawVerticalLine("CrossDown", 0, Color.Black, DashStyle.DashDotDot,5);
    }

    More info at - http://www.ninjatrader-support.com/H...awPriceOnPanel
    TimNinjaTrader Customer Service

    Comment


      #3
      phoenix,

      Let us know if that works because I didn't think you could do that...and I thought I tested it at some point. Anyway, if you can that would be great to know!
      Last edited by mountainclimber; 05-07-2010, 10:01 AM.

      Comment


        #4
        Hey NT Tim,

        Thanks!!! That worked. I had formatted a couple of indicators with the 'DrawUp(Down)Arrow' function in it, to draw those on the indicator panel, I had to include the "DrawOnPricePanel = false;" as written below, and simply did the same with this.

        The only programming class I had was in college in 1984, and that was in Fortran. ;-)

        So, I am learning by trial and error here.

        Thanks for your help.

        phoenix

        Comment


          #5
          Hi phoenix,

          Great! Glad to hear you've got it up and running!

          Aww, Fortran, now that's old school!
          TimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          12 responses
          3,239 views
          0 likes
          Last Post Leafcutter  
          Started by AveryFlynn, Today, 04:57 AM
          0 responses
          5 views
          0 likes
          Last Post AveryFlynn  
          Started by RubenCazorla, 08-30-2022, 06:36 AM
          3 responses
          79 views
          0 likes
          Last Post PaulMohn  
          Started by f.saeidi, Yesterday, 12:14 PM
          9 responses
          25 views
          0 likes
          Last Post f.saeidi  
          Started by Tim-c, Today, 03:54 AM
          0 responses
          5 views
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Working...
          X