moving average paintbars
moving average paintbars
TS has a painbar setup so that one can color bars above a moving average one color and color price bars below a moving average a different color. i cannot find any way in multicharts to do this although i would think it should be simple. is any code available for this type of indicator?
thanks
wayne
thanks
wayne
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Re: moving average paintbars
Wayne, could you please post a samble code of this indicator? I'm not sure that understand you correctly. Thanks.TS has a painbar setup so that one can color bars above a moving average one color and color price bars below a moving average a different color. i cannot find any way in multicharts to do this although i would think it should be simple. is any code available for this type of indicator?
thanks
wayne
Hi Stanley. I am looking for a sample code. I know it is really simple but i dont know how to do it. Plot a 20 simple moving average on a chart. price bars closing above the 20SMA are blue colored and price bars closing below the 20SMA are red colored. All price bars are a solid color blue or red depending on if close above or below the SMA. This is available as a paintbar study in TS and is also available in esignal. thanks
Wayne
Wayne
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Code: Select all
inputs: Length( 14 ) ;
if AverageFC( Close, Length ) < AverageFC( Open, Length ) then
begin
PlotPaintBar( High, Low, "AvgC<AvgO" ) ;
end
else
NoPlot( 1 ) ; { unpaint the bar }
Code: Select all
inputs: Length( 14 ) ;
if AverageFC( Close, Length ) > AverageFC( Open, Length ) then
begin
PlotPaintBar( High, Low, "AvgC>AvgO" ) ;
end
else
NoPlot( 1 ) ; { unpaint the bar }
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Hi What i am asking is so simple i an frustrated that i cannot communicate it clearly. If a price bar closes above the 20 simple moving average then candle colors blue. If price bar closes below the 20 simple moving average then candle color red. it is best if this is realtime coloring as the bar progresses rather than just suddenly at the end of the bar. The color of the bar is always solid color and only determined by if the close is above or below the 20 simple moving average---NOT if it closed up or down.
thanks
wayne
thanks
wayne
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Set the indicator to update on every tick and not at the close of the bar.Hi What i am asking is so simple i an frustrated that i cannot communicate it clearly. If a price bar closes above the 20 simple moving average then candle colors blue. If price bar closes below the 20 simple moving average then candle color red. it is best if this is realtime coloring as the bar progresses rather than just suddenly at the end of the bar. The color of the bar is always solid color and only determined by if the close is above or below the 20 simple moving average---NOT if it closed up or down.
thanks
wayne
Hi What i am trying to get on multicharts which as i have mentioned exists for esignal and tradesstation is the indicator that ts support created for esignal--called moving average and price crossover. it is in your tssupport knowledgebase but only for esignal. can you write it for multicharts? the code you gave above does not cover the bar but that would still work what doesnt work REALTIME is that when it is at the moving average and going over and under it it ends upwith both colors on the price bar, not the one based on where the bar closed, so that code is really useless realtime.
I keep thinking you must not understand what i am asking about as it is so simple so i am hoping that by referencing your very own esignal study that does this it will be clearer. the download on the tssupport site is labelled strMA-Pcrsv.efs
thanks
wayne
I keep thinking you must not understand what i am asking about as it is so simple so i am hoping that by referencing your very own esignal study that does this it will be clearer. the download on the tssupport site is labelled strMA-Pcrsv.efs
thanks
wayne
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
-
- Posts: 117
- Joined: 08 Nov 2005
- Been thanked: 3 times
Is to easy......Hi that is not the problem, always been set to update every tick.
Code: Select all
imputs: lenght(20);
if average(close,lenght)> close them plotpaintbar(high,low,open,close,"down",red);
if average(close,lenght)< close them plotpaintbar(high,low,open,close,"up",green);
go properties of indicador enable (same as symbol) of Axis type scale
jose