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 ZeroKuhl, Yesterday, 04:31 PM
            8 responses
            42 views
            0 likes
            Last Post ZeroKuhl  
            Started by reynoldsn, Today, 07:04 PM
            0 responses
            6 views
            0 likes
            Last Post reynoldsn  
            Started by puapwr, Today, 06:09 PM
            0 responses
            4 views
            0 likes
            Last Post puapwr
            by puapwr
             
            Started by franciscog21, Today, 05:27 PM
            0 responses
            10 views
            0 likes
            Last Post franciscog21  
            Started by hdge4u, 04-29-2024, 12:23 PM
            5 responses
            28 views
            0 likes
            Last Post MisterTee  
            Working...
            X