Problem with chart

#1
Hi,
I create an index which contains two equities. When i use default settings for "Plot" function the graph is ok, but when I use styleCandle the chart doesn't work properly..What should I amend in the code to have Candle instead of basic Line chart?

My code:

This works fine but Line chart is not what I wanted:

_SECTION_BEGIN("IND_XLF1");

a1=0.5*Foreign("@ESU13","c");
a2=0.5*Foreign("JPM","c");

c1=a1+a2;
Plot( c1, "IND1", colorBlack);

_SECTION_END();

This is not working well and looks strange..

_SECTION_BEGIN("IND_XLF");

a1=0.5*Foreign("@ESU13","c");
a2=0.5*Foreign("JPM","c");

c1=a1+a2;
Plot( c1, "IND", colorBlack, styleCandle );

_SECTION_END();

I attached PrtScr.
Thank you for help!
Marek
 

Attachments

#2
Because you are using close price only!

PlotOHLC() would be the one you are looking for.

But it makes not sense to plot HL of combined symbols because high and low can occur at different times for each participating symbol!


Ticker1 = ParamStr( "Input Symbol 1", Name() );
Ticker2 = ParamStr( "Input Symbol 2", Name() );

SetForeign( Ticker1 );
Open1 = O;
High1 = H;
Low1 = L;
Close1 = C;
RestorePriceArrays();

SetForeign( Ticker2 );
Open2 = O;
High2 = H;
Low2 = L;
Close2 = C;
RestorePriceArrays();
 
Last edited:

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?