amibroker code question

I am interested in updating some code. Currently, the formula looks to index X to determine a trigger. If it triggers, the formula will buy based on the criteria of the backtest. Can I have it purchase A stock is X index is up and B stock if X index is down? In other words, I would like to specify which stocks to buy depending on x index or other criteria. Thanks.
 
Quote from skanker:

I am interested in updating some code. Currently, the formula looks to index X to determine a trigger. If it triggers, the formula will buy based on the criteria of the backtest. Can I have it purchase A stock is X index is up and B stock if X index is down? In other words, I would like to specify which stocks to buy depending on x index or other criteria. Thanks.

As a programming nerd and beginnner I would set up the buy formula for each potential underlying separately within the portfolio. The Buy/Sell condition I would code via the "Foreign" function.

Not truly elegant, but I`m only a nerd and programming dummy.

Regards

Hittfeld
 
Back
Top