Candlestick chart in PowerLanuage code

Questions about MultiCharts and user contributed studies.
klkwan
Posts: 18
Joined: 10 Nov 2011

Candlestick chart in PowerLanuage code

Postby klkwan » 24 Nov 2011

Does it possible to create candlestick chart from the code??
I want to use True or False to make the chart between candlestick chart or Heikin-Ashi chart?
If I set the chart type in candlestick chart, once I switch to Heikin-Ashi which the chart will shows 2 of layer of that charts at the same time. How could I achieve it?? :(

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 24 Nov 2011

klkwan wrote:Does it possible to create candlestick chart from the code??
I want to use True or False to make the chart between candlestick chart or Heikin-Ashi chart?
If I set the chart type in candlestick chart, once I switch to Heikin-Ashi which the chart will shows 2 of layer of that charts at the same time. How could I achieve it?? :(


To make candle bar:

plot your High, Low, Open, Close,

set your plot in the following ways:

High = bar high, weight = thin
Low = bar low, weight = thin
Open = bar high, weight = thick
Close = bar low, weight = thick

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 24 Nov 2011

Hi, TJ

Much thanks for your teach.
I already code for candle in: PlotPaintBar( H, L, O, C, "", color );
But I don't know how to make: Open = bar high, weight = thick ??

Could you kindly list the code how to use your teaching method?

Much thanks!! :)

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 24 Nov 2011

klkwan wrote:Hi, TJ

Much thanks for your teach.
I already code for candle in: PlotPaintBar( H, L, O, C, "", color );
But I don't know how to make: Open = bar high, weight = thick ??

Could you kindly list the code how to use your teaching method?

Much thanks!! :)


don't use PlotPaintBar.

plot each data point individually.

Plot10( high, "H");
Plot11( low, "L");
Plot12( open, "O");
Plot13( close, "C");

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 24 Nov 2011

Hi, TJ

Thanks again. But I have no idea about the below code:
High = bar high, weight = thin;
Low = bar low, weight = thin;
Open = bar high, weight = thick;
Close = bar low, weight = thick;

How I can make it work in MC? Sorry about my stupid...

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 24 Nov 2011

klkwan wrote:Hi, TJ

Thanks again. But I have no idea about the below code:
High = bar high, weight = thin;
Low = bar low, weight = thin;
Open = bar high, weight = thick;
Close = bar low, weight = thick;

How I can make it work in MC? Sorry about my stupid...

no problem...

after you have applied the indicator to the chart,
right click on the chart.
Select Format Indicators,
choose your indicator,
the Format Study window will pop up,
click on the Style tab,
you will see the options to manage your plot.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 24 Nov 2011

Hi, TJ
Achieved my wanted charts effect. Much thanks!! :D

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 25 Nov 2011

klkwan wrote:Hi, TJ
Achieved my wanted charts effect. Much thanks!! :D

You are welcome.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 25 Nov 2011

Hi, TJ

I also have some questions. I knows I can adjust 'Status line' to show what data on top of chart. But I use over 6+ indicators in one chart.
And I only want to show a parts of my indictors' return value on chart. Don't need to shows all inputs & study value.
So, for the latest MultiCharts v7, does it can achieve the below effect:

1) Could I disable the 'Status line' to clear the top of chart, and code my designed 'Title' on the top of chart?
2) Some indicators I want to make the area-formed bars to list on the bottom of chart.

Example:
e1=XAverage(c,10);
e2=XAverage(c,20);
e3=e1-e2;
e4=e1>e2;

1) How to list below info onto the left top coner?
if c>c[1] AND c[1]>c[2] then
Title = Today, O,H,L,C, e3, message in "Buy trend"

2) How to plot area-formed bars in green/redon the bottom of chart
if e4 then
in Green square on the bottom of chart
else
in red square on the bottom of chart

Could you kindly list some example code for me to get more brain storm? And I can get it to use it for my other indicators. Sorry about my newbie.

Attached the example formed chart image.
Attachments
screen.jpg
screen.jpg (143.73 KiB) Viewed 325 times

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 25 Nov 2011

klkwan wrote:Hi, TJ

I also have some questions. I knows I can adjust 'Status line' to show what data on top of chart. But I use over 6+ indicators in one chart.
And I only want to show a parts of my indictors' return value on chart. Don't need to shows all inputs & study value.
So, for the latest MultiCharts v7, does it can achieve the below effect:

1) Could I disable the 'Status line' to clear the top of chart, and code my designed 'Title' on the top of chart?
2) Some indicators I want to make the area-formed bars to list on the bottom of chart.

Example:
e1=XAverage(c,10);
e2=XAverage(c,20);
e3=e1-e2;
e4=e1>e2;


Right click on the chart...
select Format Window
under the Status Line tab, you can choose various display options.


klkwan wrote:1) How to list below info onto the left top coner?
if c>c[1] AND c[1]>c[2] then
Title = Today, O,H,L,C, e3, message in "Buy trend"


check here:
http://www.tradersxchange.com/viewforum ... 19f3747292

look for an indicator called "Masthead".
it should get you some ideas.

klkwan wrote:2) How to plot area-formed bars in green/redon the bottom of chart
if e4 then
in Green square on the bottom of chart
else
in red square on the bottom of chart

Could you kindly list some example code for me to get more brain storm? And I can get it to use it for my other indicators. Sorry about my newbie.

Attached the example formed chart image.

not sure what you mean.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 28 Nov 2011

Hi, TJ

Thanks for your info. I think that I can get idea from there. Thanks a lot!

By the way, attached a chart that I highlight its' bottom bars. You can see it is plotted green or red square-area.
Also, there are 5 plotted bars on the bottom of chart which base on my 5 indicators' results to plot it.

Does MulitCharts can plot to this similiar bars on the bottom position of chart? How & What MC code can achieve it?
Attachments
screen-2.jpg
screen-2.jpg (50.51 KiB) Viewed 318 times

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 28 Nov 2011

klkwan wrote:Hi, TJ

Thanks for your info. I think that I can get idea from there. Thanks a lot!

By the way, attached a chart that I highlight its' bottom bars. You can see it is plotted green or red square-area.
Also, there are 5 plotted bars on the bottom of chart which base on my 5 indicators' results to plot it.

Does MulitCharts can plot to this similiar bars on the bottom position of chart? How & What MC code can achieve it?

There is no special coding required for those displays.
You just have to experiment with the plot style to come up the desired effect.

What you are looking at there could be 5 straight line plots, each set to a thick weight.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 28 Nov 2011

Hi, TJ

OK, then I only focus in PLOT command to plot the bottom bar.
But if use 'plot' command, e.g. is used on DJI:

Code: Select all

ma1=ma2>=ma3;
If ma1 then
macolor=green
else
macolor=red;
Plot3(0,"",macolor);

The straight bar is located on the bottom of chart. But the main chart will shrink to so short candle bars & lines.
If I set to Plot3(8000,"",macolor), then once I drag back to its past, and the Plot3 will be raised up onto the middle of chart. Also, it cannot be used for others due to set in '8000'.

So, does MultiCharts have not any method which can maintain the straight bar onto the bottom position??
Attachments
screen-3.jpg
screen-3.jpg (115.15 KiB) Viewed 330 times

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 28 Nov 2011

klkwan wrote:Hi, TJ

OK, then I only focus in PLOT command to plot the bottom bar.
But if use 'plot' command, e.g. is used on DJI:
ma1=ma2>=ma3;
If ma1 then
macolor=green
else
macolor=red;
Plot3(0,"",macolor);

The straight bar is located on the bottom of chart. But the main chart will shrink to so short candle bars & lines.
If I set to Plot3(8000,"",macolor), then once I drag back to its past, and the Plot3 will be raised up onto the middle of chart. Also, it cannot be used for others due to set in '8000'.

So, does MultiCharts have not any method which can maintain the straight bar onto the bottom position??


Please use code tag when posting codes. It makes reading easier.
(I have done it for you this time.)

You have to set the indicator as a subchart.

Format Study > Properties > Subchart

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 28 Nov 2011

Hi, TJ

Thanks a lot to put it onto code tag.
And my attached chart was already made fm sub-chart.
Could u kindly give me more hint how made it? Thanks!

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 28 Nov 2011

klkwan wrote:Hi, TJ

Thanks a lot to put it onto code tag.
And my attached chart was already made fm sub-chart.
Could u kindly give me more hint how made it? Thanks!


You should set the study property:

Format Study > Properties > Subchart

Image

the chart should show a separator between the main chart and the subchart.
The main chart and the subcharts have independent scales.

Image
Attachments
2011-11-28 22.2405.gif
2011-11-28 22.2405.gif (15.83 KiB) Viewed 441 times
2011-11-28 22.2506.gif
2011-11-28 22.2506.gif (18.28 KiB) Viewed 443 times

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 29 Nov 2011

Hi, TJ

I got it. Much thanks for your teaching. :-)

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 29 Nov 2011

klkwan wrote:Hi, TJ

I got it. Much thanks for your teaching. :-)

you are welcome.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 06 Dec 2011

Hi, TJ

I want to make my designed header and you had refered the below link for get ideas:
http://www.tradersxchange.com/viewtopic.php?f=36&t=417&sid=77b8da610de5793916405d38dfa4ca5f

However, I tried many times but fail to get its login account activate email, and I cannot contact its administrator too.

Could you kindly help where I can view that code for learn about it? Or any other referral links that I can view the similar function code?

Much thanks for your help. :(

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 06 Dec 2011

klkwan wrote:Hi, TJ

I want to make my designed header and you had refered the below link for get ideas:
http://www.tradersxchange.com/viewtopic.php?f=36&t=417&sid=77b8da610de5793916405d38dfa4ca5f

However, I tried many times but fail to get its login account activate email, and I cannot contact its administrator too.

Could you kindly help where I can view that code for learn about it? Or any other referral links that I can view the similar function code?

Much thanks for your help. :(

check your spam box... it is probably there.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 06 Dec 2011

Hi, TJ
I already checked it before from my gmail. And just tested to re-send the activate email again but still fail...

You are experience expert, any refer links that can let me to learn it.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 07 Dec 2011

Hi, TJ

Any update how make the header on the top of chart...

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 07 Dec 2011

klkwan wrote:Hi, TJ

Any update how make the header on the top of chart...

Just try to log in... some forums authenticate new accounts without sending notifications.

klkwan
Posts: 18
Joined: 10 Nov 2011

Re: Candlestick chart in PowerLanuage code

Postby klkwan » 07 Dec 2011

Hi, TJ

Then, how I can get the code for learning?

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Candlestick chart in PowerLanuage code

Postby TJ » 07 Dec 2011

klkwan wrote:Hi, TJ

Then, how I can get the code for learning?

the code is posted in the thread.


Return to “MultiCharts”