Using paint bar to highlight previous bars [SOLVED]
Using paint bar to highlight previous bars
I would like to use paint bar to highlight the last (x) number of bars is this possible.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Using paint bar to highlight previous bars
I would like to use paint bar to highlight the last (x) number of bars is this possible.
That is a loaded question.
The short answer is YES and NO.
But I am sure you are going come back and ask "How"?
If you want to use the PlotPaintBar keyword, the answer is no.
But if your end goal is to make certain chart presentation,
you can always use the PLOT keyword and/or the SETPLOTCOLOR keyword to modify previous bars attributes.
Re: Using paint bar to highlight previous bars
Thanks for your response TJ, but I am no closer to back plotting bars.
I've tried using the plot function, I can plot H and low for 10 days ago today by Plotting h[10],L[10] but this plots the value today.
The issue is I can't back plot a bar after it has occurred.
I've tried using the plot function, I can plot H and low for 10 days ago today by Plotting h[10],L[10] but this plots the value today.
The issue is I can't back plot a bar after it has occurred.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Using paint bar to highlight previous bars
See post #3Thanks for your response TJ, but I am no closer to back plotting bars.
I've tried using the plot function, I can plot H and low for 10 days ago today by Plotting h[10],L[10] but this plots the value today.
The issue is I can't back plot a bar after it has occurred.
viewtopic.php?f=16&t=11713
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Using paint bar to highlight previous bars [SOLVED]
I would like to use paint bar to highlight the last (x) number of bars is this possible.
I'm not sure I understand this thread fully because I disagree with TJ here; previous bars can be highlighted with PlotPaintBar if you offset it with a certain amount of bars back, like this:Thanks for your response TJ, but I am no closer to back plotting bars.
I've tried using the plot function, I can plot H and low for 10 days ago today by Plotting h[10],L[10] but this plots the value today.
The issue is I can't back plot a bar after it has occurred.
Code: Select all
if (LastBarOnChart_s) then begin
// Plot a paint bar 2, 5, and 7 bars ago
PlotPaintBar[2](high[2], low[2], open[2], close[2], "PaintBar", yellow, black, 1);
PlotPaintBar[5](high[5], low[5], open[5], close[5], "PaintBar", yellow, black, 1);
PlotPaintBar[7](high[7], low[7], open[7], close[7], "PaintBar", yellow, black, 1);
end;
You can backplot a range of bars with a loop, like this:
Code: Select all
Variables:
x(0);
if (LastBarOnChart_s) then begin
// Plot a paint bar on the last five bars
for x = 0 to 4 begin
PlotPaintBar[x](high[x], low[x], open[x], close[x], "PaintBar", yellow, black, 1);
end;
end;
Does this solve the problem you're having, or did I misunderstand?
- Attachments
-
- scr.13-09-2015 16.18.37.png
- (1.8 KiB) Downloaded 781 times
-
- scr.13-09-2015 16.15.56.png
- (2.33 KiB) Downloaded 776 times
Re: Using paint bar to highlight previous bars
Josh
Your example code allowed me to do exactly what I wanted.
Thank You
Your example code allowed me to do exactly what I wanted.
Thank You