moving average paintbars

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
traderwep1

moving average paintbars

Postby traderwep1 » 16 Feb 2007

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

momentum
Posts: 315
Joined: 23 Nov 2005
Has thanked: 8 times
Been thanked: 14 times

Postby momentum » 16 Feb 2007

Exactly the same as TS. Its just a study with the PaintBar commands.

Guest

Postby Guest » 16 Feb 2007

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

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Re: moving average paintbars

Postby Stanley Miller » 19 Feb 2007

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.

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 19 Feb 2007

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

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 19 Feb 2007

This is available as a paintbar study in TS


Could you please post this study? Thanks.

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 19 Feb 2007

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

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 19 Feb 2007

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 }

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 19 Feb 2007

Hi Stanley. Thanks. This code does not seem to work properly on a 377 contract russell chart with a 20SMA .

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 19 Feb 2007

What do you mean by doesn't work properly? Please be more specific.

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 20 Feb 2007

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

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 20 Feb 2007

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

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 21 Feb 2007

Please post a screenshot. Thanks.

momentum
Posts: 315
Joined: 23 Nov 2005
Has thanked: 8 times
Been thanked: 14 times

Postby momentum » 21 Feb 2007

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?

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 21 Feb 2007

yes i have. thanks

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 22 Feb 2007

Mult doesnt seem able to support this simple study so i will go back to esignal for now which has it standard.

wayne

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 22 Feb 2007

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?

Guest

Postby Guest » 22 Feb 2007

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.

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 03 Mar 2007

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

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 03 Mar 2007

Set the indicator to update on every tick and not at the close of the bar.

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 05 Mar 2007

Hi that is not the problem, always been set to update every tick.

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 05 Mar 2007

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

traderwep
Posts: 46
Joined: 02 May 2006

Postby traderwep » 05 Mar 2007

Hi Jose

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

wayne


Return to “User Contributed Studies and Indicator Library”