How to 'combine' elements of a foreign stock

is there a way to 'combine' elements of a stock (H, L,O, & C) imported through foreign function to plot it on a bar or candle graph? (with out using setforeign -or doing it so I can still use other stocks in code)
thanks for any help! - simple example below.

c1=Foreign("wow","c",TRUE);
h2=Foreign("wow","o",TRUE);
h2=Foreign("wow","h",TRUE);
l3=Foreign("wow","h",TRUE);
v3=Foreign("wow","v",TRUE);

Plot( c1, "WOW Price", colorDefault, stylebar );  //plot a bar graph of WOW price including correct open close high & low values
Plot( C, "current ticker price" , colorDefault, styleBar );

see AFL Function Reference - PLOTOHLC (amibroker.com)

You can supply all 4 custom arrays.

There is a typo in l3 variable.

4 Likes

Thank you I have not come across this function before and is exactly what I was looking for!
(and yes, I see now that I made a couple of typos in my example..)

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.