Paint bars
-
- Posts: 6
- Joined: 25 Aug 2007
Paint bars
Would like to know how to plot bars based on close above or below 8 period moving average close.
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2228 times
you need to describe a bit more on what you want to achieve.
p.s. paintbar is not difficult to do. I can help you with some examples if you want.
p.s. paintbar is not difficult to do. I can help you with some examples if you want.
Last edited by TJ on 18 Apr 2008, edited 1 time in total.
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Re: Paint bars
Hi Gary,Would like to know how to plot bars based on close above or below 8 period moving average close.
It is not quite clear what exactly you are trying to do. Could you please give us more details?
-
- Posts: 60
- Joined: 21 Dec 2007
- Has thanked: 3 times
- Been thanked: 9 times
@Gary
Try this:
{Indikator: Paintbar Moving Average}
inputs: Price(Close), Length(8), Displace(0);
variables: avg(0);
avg = Average( Price, Length );
if Displace <= 0 then
begin
if Price >= avg then PlotPaintBar(H,L,O,C, "Price > avg",green )
else begin
if Price < avg then PlotPaintBar(H,L,O,C, "Price < avg",red )
end;
end;
Try this:
{Indikator: Paintbar Moving Average}
inputs: Price(Close), Length(8), Displace(0);
variables: avg(0);
avg = Average( Price, Length );
if Displace <= 0 then
begin
if Price >= avg then PlotPaintBar(H,L,O,C, "Price > avg",green )
else begin
if Price < avg then PlotPaintBar(H,L,O,C, "Price < avg",red )
end;
end;
- Attachments
-
- MavgPB.png
- (39.28 KiB) Downloaded 376 times