Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom High and Low in indicator panel. How to fill in?

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

    Custom High and Low in indicator panel. How to fill in?

    Hi,

    Hopefully I can get some assistance with the following.

    I have a custom indicator in real time plotting a line for the high and a low for each bar, the problem I'm having is how do I fill the space in between the high and low? I just can't seem to find how to do this. If I use a Bar instead of a Line then every bar starts at zero.

    Appreciate your help.
    suprsnipes.

    #2
    Hello suprsnipes,


    You could use DrawRegion() to accomplish this.
    Here is the DrawRegion() Help Guide to assist you further.
    I have included below an example of how to use DrawRegion().
    Code:
    [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] [/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/SIZE][/FONT][FONT=Courier New][SIZE=2] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2]Initialize()[/SIZE][/FONT][/SIZE][/FONT][LEFT][FONT=Courier New][SIZE=2]        {[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            Add([/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"Hi"[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2]));[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            Add([/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"Lo"[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2]));[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            Overlay                       = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]        }[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            [/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]        [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2]OnBarUpdate()[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]        {[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            Hi.Set(High[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]            Lo.Set(Low[[/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                  [/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]                  DrawRegion([/SIZE][/FONT] [FONT=Courier New][SIZE=2][COLOR=#800000]"tag1"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] , CurrentBar, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2],Hi, Lo, Color.Empty, Color.Purple, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] );[/SIZE][/FONT][COLOR=#000000][FONT=Tahoma][LEFT][FONT=Courier New][SIZE=2]        }[/SIZE][/FONT][/LEFT][/FONT][LEFT][/LEFT][/COLOR][LEFT][/LEFT]
    [FONT=Courier New][SIZE=2][/SIZE][/FONT]

    [/LEFT]
    [/FONT][/COLOR]

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    172 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    88 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    129 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    208 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X