ESPL: Custom Index from 125 symbols
|
Q: I am interested in the ability to create a custom index. What I am trying to accomplish is the ability to take approximately 125 stocks that I choose and index them creating my personal index. I would like to be able to compare them with the S&P 500 in real time by way of a bar chart. I want to know if it can be done on any time frame, and if it can be looked back at for a few weeks or month.
A: For that many symbols you would have to use ESPL to read the stock values from the quote table, use math to create your index, and then write the answer back to the quote table. This is demonstrated in this ESPL example:
procedure UserDefinedSymbols;
var price: real;
begin
if (TimeStr >= '07:20') and (TimeStr <= '14:00') then begin
SetMarket(eFuture);
price:= Get('SF8Z') + Get('JY8Z') + Get('DM8Z');
Update('SFJYDM',price,4);
end;
end;
There would not be any history other than what you accumulate by having the ESPL run during the day each day.
Last modified 1/30/08 2:11 AM
|