Indicator value as Candle-Chart

Questions about MultiCharts and user contributed studies.
User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Indicator value as Candle-Chart

Postby konstantin » 31 Dec 2009

Hi,

Is it possible to show an indicator value as Candles?
(Open, High, Low, Close values of the indicator through "Update on every tick").

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 31 Dec 2009

in the Format Study window,

under Style tab

set the following Plot type to Bar High

Open
High

set the following Plot type to Bar Low

Close
Low

set the following Weight to thick

Open
Close

set the following Weight to thin

High
Low

User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Postby konstantin » 31 Dec 2009

Thanks TJ.

I'm not sure how to do this.

The indicator I want to plot has only one value.
I plot it e.g. below a 5 minute chart. Since I have set the "Update on every tick" to true, the indicator value changes constantly during the 5 min price bar is building.
So the indicator value has an open, high, low, close, but these values are not generated by the code, these values should be generated by the different indicator values during updating "tick by tick".

I hope this is understandable.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 31 Dec 2009

Thanks TJ.

I'm not sure how to do this.

The indicator I want to plot has only one value.
I plot it e.g. below a 5 minute chart. Since I have set the "Update on every tick" to true, the indicator value changes constantly during the 5 min price bar is building.
So the indicator value has an open, high, low, close, but these values are not generated by the code, these values should be generated by the different indicator values during updating "tick by tick".

I hope this is understandable.

can you draw a picture?
with notes on the picture illustrating your thoughts?

User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Postby konstantin » 31 Dec 2009

It's very simple:

On a 5 min candlechart:
The price-candlechart has open, high, low and close, but there is only one value which builds the candlechart during the 5 minutes, it is price.

I want the same with an indicator-value: Instead of price, the indicator value builds the indicator-candlechart during the 5 minutes (in an indicator pane).

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 31 Dec 2009

it can be done...

may I suggest the first post in this thread:
http://forum.tssupport.com/viewtopic.php?t=6929

User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Postby konstantin » 31 Dec 2009

Which page?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 31 Dec 2009

Which page?

if you are interested in maximizing the power of MultiCharts for your inquisitive analysis...
it is not too much trouble to read the whole thing.

User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Postby konstantin » 31 Dec 2009

Thanks.

Maybe someone else can help me:
How can I make candlesticks from an indicator value which is updating on every tick. TJ told me it is basic Easy Language.
I would appreciate your help, maybe someone can post a sample code.
Thank you.

User avatar
RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 13 times
Contact:

Postby RobotMan » 01 Jan 2010

lol.
Horse --> Water


Try:
Intrabarpersist
Set H and L variables
Use paintbar

User avatar
konstantin
Posts: 69
Joined: 24 Dec 2007
Location: Europe
Has thanked: 2 times
Been thanked: 1 time

Postby konstantin » 04 Jan 2010

If anyone is interested, I made this code.
Maybe not perfect but it works.

Code: Select all

{Attention: Updates in Realtime only!
20090104
Konstantin }


inputs: UpColor( RGB(0,255,0)),DnColor( RGB(255,0,0) ), candlewickcol(blue);
vars: intrabarpersist indicatorvalue(0), intrabarpersist mycurrentbar(0), intrabarpersist IndClose(0), intrabarpersist IndOpen(0), intrabarpersist IndHigh(0),
intrabarpersist IndLow(0), intrabarpersist color(0), IndOpCl(0);

{Put any code for indicatorvalue here:}
indicatorvalue = Average(Close, 3);

if currentbar > mycurrentbar then begin
IndOpen = indicatorvalue;
IndHigh = indicatorvalue;
IndLow = indicatorvalue;
IndClose = indicatorvalue;
end;

mycurrentbar = currentbar;

If mycurrentbar = currentbar then begin
If indicatorvalue > IndHigh then IndHigh = indicatorvalue;
If indicatorvalue < IndLow then IndLow = indicatorvalue;
IndClose = indicatorvalue;
end;

if IndClose > IndOpen then
color = UpColor
else
color = DnColor;

IndOpCl = Indopen;

plot1(IndOpen, "O", color);
plot2(IndHigh, "H", candlewickcol);
plot3(IndLow, "L", candlewickcol);
plot4(IndClose, "C", color);
If Indopen = IndClose then plot5(IndOpCl, "OC", candlewickcol)
else
NoPlot(4);
Plot-Settings see attachment.
Attachments
Settings.jpg
(109.24 KiB) Downloaded 994 times

User avatar
RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 13 times
Contact:

Postby RobotMan » 04 Jan 2010

Sweet!


Return to “MultiCharts”