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

NASDAQ signals: Ideas welcome



PureBytes Links

Trading Reference Links

I'm new to Amibroker and have been looking over the past posts with 
interest. I found 3778 and related posts especially helpful since I 
too am looking at a way to use Nasdaq info as a guide for trading the 
QQQ as well as individual stocks in the QQQ. The AFL code solution in 
post 3778 looks elegant and powerful for bring in the the Nasdaq 
composite with the foreign function. It is fine example of how 
elegantly powerful Amibroker can be. Tomasz is doing great work. 

My goal is to produce an indicator built upon price 
action of INDIVIDUAL stocks rather than the entire IXIC composite. 
Here is a simplified procedure used to keep the discussion from 
getting hung up on the indicator details. Is there a better way to go 
about coding the construction of an indicator which may be build upon 
100 to 200 stocks? 

// get the 1st stock and overwrite the QQQ price arrays:
High = foreign( "NT", "H" );
Open = foreign( "NT", "O" );
// do the first step in constructing the indicator (NNNI) by
// increasing the indicator's count, or decreasing it.
iif (H-O)>(H(1)-O(1)) and (H(2)-O(2))>(H(1)-O(1)) 
Then NNNI == NNNI + 1;
iif (H-O)<(H(1)-O(1)) and (H(2)-O(2))<(H(1)-O(1)) 
Then NNNI == NNNI - 1;
// Now get the 2nd stock and redo the calculations and
// increase or reduce the NNNI appropriately. 
High = foreign( "CSCO", "H" );
Open = foreign( "CSCO", "O" );
iif (H-O)>(H(1)-O(1)) and (H(2)-O(2))>(H(1)-O(1)) 
Then NNNI == NNNI + 1;
iif (H-O)<(H(1)-O(1)) and (H(2)-O(2))<(H(1)-O(1)) 
Then NNNI == NNNI - 1;
// Now get the 3rd stock and so on for 100 to 200 times. 
// Yes there will be a lot of calculations to build
// the indicator. Finally the trading calls can be set to buy
// when the NNNI is above 40 (ie about 20%)
buy NNNI > 40;
sell NNNI < -40;
short NNNI < -40;
cover NNNI > 40;

Questions:

1. Will the above work? Will all the calculations slow Amibroker down 
too much? I hope to do back tests from 1985 to the present so there 
will be a LOT of calcuations (200 stocks * 250 days/year * 15 years). 
And the study will involve many back tests with various entry/exit 
strategies. If there is a significant lag due to calculations, I'll 
feel it.

2. Some back testing will use strategies that call for buying the QQQ 
at the Open price, but will this data be available? The above code 
has the Open data replaced with that of the foreign stocks. Is there 
a way to re-set the Open data array back to the QQQ for backtested?

3. Several indicator stocks will need to be replaced over the 15 year 
test period. For example, IWOV only goes back a few years. Is it 
possible to tell Amibroker to use one stock for 1985 to 1990, and 
replace it with another for 1991-1998, and replace that one with yet 
another from 1999-present when building an indicator? 

4. The more I think about the above problems, the more I wonder if 
the simplest approach would be do use a hugh Excel spreadsheet. It 
could construct the indicator by crunching all the numbers for the 
individual stocks. Substitution stocks could be inserted manually. 
Once completed, Excel could produce an ASCII file holding
the indicator data. This indicator (and indicator file) could then be 
given a stock-like name (I like NNNI since this ticker is not used by 
any stock at present) brought in just like the IXIC call in post 
3775. 

Any ideas or suggestions would be most welcome.