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

How to calculate OHLC for synthetic index



PureBytes Links

Trading Reference Links

Hello

I have a portfolio of stocks from which I want to create a synthetic index
consisting of O,H,L & C daily prices. I am using the ValueLIneArithmetic Index
formula for calculating the Index which is as follows:

The ValueLineArithemetic is calculated in the following manner. First, compute the
ratio of every stock's price change from the previous day (Pn/Pn-1). Next, add all
of the ratios together. Finally, divide the total by the number of stocks.
Multiply yesterday's Index value by this result to get today's value of the Index

I am getting some strange results, namely that sometimes my Highs for the some
days is less than than other O, L or C values.

This is how I do my calculations.
For the First day of collecting data I make Close = 1000

I then calculate the averages of O H L C for the portfolio of stocks for that day,
then

Open = (AvgOpen/AvgClose)*1000
High = (AvgHigh/AvgClose)*1000
Low = (AvgLow/AvgLow)*1000
Close = (AvgClose/AvgClose)*1000 = 1000

Given this first days's of OHLC data for the Index I calculate the value of
subsequent days given by the formula above for ValueLineAritmetic. I calculate
the  price changes of all the Highs (say), find the average, and multiply this by
yesterdays value of High  to get today's value of High for the Index.

Something is obviously wrong, but I can't for the life of me figure it out.
Does anybody have any suggestions
Thanks in anticipation
K