color bars

Questions about MultiCharts and user contributed studies.
Guest

color bars

Postby Guest » 19 Jun 2007

does anybody has the easylanguage code to paint the daily bars with color?

MultiCharts could have easily built it into the program, (it is available for candle sticks), but since it is not in the program, I have to use a easylanguage study to do the job.

I checked the studies included with MultiCharts, but I could not find any. I guess I have to dust off my coding skill and burn some midnight oil. Before I wreck my brain trying to write the code, does anybody has the code handy that he can share?

Many thanks in advance.


p.s. I will also try Google, but knowing how Google works, I will probably have to wade through 15 pages of search results before I can locate the code.

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 22 Jun 2007

Could you tell me how you'd like to paint your daily bars?

Guest

Postby Guest » 22 Jun 2007

Kate:

for example, if the close is higher, paint it blue, if the close is lower, paint it red ?

is it difficult to do ?

I know many charting programs have this feature built-in. I know it can be done with easylanguage, I was just surprised the code is not on the list. I mean you have the code for volume bars, which can be painted with up/down colors. It shouldn't be that difficult to do with the bars, should it?

many thanks if you can find the code for me. i am sure other mc users would find it useful and would appreciate to have it available on the study list. I have tried google but without any success. There are just too many things on google. I went through pages after pages, but could not find the code I want.

TIA

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 26 Jun 2007

Please try to use standard indicators: Avg Close > Avg Open and Avg Close < Avg Open, but please use the input equal to 1.

User avatar
ABC
Posts: 524
Joined: 16 Dec 2006
Has thanked: 111 times
Been thanked: 295 times
Contact:

Postby ABC » 26 Jun 2007

This might work for you:

Code: Select all

Inputs:
   UpColor   (blue),
   DnColor   (red),
   UnCngColor   (yellow);
   
Variables:
   BarColor   (0);
   
If Close > Close[1] then BarColor = UpColor
else
If Close < Close[1] then BarColor = DnColor
else
BarColor = UnCngColor;

Plot1(Open, "Open", BarColor);
Plot2(High, "High", BarColor);
Plot3(Low, "Low", BarColor);
Plot4(Close, "Close", BarColor);


You'll have to format the indicator as follows:
Scaling same as symol and Plot1 as "LeftTick", Plot2 "BarHigh", Plot3 "BarLow" and Plot4 "RightTick".

Regards,

ABC
These users thanked the author ABC for the post:
TJ

Guest

Postby Guest » 27 Jun 2007

it works !!!

thanks ABC.

KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 10 times

Re: color bars

Postby KhaosTrader » 18 Aug 2012

Hi,

I am trying to implement this code. However I dont know how to do the following:

Code: Select all

// You'll have to format the indicator as follows:
Scaling same as symol and Plot1 as "LeftTick", Plot2 "BarHigh", Plot3 "BarLow" and Plot4 "RightTick". //


Can you explain how to format the indicator?

Thanks!

User avatar
aiti
Posts: 41
Joined: 25 May 2009
Location: Germany
Has thanked: 43 times
Been thanked: 20 times

Re: color bars

Postby aiti » 18 Aug 2012

Hi KhaosTrader,

rightclick on your chart where you have the indicator on -> format indicator -> choose your indicator and click format ->
click on style-tab -> in the row of plot1 click on "Line" -> you get a scroll-list -> in your case choose "left tick"

Do the same for the other plots following the indicators instructions.

for scaling use the Scaling-tab -> Under "Scaling Range" choose "Same as instrument"

aiti :smile:

KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 10 times

Re: color bars

Postby KhaosTrader » 18 Aug 2012

Aiti,

Thanks for your prompt response, actually... I implemented the solution with this command (just an example):

Code: Select all

plotpaintbar(h,l,o,c,"",UpColor) else
plotpaintbar(h,l,o,c,"",OutsideBar );


during the painting of the current bar, as its moving up and down, will the bar update realtime? that is it will be one color, but if the condition changes it will update.. So as the above code would work, it could be UpColor in the beginning, then it can change to Outsidebar if the condition of the current bar changes realtime?

User avatar
TJ
Posts: 6583
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: color bars

Postby TJ » 18 Aug 2012

KhaosTrader wrote:Aiti,

Thanks for your prompt response, actually... I implemented the solution with this command (just an example):

plotpaintbar(h,l,o,c,"",UpColor) else
plotpaintbar(h,l,o,c,"",OutsideBar );

during the painting of the current bar, as its moving up and down, will the bar update realtime? that is it will be one color, but if the condition changes it will update.. So as the above code would work, it could be UpColor in the beginning, then it can change to Outsidebar if the condition of the current bar changes realtime?


re: will the bar update realtime?

Yes, it will update every tick, and change color accordingly in realtime.

KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 10 times

Re: color bars

Postby KhaosTrader » 18 Aug 2012

Awesome! Thanks :)


Return to “MultiCharts”