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

% Grid Line

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

    % Grid Line

    I would like to have a line at a specific location in the indicator window. For example at the 80% Grid level. Is this possible?

    #2
    If you use any of the provided Draw() methods, you must put in an absolute y value. Provided that the indicator was showing a value of 0 through 100 (such as stochastics) then you would just put in a value of 80 for the y value parameter in a Draw() method.

    If you want to draw a line at 80% level in reference to the overall drawing space (pixels) this can be done by overriding the Plot() method. Doing this is advanced and requires some understanding of the .NET graphics class. You can see the CustomPlotSample indicator for reference.
    RayNinjaTrader Customer Service

    Comment


      #3
      Fair enough.

      I would like to plot on the "Zero Line" a changing line. When the Regression Channel is rising I would like to plot a "Green" Line, when the Regression Line is falling I would like to plot a "Red" Line. I'm having problems implementing this. I've attached a the indicator so you could see what I'm trying to do.

      edit: That's a bad example, as I don't have the zero line changing colors. But I think you get the idea.
      Attached Files

      Comment


        #4
        Would just having the zero line dynamically change color be sufficient? If yes, just do something like:

        if (rising)
        Lines[0].Pen.Color = Color.Green;
        else
        Lines[0].Pen.Color = Color.Red;

        Where [0] references the index where the zero line resides in the Lines collection. If you only have one line in the indicator, it would be index 0.
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks Ray for your help. I wish I was better at this stuff.

          Comment


            #6
            I think I'm getting close -- but I still can't seem to get it. My indicator is very similar to Woodies CCI that's why I was asking to see the code, it would have helped immensely.
            Attached Files
            Last edited by AO76; 07-07-2007, 03:58 PM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by f.saeidi, Today, 10:19 AM
            0 responses
            0 views
            0 likes
            Last Post f.saeidi  
            Started by kujista, Today, 06:23 AM
            4 responses
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by traderqz, Yesterday, 09:06 AM
            2 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by traderqz, Today, 12:06 AM
            3 responses
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X