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

Re: foreigh



PureBytes Links

Trading Reference Links

Jon,

If you are doing extensive optimization retesting on one or two 
stocks, here is an approach that is working well for me as I am in 
the middle of extensive backtesting of variations on a single ETF. 
It takes some time to set up, but optimization retesting is 
lightening fast. The following example is a bit simplier than I use 
because I build a custom indicators from 50+ stocks in Excel, but the 
following will give the general idea. 

1. Export all the data for a stock (such as IBM).
2. Import it into Excel.
3. Import the "foreign" data into Excel (I'll use the DJIA for 
illustration purposes).
4. Double check that the dates match for the stock data and the 
foreign data. One could write an Excel function to do this, but 
I just eyeball it. Usually if one gets the first date to match the 
rest match up with almost no further changes.
5. Save the new data as a csv file giving it a compound name such as 
IBMxDJIA.
6. Use the import wizard in AB to select the data one wants from each 
of the components. Currently there are only 6 data slots in AB (Open, 
High, Low, Close, Volume, Open Interest), so you will have to decide 
which IBM data to drop to get a space for what you want from the 
DJIA. Since my indicator forumulas usually ignore Volume, that is 
where I usually stick the first "foreign" data set. I like to use the 
Volume slot because whatever is in Volume is automatically displayed 
in the background of AB's default chart. It's nice to see how the 
foreign indicator relates to the price movement. 
7. If I need a second "foreign" data set, I have AB import it into 
the OI slot since I never use OI. If needed one could put foreign 
data into the High and Low slots, but that often produces charts that 
look very confused and it might affect any stop loss elements, so I 
try to leave H and L unchanged. Also I make sure all my custom 
indicators are above zero since I don't know how AB would react if a 
stock has negative volume for a day.
8. I then make a custom version of my indicator formula which could 
be named IBMxDJIAxBuyLowSellHigh and on the first line of the formula 
I include a note recording what data is in each of the 6 stock data 
points in the combo stock IBMxDJIA: for example, 
//O = Open of IBM
//C = Close of IBM
//V = Close of DJIA
//OI = Open of DJIA

9. Any backtesting using this combo stock (IBMxDJIA) is lightening 
fast. 

10. I hope the need for the above will disappear at some point in the 
future if AB includes a match feature. 

Hope this helps in the meantime.

b

--- In amibroker@xxxx, "jonf" <jonf_ca@xxxx> wrote:
> Thank a lot for this Tomasz,
> 
> Using foreign only once help a little but Is it possible to avoid 
calculation (not only for foreign, but for everything) each time we 
use the scroll bar !
> 
> Jon !