Page 1 of 1

moving average paintbars

Posted: 16 Feb 2007
by traderwep1
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

Posted: 16 Feb 2007
by momentum
Exactly the same as TS. Its just a study with the PaintBar commands.

Posted: 16 Feb 2007
by Guest
I am sorry i dont understand what you are telling me. TS has something like >avg and <avg that can be paint bar so you set the average at say 20 and the bars color above or below. I dont see where that is in multicharts.

wayne

Re: moving average paintbars

Posted: 19 Feb 2007
by Stanley Miller
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
Wayne, could you please post a samble code of this indicator? I'm not sure that understand you correctly. Thanks.

Posted: 19 Feb 2007
by traderwep
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

Posted: 19 Feb 2007
by Stanley Miller
This is available as a paintbar study in TS
Could you please post this study? Thanks.

Posted: 19 Feb 2007
by traderwep
Hi I dont have TS so i cant post it. I am told it is based on an indicator or function called <avg and >avg to create the paintbars.

wayne

Posted: 19 Feb 2007
by Stanley Miller

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 }

Posted: 19 Feb 2007
by traderwep
Hi Stanley. Thanks. This code does not seem to work properly on a 377 contract russell chart with a 20SMA .

Posted: 19 Feb 2007
by Stanley Miller
What do you mean by doesn't work properly? Please be more specific.

Posted: 20 Feb 2007
by traderwep
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

Posted: 20 Feb 2007
by traderwep
Hi I worked with your code above and have it working now somewhat crudely. I think it is accurate on the bars, but the bar high and bar low do not cover the entire price bar all the time. so some bars have a different color middle :-)

thanks

wayne

Posted: 21 Feb 2007
by Stanley Miller
Please post a screenshot. Thanks.

Posted: 21 Feb 2007
by momentum
so some bars have a different color middle :-)
Have you clicked the radio button on the SCALING page of the indicator to make it SAME AS SYMBOL?

Posted: 21 Feb 2007
by traderwep
yes i have. thanks

Posted: 22 Feb 2007
by traderwep
Mult doesnt seem able to support this simple study so i will go back to esignal for now which has it standard.

wayne

Posted: 22 Feb 2007
by Stanley Miller
Mult doesnt seem able to support this simple study so i will go back to esignal for now which has it standard.

wayne
Please post the screenshot of what you have. Can you do it?

Posted: 22 Feb 2007
by Guest
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
Set the indicator to update on every tick and not at the close of the bar.

Posted: 03 Mar 2007
by traderwep
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

Posted: 03 Mar 2007
by Stanley Miller
Set the indicator to update on every tick and not at the close of the bar.

Posted: 05 Mar 2007
by traderwep
Hi that is not the problem, always been set to update every tick.

Posted: 05 Mar 2007
by gregorio123456
Hi that is not the problem, always been set to update every tick.
Is to easy......

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

Posted: 05 Mar 2007
by traderwep
Hi Jose

Thanks so so much. That was exactly what i needed i just could not do it myself.

wayne