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

coding exit points in AFL; multiple exits



PureBytes Links

Trading Reference Links

Folks,

This software looks like it could be what I have been looking for. 
Up until now, it did not appear that other systems had what I needed 
in terms of scanning, filtering and backtesting regardless of money 
spent, so I have been writing perl scripts, using Mysql as a 
repository and importing data from TC2000. It works, but very time 
consuming to test out new formulas.

Before I buy, I have a backtesting question. Well, actually 2 
questions. 

1. If you pre-selected a small group of stocks from a universe using 
the filter mechanism in the software and now want to backtest a 
money management strategy, how do you make sure that the exit 
actually happens at the exit stop. Somehow, it looks like the profit 
number from a trade uses the "sell price" rather than the "profit 
target percent" specified in the Settings tab. For example, for a 
given stock produced by a filter, I may want to buy at the open on 
the day after the stock met the filter criteria and then sell at 2 
percent higher than that. Let's also suppose that the stock performs 
in the following manner on the day that the purchase happens:

XYZ: open=100, high=105, low=100, close=101

In this scenario, I would expect an exit at 102 and register a 
profit of 2 percent for this transaction.

Somehow, the way that I have been coding it produces a bigger number 
than 2 percent profit even though I specify "profit target percent" 
of 2 percent. I am sure that it is not difficult, but I don't know 
what I am doing wrong. I have been using the settings tab to do this 
rather using the applystop function in AFL. Could someone supply the 
specific backtest code for doing this? 

2. Can this software support multiple exit points? For example, a 
limit of 2 percent above the purchase price and stop of 2 percent 
below the purchase price? What would be the AFL code for this.

Thanx a lot,
Phil