[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: composite



PureBytes Links

Trading Reference Links

> Would anyone be so kind as to provide me with an efficient means
> of making a  composite data series to combine several symbols into 1
>  data stream for intraday realtime charting. 

You can use something like the following.  I wrote this for someone 
who wanted to approximate realtime S&P data without realtime data.  
(Indices like SPX and @PREM aren't delayed.)  I included the "Shift" 
input so he could plot the synthetic "S&P" alongside his (delayed) SP 
data.  If you want realtime results, leave Shift 0, or just delete 
the Shift references entirely.

Put SPX in data1 and @PREM in data2.  Change the Style of the 
indicator so Plot1 is Left Tic, Plot2 is Bar High, etc.

If you need to combine more than 2 data series, just change the 
calculations of rto/rth/rtl/rtc to include data3, data4, etc.

Gary


Inputs: Shift(0);
Vars: rto(0), rth(0), rtl(0), rtc(0);

rtc = Close[Shift] of data1 + Close[Shift] of data2;
rto = Open[Shift] of data1 + open[Shift] of data2;
rth = High[Shift] of data1 + High[Shift] of data2;
rtl = Low[Shift] of data1 + low[Shift] of data2;

Plot1(rto,"RTOpen");
Plot2(rth, "RT High");
Plot3(rtl, "RT Low");
Plot4(rtc, "RT Close");