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

[amibroker] Re: AmiBroker 4.48.0 BETA released->MFE



PureBytes Links

Trading Reference Links

ten years ago !!! I was asking you for MAE and MFE, Thanks Tomasz+++

stephane

below the MFE:

Reprinted from Technical Analysis of STOCKS & COMMODITIES magazine. © 
1999 Technical Analysis Inc., (800) 832-4642, http://www.traders.com
SYSTEM DESIGN
The Maximum Favorable
Excursion Strategy
Maximum favorable excursion (MFE) is the peak profit that
a trade earns before the trade is closed out. Reviewing the
performance of a trading system allows us to measure the
tendency of the MFE of the trades. This article explains how
to use the information to enhance profitability.
by David C. Stendahl and Leo J. Zamansky
aximum favorable excursion
(MFE), a concept originally created
by John Sweeney to measure
the distinctive characteristics
of profitable trades, can be
used as part of an analytical
process to enable traders to distinguish
between average trades
and those that offer substantially
greater profit potential.
Using MFE analysis, traders can classify above-average performance
during a trade and thereby recognize opportunities
to enhance profitability with the MFE risk management
strategy.
Following the strategy, traders can increase profit potential
relative to risk by adding to positions based on the trading
PRICE
TIME
PRICE
TIME
Trade A
Trade B
Trade C
Profit
Resistance
Level
Maximum Favorable Excursion
PROFITS (IN %)
RUN-UP (IN %)
10
9
8
7
6
5
4
3
2
1
0
0 1 2 3 4 5 6 7 8 9 10
2% Support Level
Trade B
Trade A Trade C
Maximum Favorable Excursion By Percentage
FIGURE 1: PROFIT/LOSS VERSUS TIME. Trades A and B fail to penetrate 
the
profit resistance level. Trade C, however, breaks through. This 
profit implies a
stronger momentum surge than the other trades.
FIGURE 2: MAXIMUM FAVORABLE EXCURSION ANALYSIS. The vertical axis
represents the closed profit or loss for each individual trade. The 
horizontal axis
represents the amount of unrealized profit or runup achieved by the 
trade during its
life. Trade A was a winning trade that had a runup of slightly better 
than 5% and
closed with a profit of 5%. Trade B was a losing trade with an 
unrealized profit of
nearly 2%; however, the position reversed to close with more than a 
3% loss.
characteristics of a system. This strategy can be used with all
systems, whether they are mechanized, discretionary, long,
short, intraday, or end of day. The returns of the system must,
however, exhibit certain characteristics to take advantage of
this risk management strategy.
Since every trading methodology is different, it will take a
thorough performance evaluation to determine if the MFE
strategy is suitable for the system.
APPLYING MFE STRATEGY
The objective of the MFE strategy is to add to positions during
trades that offer greater than normal profit potential. With
this in mind, the first step is to determine whether the trading
system exhibits exploitable MFE characteristics. The second
step is to determine the point at which to add to positions. The
third and final step in using the MFE strategy is to reevaluate
the system's performance after applying the strategy to
ensure that the risk-reward characteristics remain intact.
Before we examine the analysis itself, let's walk through
some key concepts. To better explain MFE, consider the
notion of support and resistance as applied to price charts.
A tenet of basic technical analysis is if the price action of
a security penetrates and remains above a specific resistance
level, that resistance level becomes a support level for the
M
Reprinted from Technical Analysis of STOCKS & COMMODITIES magazine. © 
1999 Technical Analysis Inc., (800) 832-4642, http://www.traders.com
MFE RISK MANAGEMENT STRATEGY @ 3.0% ADDING 2 CONTRACTS
ORIGINAL ADJUSTED DIFFERENCE
Net profit $243,615.00 $370,429.00 52.06%
Percent profitable 80.51% 77.98% -3.14%
Profit factor 6.67 6.90 3.45%
RINA index 288.86 316.45 9.55%
Return retracement ratio 6.44 8.79 36.49%
Average trade $2,064.00 $2,204.00 6.78%
Maximum drawdown $15,000.00 $27,706.00 84.71%
Average drawdown $2,416.00 $3,091.00 27.94%
% Equity drawdown 17.85% 11.26% -36.92%
MFE RISK MANAGEMENT STRATEGY @ 2.0% ADDING 2 CONTRACTS
ORIGINAL ADJUSTED DIFFERENCE
Net profit $243,615.00 $467,809.00 92.03%
Percent profitable 80.51% 79.17% -1.66%
Profit factor 6.67 7.77 16.49%
RINA index 288.86 392.82 35.99%
Return retracement ratio 6.44 10.31 60.09%
Average trade $2,064.00 $2,436.00 18.02%
Maximum drawdown $15,000.00 $26,491.00 76.61%
Average drawdown $2,416.00 $3,124.00 29.30%
% Equity drawdown 17.85% 11.68% -34.57%
MFE RISK MANAGEMENT STRATEGY @ 1.0% ADDING 2 CONTRACTS
ORIGINAL ADJUSTED DIFFERENCE
Net profit $243,615.00 $552,773.00 126.90%
Percent profitable 80.51% 79.91% -0.75%
Profit factor 6.67 5.39 -19.19%
RINA index 288.86 449.02 55.45%
Return retracement ratio 6.44 4.96 -22.98%
Average trade $2,064.00 $2,266.00 9.79%
Maximum drawdown $15,000.00 $34,855.00 132.37%
Average drawdown $2,416.00 $3,515.00 45.49%
% Equity drawdown 17.85% 27.84% 55.97%
security. While this is a generalization, these support levels
do typically hold the security for a period before new market
conditions take control.
The same concept of support and resistance can be applied
to the price behavior of a security during the life of the trade.
Once an open profit has penetrated a specific percentage
level, the trade typically remains above the support level for
the duration.
Figure 1 illustrates this support and resistance concept in
terms of three individual trades. Trades A and B fail to
penetrate the profit resistance level. Trade C, however, breaks
through, implying a stronger momentum surge than the other
trades. The goal of the MFE strategy is to identify this
resistance level and add to positions at a specific support/
resistance level to improve the system's total performance.
How much unrealized profit or runup does a trade have to
experience before it is likely to realize additional gains? This is
easily determined if we examine characteristics of the system
over time using the maximum favorable excursion process.
MFE TRADING CHARACTERISTICS
Let's look at a trading system and evaluate its performance
using a maximum favorable excursion process.
MFE begins by measuring each trade's individual unrealized
profit potential or runup in relation to its closed profit/loss.
Figure 2 is a maximum favorable excursion analysis. This
same type of analysis could be performed using a spreadsheet.
The vertical axis represents the closed profit or loss for each
individual trade. The horizontal axis represents the amount of
unrealized profit or runup experienced by the trade during the
life of the trade. To make the MFE analysis easier to interpret,
both winning and losing trades are plotted on the same graph.
The green dots represent winning trades, while the red dots
represent losing trades.
Take a look at two separate trades to understand the benefit
of this MFE graph. Trade A was a winner with a runup of
slightly better than 5%, closing with a profit of 5%. This was
an efficient trade because it realized the majority of its profit
potential. Trade B, on the other hand, was a loser that did not
fare as well. At one point, the trade had an unrealized profit
of nearly 2%, but the position reversed to close with more
than a 3% loss. Not only did that trade lose money, but to
make matters worse, it was extremely inefficient; it was up
nearly 2% but gave it all back and more.
The MFE graphic is excellent at evaluating the relative
efficiency of individual trades. The sign of a good system is
the clustering of small losing trades with low runup and a
clear line of winning trades in a 45-degree angle. The closer
the winning trades follow the 45-degree line, the more
efficient the trades are — the trade's unrealized profit or
runup and the realized profit are relatively close. It is this type
of trading characteristic that works best with the MFE risk
management strategy.
Now that we know how to interpret the MFE graphic, let's
return to Figure 2. The greater the runup, the less likely it is
the trade will become a loser. The objective is to find the
FIGURE 3: MFE STRATEGY, TWO CONTRACTS, 1%. Here are the before and
after results of using an identical trading system with a strategy of 
adding two
contracts if the open profit exceeds 1%.
FIGURE 4: MFE STRATEGY, TWO CONTRACTS, 2%. Here are the before and
after results of using an identical trading system with a strategy of 
adding two
contracts if the open profit exceeds 2%.
FIGURE 5: MFE STRATEGY, TWO CONTRACTS, 3%. Here are the before and
after results of using an identical trading system with a strategy of 
adding two
contracts if the open profit exceeds 3%.
support area that benefits the majority of trades while maximizing
the system's net profit in relation to risk–reward
calculations.
In Figure 2, our trading system appears to have a logical
support area between 2% and 3% runup. Consequently,
trades that are up at least 2% are ideal for increasing the
number of contracts or shares. A profitable movement beyond
this area can be considered to be indicative of a trade
that offers substantially greater profit potential.
Now, let's look at an actual trade to appreciate the signifi-
MONEY MANAGER
Reprinted from Technical Analysis of STOCKS & COMMODITIES magazine. © 
1999 Technical Analysis Inc., (800) 832-4642, http://www.traders.com
cance of the MFE strategy. Trade C was up 6% during the
trade and closed out with a profit of 5%. If we use the 2% MFE
level to add to the position, then trade C1 would net 3% (trade
C profit of 5% minus the 2% MFE delay). The total position
for trade C plus trade C1 nets 8% of the price move with little
effect on risk.
Our work indicates that each system typically has two or
three different support levels. These levels allow traders to
adjust the trading characteristics of the system, making it
more or less aggressive. In the case of our system, adding
positions at 1% would make it more aggressive than adding
at 2% or higher, simply because the stronger the momentum
behind the trade, the more likely it is to turn into a stellar
performer.
trading performance can be seen in Figures 1 through 4.
Traders must be willing to evaluate the performance of each
level to best match their trading expectations with the risk
profile of the system.
Based on the test results, the best risk–reward setting lies
between the 2% and 3% support levels. This summary is
based primarily on net profit, the RINA index, which combines
net profit, time in the market, and drawdown calculations
all boiled down into a single reward–risk ratio.
In addition, it is a good sign that the return retracement
ratio, which is an alternative to the Sharpe ratio†, is greater
than 3.0. Unlike the Sharpe ratio, the return retracement ratio
is able to distinguish the difference between upside and
downside return fluctuation, and finally, the percentage equity
drawdown, which measures the highest high during a
trade to the lowest low during the same or consecutive trades
in a percent format, is only slightly larger than the lowest of
the three examples. This combination of risk and reward
evaluation tools makes it easier to center on specific MFE
support levels appropriate for any trader, whether aggressive,
moderate, or conservative.
CONCLUSION
To apply the MFE analysis, a trader must go through three
stages. The first stage uses the maximum favorable excursion
graphic to evaluate the characteristics of the system and see
if there are any exploitable tendencies. This stage can help
eliminate systems that trade inefficiently and offer little
potential for exploiting the relationship between runup and
realized profit. The second stage focuses on finding an
appropriate MFE support level at which to add to positions.
Finally, the third stage involves testing specific values to
determine the MFE level that works best with the trading
system.
In all, maximum favorable excursion is a powerful strategy
that can benefit both discretionary and mechanical traders.
David Stendahl is vice president of financial services with
RINA Systems and a professional trader. Leo Zamansky,
Ph.D., is president of RINA Systems in Cincinnati, OH. The
company specializes in software development for the serious
trader. Free downloadable software that demonstrates
the MFE strategy is available at http://www.rinasystems.com
under Visual Tours and Download. Both Stendahl and
Zamansky can be reached via the Website.
RELATED READING
Sweeney, John [1985]. "Where To Put Your Stops," Technical
Analysis of STOCKS & COMMODITIES, Volume 3:
October.
_____ [1987]. "Using Maximum Adverse Excursions For
Stops," Technical Analysis of STOCKS & COMMODITIES,
Volume 5: April.
Zamansky, Leo J., and David C. Stendahl [1997]. "Evaluating
System Efficiency," Technical Analysis of STOCKS
& COMMODITIES, Volume 15: October.
These trades must prove themselves worthy to justify
being added to the open position. If you add to the positions
too soon, you increase your risk exposure. If you add to
positions too late, you limit the full potential of the strategy.
The MFE graphic will certainly point you in the correct
direction, but a thorough testing is required to appreciate the
ramifications from a risk–reward perspective.
MFE PERFORMANCE EVALUATION
Now, let's crunch some numbers and evaluate the system's
performance using a variety of MFE risk management support
levels. Figures 3, 4, and 5 show the system results of adding
two contracts to the original position once a predetermined
MFE support level has been penetrated. Applying the MFE
strategy to the trading system has a major effect on the net
profit figure, but we also want to center on the risk calculations
to value the true effects of MFE.
For example, in Figure 3 the system's net profit increased
by 127%, but the percent equity drawdown increased by
56%. An aggressive trader may be willing to take on more
risk for greater profit potential, but a more conservative
trader may not. The results in Figure 4 show a sizable increase
in the net profit of 92%, but with an actual decrease in the
percent equity drawdown by 34%. The results in Figure 5
show a sizable increase to the system's profitability but
certainly not to the same level as Figure 4. A larger net profit
figure with less risk makes the MFE risk management setup
in Figure 4 more palatable to traders if they were to properly
evaluate total performance.
A variety of MFE support levels that can be used to improve S&C
The MFE graphic is excellent at
evaluating the relative efficiency of
individual trades. The sign of a good
system is the clustering of small
losing trades with low runup and a
clear line of winning trades in a
45-degree angle.

> Anyone have any sage advice regarding how to interpret:
> 
>   + added profit distribution chart
>   + added MAE distribution chart (Pro version only)
>   + added MFE distribution chart (Pro version only)
>   # portfolio trade list: Max. Adverse Excursion (MAE) and 
Max.      
>   Favorable Excurison (MFE) added
> 
> Phsst
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
> wrote:
> > Hello,
> > 
> > A new beta version (4.48.0) of AmiBroker has just been released.
> > 
> > Includes "window linking" (different intervals in cloned windows),
> futures support in portfolio backtester,
> > Profit distribution chart, MAE/MFE in trade list and other 
improvements.
> > 
> > It is available for registered users only from the members area 
at:
> > http://www.amibroker.com/members/bin/ab4480beta.exe
> > and
> > http://www.amibroker.net/members/bin/ab4480beta.exe
> > 
> > (File size: 620 822 bytes,  620 KB)
> > 
> > If you forgot your user name / password to the members area
> > you can use
>  automatic reminder service at: http://www.amibroker.com/login.html
> > 
> > The highlight of this new version is multiple time frame support 
in AFL.
> > 
> > The instructions are available below and in the "ReadMe" file
> > ( Help->Read Me menu from AmiBroker )
> > 
> > CHANGES FOR VERSION 4.48.0 (as compared to 4.47.0)
> > 
> >   a.. window linking with different bar interval works now.
> >   Just use Window->Clone menu ... this will create a clone of
> currently selected window. The difference from previous version is
> that you can now select different interval for this cloned window.
> Cloned windows are numbered. You can have infinite number of cloned
> windows and they are linked within group (change symbol in one 
window
> causes change in every linked window) but the viewing interval is
> independent.
> > 
> >   b.. cloned windows are now properly saved in a layout. (note 
that
> format has changed slightly and you may get problems
> >   trying to load into old version the layout saved with NEW 
version)
> > 
> >   c.. portfolio backtester: added support for backtesting futures
> > 
> >   d.. portfolio backtest report:
> >   + added profit distribution chart 
> >   + added MAE distribution chart (Professional /previosly known as
> RealTime/ edition only)
> >   + added MFE distribution chart (Professional /previosly known as
> RealTime/ edition only)
> > 
> >   e.. portfolio trade list: Max. Adverse Excursion (MAE) and Max.
> Favorable Excurison (MFE) added
> > 
> >   f.. ApplyStop / ExitAtStop=False feature in rotational mode 
works
> as in regular mode now (checks only trade price for stops, not H-L
> range. H-L is checked when ExitAtStop is True)
> > 
> >   g.. AFL Editor - Edit->Copy puts "HTML Format" and "DwHt"
> (Dreamweaver HTML format) into clipboard in addition to TXT and RTF
> formats. This provides ability to paste nicely formatted codes
> directly into Outlook Express and Macromedia Dreamweaver 
> > 
> > Hope this helps.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > 
> > 
> > AmiBroker 4.48.0 Beta Read Me
> > November 8, 2003 21:21 
> > 
> > THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS !!!
> > 
> > Backup your data files and entire AmiBroker folder first!
> > 
> > INSTALLATION INSTRUCTIONS
> > 
> > IMPORTANT: This archive is update-only. You have to install full
> version 4.40 first. 
> > 
> > Just run the installer and follow the instructions. 
> > 
> > Then run AmiBroker. You should see "AmiBroker 4.48.0 beta" written
> in the About box.
> > 
> > See CHANGE LOG below for detailed list of changes.
> > 
> > HELP ON NEW FEATURES
> > New backtest report
> > New report is hugely enhanced compared to old one. It includes
> separate statistics for all, long and short sides as well as large
> number of new metrics. You can get short help on given figure by
> hovering your mouse over given field name. You will see the
> description in the tooltip. Short explanations are provided also 
below:
> > 
> > Exposure % - modified since last release -'Market exposure of the
> trading system calculated on bar by bar basis. Sum of bar exposures
> divided by number of bars. Single bar exposure is the value of open
> positions divided by portfolio equity.
> > 
> > Net Risk Adjusted Return % - Net profit % divided by Exposure %
> > 
> > Annual Return % - Compounded Annual Return % (CAR)
> > 
> > Risk Adjusted Return % - Annual return % divided by Exposure %
> > 
> > Avg. Profit/Loss - (Profit of winners + Loss of losers)/(number of
> trades)
> > 
> > Avg. Profit/Loss % - '(% Profit of winners + % Loss of
> losers)/(number of trades)
> > 
> > Avg. Bars Held - sum of bars in trades / number of trades
> > 
> > Max. trade drawdown - The largest peak to valley decline 
experienced
> in any single trade
> > 
> > Max. trade % drawdown - The largest peak to valley percentage
> decline experienced in any single trade
> > 
> > Max. system drawdown - The largest peak to valley decline
> experienced in portfolio equity
> > 
> > Max. system % drawdown - The largest peak to valley percentage
> decline experienced in portfolio equity
> > 
> > Recovery Factor - Net profit divided by Max. system drawdown
> > 
> > CAR/MaxDD - Compound Annual % Return divided by Max. system % 
drawdown
> > 
> > RAR/MaxDD - Risk Adjusted Return divided by Max. system % 
drawdown 
> > 
> > Profit Factor - Profit of winners divided by loss of losers
> > 
> > Payoff Ratio - Ratio average win / average loss
> > 
> > Standard Error - Standard error measures chopiness of equity line.
> The lower the better.
> > 
> > Risk-Reward Ratio - Measure of the relation between the risk
> inherent in a trading the system compared to its potential gain.
> Higher is better. Calculated as slope of equity line (expected 
annual
> return) divided by its standard error.
> > 
> > Ulcer Index - Square root of sum of squared drawdowns divided by
> number of bars
> > 
> > Ulcer Performance Index - (Annual profit - Tresury notes
> profit)/Ulcer Index'>Ulcer Performance Index. Currently tresury 
notes
> profit is hardcoded at 5.4. In future version there will be
> user-setting for this.
> > 
> > Sharpe Ratio of trades - Measure of risk adjusted return of
> investment. Above 1.0 is good, more than 2.0 is very good. More
> information http://www.stanford.edu/~wfsharpe/art/sr/sr.htm .
> Calculation: first average percentage return and standard deviation 
of
> returns is calculated. Then these two figures are annualized by
> multipling them by ratio
> (NumberOfBarsPerYear)/(AvgNumberOfBarsPerTrade). Then the risk free
> rate of return is subtracted (currently hard-coded 5) from 
annualized
> average return and then divided by annualized standard deviation of
> returns.
> > 
> > K-Ratio - Detects inconsistency in returns. Should be 1.0 or more.
> The higher K ratio is the more consistent return you may expect from
> the system. Linear regression slope of equity line multiplied by
> square root of sum of squared deviations of bar number divided by
> standard error of equity line multiplied by square root of number of
> bars. More information: Stocks & Commodities V14:3 (115-118):
> Measuring System Performance by Lars N. Kestner
> > 
> > Optimization in new portfolio backtester
> > 
> > From version 4.43.0 BETA AmiBroker is able to perform 
optimizations
> on portfolio level. The portfolio optimization uses familar function
> Optimize and allows upto 10 variables to be optimized. You are able
> not only to optimize parameters of indicators but you can also
> optimize portfolio-level settings like maximum number of open
> positions, portfolio level position sizing, etc. These settings are
> available via SetOption() function. New fields accepted by SetOption
> include: SetOption("MaxOpenPositions"), SetOption("MinShares"). More
> are on the way. 
> > 
> > Also the portfolio optimizer gives much more statistics than old 
one
> including metrics like Sharpe ratio, Risk Reward ratio, etc.
> > 
> > New portfolio backtester
> > IMPORTANT: Since the new backtester is not yet complete. If you
> think that there is a bug please report it to bugs@xxxx with all
> details you can give including: the formula, HTML report generated 
by
> AmiBroker, trade list or detailed log, etc. 
> > 
> > From version 4.42.0 BETA through some future betas there will be 
TWO
> backtesters. The OLD one that is triggered by pressing "Backtest" or
> "Optimize" button in the Automatic Analysis window. And NEW one,
> portfolio-level backtester that is triggered by pressing "Portfolio
> BackTest" or "Portfolio Optimize" button in Automatic Analysis 
window. 
> > 
> > Old backtester is untouched and it works exactly the same way as 
in
> pre-4.42 versions. I have decided to leave it for a while so you can
> continue using old your own formulas, results, etc while checking 
out
> new backtester. 
> > 
> > New backtester is not complete yet, but already provides 
substantial
> amount of functionality to make it worthwhile to check it out.
> > 
> > New backtester works on PORTFOLIO LEVEL, it means that there is
> single portfolio equity and position sizing refers to portfolio
> equity. Portfolio equity is equal to available cash plus sum of all
> simultaneously open positions at given time. 
> > 
> > IMPORTANT: to enable more than one symbol to be traded you have to
> add PositionSize variable to your formula, so less than 100% of 
funds
> are invested in single security:
> > 
> > PositionSize = -25; // invest 25% of portfolio equity in single 
security
> > 
> > or
> > 
> > PositionSize = 5000; // invest $5000 into single security
> > 
> > You can use new PositionScore variable to decide which trades 
should
> be entered if there are more entry signals on different securities
> than maximum allowable number of open positions or available funds. 
In
> such case AmiBroker will use the absolute value of PositionScore
> variable to decide which trades are preferred. See the code below. 
It
> implements simple MA crossover system, but with additional flavour 
of
> preferring entering trades on symbols that have low RSI value. If 
more
> buy signals occur than available cash/max. positions then the stock
> with lower RSI will be preferred. You can watch selection process if
> you backtest with "Detailed log" report mode turned on.
> > 
> > The code below includes also the example how to find optimum 
number
> of simultaneously open positions using new Optimization in Porfolio 
mode.
> > 
> > /*****
> > ** REGULAR PORTFOLIO mode 
> > ** This sample optimization
> > ** finds what is optimum number of positions open simultaneously
> > ** 
> > ****/
> > 
> > SetOption("InitialEquity", 20000 );
> > SetTradeDelays(1,1,1,1);
> > RoundLotSize = 1; 
> > 
> > posqty = Optimize("PosQty", 4, 1, 20, 1 );
> > SetOption("MaxOpenPositions", posqty);
> > 
> > // desired position size is 100% portfolio equity
> > // divided by PosQty positions
> > 
> > PositionSize = -100/posqty; 
> > 
> > // The system is very simple...
> > // MA parameters could be optimized too...
> > p1 = 10;
> > p2 = 22;
> > // simple MA crossover
> > Short=Cross( MA(C,p1) , MA(C,p2) );
> > Buy=Cross( MA(C,p2) , MA(C,p1) );
> > // always in the market 
> > Sell=Short; 
> > Cover=Buy;
> > 
> > // now additional score 
> > // that is used to rank equities 
> > // when there are more ENTRY signals that available
> > // positions/cash
> > PositionScore = 100-RSI(); // prefer stocks that have low RSI;
> > 
> > 
> > 
> > Things NOT IMPLEMENTED yet in new portfolio backtester, to be 
done soon
> >   a.. pyramiding 
> >   b.. intra-bar detailed timing 
> >   c.. OLE interface 
> >   d.. etc... 
> > Automatic Analysis Settings - Portfolio page
> > - Max. Open Positions (previously known as "Max. traded") - the
> maximum number of simultaneously open positions. .Settable also 
using
> SetOption("MaxOpenPositions", number ) function.
> > 
> > - Max. # of signals tracked per bar- the maximum number of
> buy/sell/short/cover signals per single bar that AmiBroker will 
track.
> Should be set to at least 2 * (Max. Open Positions) or more. Default
> of 100 should be fine for most applications. May be removed in the
> future. Settable also using SetOption("MaxTracked", number ) 
function.
> > 
> > - Report mode - Trade list - shows regular trade list (as old
> backtester), Detailed log - shows very detailed bar-by-bar log with
> scores, each entry and exit separately reported, etc.
> > 
> > - Min. shares - the minimum number of shares that are allowed to
> buy/short. Backtester will not enter trades below that limit. 
Default
> = 1 is good for stocks.
> > 
> > Known differencies between statistics produced by 'old' and 'new'
> (portfolio) backtester 
> >         Old backtester New (portfolio) backtester 
> >       System and trade drawdown calculations based on 
Open/Close/H-L
> range (worst case) selectable in settings Close price only 
(regardless
> of settings) - subject to change 
> >       Max. % trade drawdown Calculated based on total equity
> Calculated based on ACTUAL trade value at entry point. 
> >       Stats available  for all trades only separately for long,
> short and all trades 
> >       Futures backtesting (MarginDeposit, TickSize, PointValue)
> Supported Supported (from 4.48.0) 
> >       PositionSizing Based on individual symbol equity  Based on
> portfolio equity.
> > 
> >       PositionSize = -25; 
> > 
> >       will enter 25% of current porfolio equity
> >      
> >       Trade statistics Include only closed trades, open trade is
> reported separately Include all trades (closed and those still open 
at
> the end of analysis period). Any open trades are closed out 
at 'close'
> price always. 
> >       Exposure calculated regardless of position size (no matter 
on
> what is position size if trade is taken for particular bar it 
assumes
> 100% exposure at that bar) calculations include now (in 4.43.0) the
> total amount of open positions compared to total portfolio equity.
> Exposure is calculated on bar by bar basis so if only 50% funds are 
in
> open trade, then exposure for this bar is 0.5. Then individual bar
> exposures are summed up and divided by number of bars to produce
> exposure figure. This way true market exposure is calculated. 
> >       Multiple security testing N independent accounts (multiple
> single equity) Portfolio equity common to all symbols under test 
> > 
> > 
> > 
> > 
> > 
> > Multiple time frame support
> > 
> > Release 4.41 brings ability to use multiple time frames (bar
> intervals) in single formula. The time frame functions can be 
divided
> into 3 functional groups: 
> > 
> >   1.. switching time frame of build-in O, H, L, C, V, OI, Avg
> arrays: TimeFrameSet, TimeFrameRestore 
> >   2.. compressing/expanding single arrays to/from specified
> interval: TimeFrameCompress, TimeFrameExpand 
> >   3.. immediate access to price/volume arrays in different time
> frame: TimeFrameGetPrice 
> > First group is used when your formula needs to perform some
> calculations on indicators in different time frame than currently
> selected one. For example if you need to calculate 13-bar moving
> average on 5 minute data and 9 bar exponential avarage from hourly
> data while current interval is 1 minute you would write:
> > 
> > TimeFrameSet( in5Minute ); // switch to 5 minute frame
> > 
> > /* MA now operates on 5 minute data, ma5_13 holds time-compressed 
13
> bar MA of 5min bars */
> > 
> > ma5_13 = MA( C, 13 ); 
> > 
> > TimeFrameSet( inHourly ); // switch now to hourly
> > 
> > mah_9 = EMA( C, 9 ); // 9 bar moving average from hourly data
> > 
> > TimeFrameRestore(); // restore time frame to original
> > 
> > Plot( Close, "Price", colorWhite, styleCandle );
> > 
> > // plot expanded average
> > 
> > Plot( TimeFrameExpand( ma5_13, in5Minute), "13 bar moving average
> from 5 min bars", colorRed );
> > Plot( TimeFrameExpand( mah_9, inHourly), "9 bar moving average 
from
> hourly bars", colorRed );
> > 
> > 
> > TimeFrameSet( interval ) - replaces current built-in price/volume
> arrays: open, high, low, close, volume, openint, avg with
> time-compressed bars of specified interval once you switched to a
> different time frame all calculations and built-in indicators 
operate
> on selected time frame. To get back to original interval call
> TimeFrameRestore() funciton. Interval is time frame interval in
> seconds. For example: 60 is one minute bar. You should use 
convenient
> constants for common intervals: in1Minute, in5Minute, in15Minute,
> inHourly, inDaily, inWeekly, inMonthly.
> > 
> > TimeFrameRestore() - restores price arrays replaced by
> SetTimeFrame.Note that only OHLC, V, OI and Avg built-in variables 
are
> restored to original time frame when you call TimeFrameRestore().All
> other variables created when being in different time frame remain
> compressed. To de-compress them to original interval you have to use
> TimeFrameExpand.
> > 
> > Once you switch the time frame using TimeFrameSet, all AFL 
functions
> operate on this time frame until you switch back the time frame to
> original interval using TimeFrameRestore or set to different 
interval
> again using TimeFrameSet. It is good idea to ALWAYS call
> TimeFrameRestore when you are done with processing in other time 
frames.
> > 
> > When time frame is switched to other than original interval the
> results of all functions called since TimeFrameSet are time-
compressed
> too. If you want to display them in original time frame you would 
need
> to 'expand' them as described later. Variables created and assigned
> before call to TimeFrameSet() remain in the time frame they were
> created. This behaviour allows mixing unlimited different time 
frames
> in single formula.
> > 
> > Please note that you can only compress data from shorter interval 
to
> longer interval. So when working with 1-minute data you can compress
> to 2, 3, 4, 5, 6, ....N-minute data. But when working with 15 minute
> data you can not get 1-minute data bars. In a similar way if you 
have
> only EOD data you can not access intraday time frames.
> > 
> > Second group: TimeFrameCompress/TimeFrameExpand allow to compress
> and expand single arrays to / from different time frames. Especially
> worth mentioning is TimeFrameExpand that is used to decompress array
> variables that were created in different time frame. Decompressing 
is
> required to properly display the array created in different time
> frame. For example if you want to display weekly moving average it
> must be 'expanded' so the data of one weekly bar covers five daily
> bars (Monday-Friday) of corresponding week.
> > 
> > TimeFrameExpand( array, interval, mode = expandLast ) - expands
> time-compressed array from 'interval' time frame to base time frame
> ('interval' must match the value used in TimeFrameCompress or
> TimeFrameSet)
> > Available modes:
> > expandLast - the compressed value is expanded starting from last 
bar
> within given period (so for example weekly close/high/low is 
available
> on Friday's bar)
> > expandFirst - the compressed value is expanded starting from first
> bar within given period (so for example weekly open is available 
from
> Monday's bar)
> > expandPoint - the resulting array gets not empty values only for 
the
> last bar within given period (all remaining bars are Null (empty)).
> > Caveat: expandFirst used on price different than open may look 
into
> the future. For example if you create weekly HIGH series, expanding 
it
> to daily interval using expandFirst will enable you to know on 
MONDAY
> what was the high for entire week.
> > 
> > TimeFrameCompress is provided for completeness and it can be used
> when you want to compress single array without affecting built-in
> OHLC,V arrays. If you call TimeFrameCompress it does not affect
> results of other functions.
> > 
> > wc = TimeFrameCompress( Close, inWeekly );
> > 
> > /* now the time frame is still unchanged (say daily) and our MA 
will
> operate on daily data */
> > 
> > dailyma = MA( C, 14 );
> > 
> > /* but if we call MA on compressed array, it will give MA from 
other
> time frame */
> > 
> > weeklyma = MA( wc, 14 ); // note that argument is time-compressed 
array
> > 
> > Plot( dailyma, "DailyMA", colorRed );
> > 
> > weeklyma = TimeFrameExpand( weeklyma, inWeekly ); // expand for 
display
> > 
> > Plot( weeklyma, "WeeklyMA", colorBlue );
> > 
> > During this formula the time frame remained at original setting we
> only compressed single array.
> > 
> > TimeFrameCompress( array, interval, mode = compressLast )
> > - compresses single array to given interval using given 
compression
> mode available modes:
> > compressLast - last (close) value of the array within interval
> > compressOpen - open value of the array within interval
> > compressHigh - highest value of the array within interval
> > compressLow - lowest value of the array within interval
> > compressVolume - sum of values of the array within interval
> > 
> > graph0 = TimeFrameExpand( TimeFrameCompress( Close, inWeekly,
> compressLast ), inWeekly, expandLast );
> > graph1 = TimeFrameExpand( TimeFrameCompress( Open, inWeekly,
> compressOpen ), inWeekly, expandFirst );
> > Third group consist of just one useful function: TimeFrameGetPrice
> which allows to reference price and volume from other time frames
> without switching /compressing/expanding time frames. Just one
> function call to retrieve price from higher time frame. It allows 
also
> to reference not only current but past bars from different time 
frames.
> > 
> > TimeFrameGetPrice( pricefield, interval, shift = 0, mode =
> expandFirst );
> > - references OHLCV fields from other time frames. This works
> immediatelly without need to call TimeFrameSet at all.
> > Price field is one of the following: "O", "H", "L", "C", "V", "I"
> (open interest). Interval is bar interval in seconds. shift allows 
to
> reference past (negative values) and future (positive values) data 
in
> higher time frame. For example -1 gives previous bar's data (like in
> Ref function but this works in higher time frame).
> > 
> > Examples:
> > 
> > TimeFrameGetPrice( "O", inWeekly, -1 ) - gives you previous week
> OPEN price
> > TimeFrameGetPrice( "C", inWeekly, -3 ) - gives you weekly Close
> price 3 weeks ago
> > TimeFrameGetPrice( "H", inWeekly, -2 ) - gives you weekly High 
price
> 2 weeks ago
> > TimeFrameGetPrice( "O", inWeekly, 0 ) - gives you this week open 
price.
> > TimeFrameGetPrice( "H", inDaily, -1 ) - gives previous day high 
when
> working on intraday data
> > Shift works as in Ref() function but it is applied to compressed
> time frame.
> > 
> > Note these functions work like these 3 nested functions
> > TimeFrameExpand( Ref( TimeFrameCompress( array, interval,
> compress(depending on field used) ), shift ), interval, 
expandFirst )
> > therefore if shift = 0 compressed data may look into the future (
> weekly high can be known on monday ). If you want to write a trading
> system using this function please make sure to reference PAST data 
by
> using negative shift value.
> > 
> > The only difference is that TimeFrameGetPrice is 2x faster than
> nested Expand/Compress.
> > 
> >   Note on performance of TimeFrame functions:
> > 
> >   a) Measurements done on Athlon 1.46GHz, 18500 daily bars
> compressed to weekly time frame
> > 
> >   TimeFrameGetPrice( "C", inWeekly, 0 ) - 0.0098 sec (9.8 
milliseconds)
> >   TimeFrameSet( inWeekly ) - 0.012 sec (12 milliseconds)
> >   TimeFrameRestore( ) - 0.006 sec (6 milliseconds)
> >   TimeFrameCompress( Close, inWeekly, compressLast ); - 0.0097 sec
> (9.7 milliseconds)
> >   TimeFrameExpand( array, inWeekly, expandLast ); - 0.0098 sec 
(9.8
> milliseconds)
> >   b) Measurements done on Athlon 1.46GHz, 1000 daily bars 
compressed
> to weekly time frameall functions below 0.0007 sec (0.7 millisecond)
> > 
> > EXAMPLES
> > 
> > EXAMPLE 1: Plotting weekly MACD and cross arrows from daily data 
> > 
> > TimeFrameSet( inWeekly );
> > m = MACD(12, 26 ); // MACD from WEEKLY data
> > TimeFrameRestore();
> > m1 = TimeFrameExpand( m, inWeekly );
> > Plot( m1, "Weekly MACD", colorRed );
> > PlotShapes( Cross( m1, 0 ) * shapeUpArrow, colorGreen );
> > PlotShapes( Cross( 0, m1 ) * shapeDownArrow, colorGreen );
> > 
> > EXAMPLE 2: weekly candlestick chart overlaid on line daily price 
chart
> > 
> > wo = TimeFrameGetPrice( "O", inWeekly, 0, expandPoint );
> > wh = TimeFrameGetPrice( "H", inWeekly, 0, expandPoint );
> > wl = TimeFrameGetPrice( "L", inWeekly, 0, expandPoint );
> > wc = TimeFrameGetPrice( "C", inWeekly, 0, expandPoint );
> > PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorWhite, 
styleCandle );
> > Plot( Close, "Daily Close", colorBlue ); 
> > 
> > EXAMPLE 3: Simplified Triple screen system 
> > 
> > /* switch to weekly time frame */
> > TimeFrameSet( inWeekly );
> > whist = MACD( 12, 26 ) - Signal( 12, 26, 9 );
> > wtrend = ROC( whist, 1 ); // weekly trend - one week change of
> weekly macd histogram
> > TimeFrameRestore();
> > /* expand calculated MACD to daily so we can use it with daily
> signals */
> > wtrend = TimeFrameExpand( wtrend, inWeekly );
> > 
> > /* elder ray */
> > bullpower= High - ema(Close,13);
> > bearpower= Low - ema(Close,13);
> > Buy = wtrend > 0 /* 1st screen: positive weekly trend */
> > AND
> > bearpower < 0 and bearpower > Ref( bearpower, -1 ) /* 2nd screen
> bear power negative but rising */
> > AND
> > H > Ref( H, -1 ); /* 3rd screen, if prices make a new high */
> > BuyPrice = Ref( H, -1 ); // buy stop level;
> > Sell = 0 ; // exit only by stops
> > ApplyStop( stopTypeProfit, stopModePercent, 30, True );
> > ApplyStop( stopTypeTrailing, stopModePercent, 20, True );
> > 
> > CHANGE LOG
> > 
> > CHANGES FOR VERSION 4.48.0 (as compared to 4.47.0)
> > 
> >   a.. window linking with different bar interval works now.
> >   Just use Window->Clone menu ... this will create a clone of
> currently selected window. The difference from previous version is
> that you can now select different interval for this cloned window.
> Cloned windows are numbered. You can have infinite number of cloned
> windows and they are linked within group (change symbol in one 
window
> causes change in every linked window) but the viewing interval is
> independent.
> > 
> >   b.. cloned windows are now properly saved in a layout. (note 
that
> format has changed slightly and you may get problems
> >   trying to load into old version the layout saved with NEW 
version)
> > 
> >   c.. portfolio backtester: added support for backtesting futures
> > 
> >   d.. portfolio backtest report:
> >   + added profit distribution chart 
> >   + added MAE distribution chart (Pro version only)
> >   + added MFE distribution chart (Pro version only)
> > 
> >   e.. portfolio trade list: Max. Adverse Excursion (MAE) and Max.
> Favorable Excurison (MFE) added
> > 
> >   f.. ApplyStop / ExitAtStop=False feature in rotational mode 
works
> as in regular mode now (checks only trade price for stops, not H-L
> range. H-L is checked when ExitAtStop is True)
> > 
> >   g.. AFL Editor - Edit->Copy puts "HTML Format" and "DwHt"
> (Dreamweaver HTML format) into clipboard in addition to TXT and RTF
> formats. This provides ability to paste nicely formatted codes
> directly into Outlook Express and Macromedia Dreamweaver 
> > 
> > CHANGES FOR VERSION 4.47.0 (as compared to 4.46.3)
> > 
> >   a.. in regular detailed log does not show more than 2 *
> MaxOpenPositions top ranked entry (buy/short) signals since anyway
> they won't ever be entered.
> > 
> >   b.. Regular mode: "Max # of tracked signals" setting removed. 
Now
> _all_ exit signals are tracked.
> > 
> >   c.. fixed offset in day numbers returned by DayOfWeek() function
> for dates prior to 1970
> > 
> >   d.. added InterestEarning calculation to Portfolio backtest 
> > 
> >   e.. now single bar 'long side' and 'short side' exposure is
> calculated as value of long positions and short positions
> (respectively) divided by overall equity value. (previously it was
> divided by long equity / short equity value but it caused problems 
for
> systems that were constantly loosing on short side causing that 
short
> side dropped below zero)
> > 
> >   f.. other minor fixes
> > 
> > CHANGES FOR VERSION 4.46.3 (as compared to 4.46.2)
> > 
> >   a.. thousand separator is removed automatically in StrToNum to
> prevent problems with conversion of numbers > 1000 when thousand
> separator is enabled 
> >   b.. fixed issue with rotational mode, entering other symbols 
when
> trade on top ranked symbol has been stopped and re-entry delay > 0 
> >   c.. detailed log mode does not affect drawdown calculation
> (previously it could result in slightly bigger drawdowns reported in
> 'detailed log' mode due to the fact that exit bar close was included
> in drawdown calculations even when exiting on open.) 
> >   d.. still open trades are listed in HTML report too.
> > 
> >   e.. trade list in HTML portfolio report can be turned OFF using
> Settings: "Report", Trade list: <no trade list> setting.
> >   (this setting page will be cleaned up at some point when there
> will be one backtester only).
> > 
> > CHANGES FOR VERSION 4.46.2 (as compared to 4.46.1)
> > 
> >   a.. AA settings, switch: "Add artificial future bar" - now
> artificial future bar is has incremented date, volume set to zero 
and
> all prices (OHLC) set to CLOSE price of last available data bar. 
(this
> is done to prevent the closed-out value of open positions)
> > 
> >   b.. new AFL function:
> >   Median( array, period ) - finds median (middle element) value 
over
> period elements 
> >   c.. now trade list in portfolio mode displays reason for exit 
(if
> trade has been closed by stop)
> > 
> >   d.. trade list is now included in the report
> > 
> >   e.. rotational mode: profit target stop was broken, now it is 
fixed
> > 
> > CHANGES FOR VERSION 4.46.1 (as compared to 4.46.0)
> > 
> >   a.. scoreNoRotate now works again 
> >   b.. small fix in regarding month boundary handling in "Use local
> time for daily compression" mode.
> > 
> >   c.. AA settings, new switch: "Add artificial future bar". When
> checked AmiBroker adds tommorrow's bar and this enables you to see
> tommorrow's (or next bar) trade recommendations when your system 
uses
> one bar delay. Artificial future bar is a copy of last available 
data
> bar but has of course incremented date and volume set to zero.
> > 
> >   d.. two functions (where present in 4.46.0 but not documented)
> >   IsFavourite() - returns 'true' if current symbol belongs to 
favorites
> >   IsIndex() - returns 'true' if current symbol belongs to index 
category
> > 
> > CHANGES FOR VERSION 4.46.0 (as compared to 4.45.0)
> > 
> >   a.. New AFL functions
> > 
> >     a.. added NumToStr as synonum of WriteVal (as this function 
did
> not 'write' anything, just returned string) 
> >     b.. added StrToNum( string ) - converts string to numbe 
> >     c.. added StrFind( string, substring ) - finds first 
occurrence
> of substring in string. returns 0 if not found, otherwise returns
> character index (one-based) of first occurrence 
> >     d.. added StrFormat( formatstr, ... ) that performs sprintf-
like
> formatting and returns string 
> >     e.. CategoryGetName( category, number) function - returns name
> of category (market/group/sector/industry/watchlist) 
> >     f.. CategoryGetSymbols( category, number ) added - synonym to
> GetCategorySymbols
> > 
> >     g.. CategoryAddSymbol( symbol, category, number ); - adds the
> symbol to given category, note that for markets, groups, industries
> 'adding' means moving from one category to another, since the symbol
> is assigned always to one and only one market, group, industry and
> sector. This limitation does not apply to watchlists, favorites, and
> index categories. When symbol string is empty ("") then current 
symbol
> is used. 
> >     h.. CategoryRemoveSymbol( symbol, category, number ); - 
removes
> the symbol to given category, note that for markets, groups,
> industries 'removing' means moving from given category to category
> with number zero, since the symbol is assigned always to one and 
only
> one market, group, industry and sector. This limitation does not 
apply
> to watchlists, favorites, and index categories. When symbol string 
is
> empty ("") then current symbol is used.
> > 
> >   b.. added new AFL functions for output/file handling (almost
> exactly like in C run-time): 
> >     a.. printf( formatstr, ... ) - output formatted text to the
> commentary/interpretation (note 1: for numbers always use %f, %e or 
%g
> formatting, %d or %x will not work because there are no integers in
> AFL, note 2: as of now only numbers and arrays can now be printed. 
For
> arrays 'selected value' is printed) 
> >     b.. fopen( filename, mode ) - opens file, returns filehandle .
> Mode can be "r" - for reading, "w" for writing, "a" for appending 
(and
> all other regular C-runtime library modes) 
> >     c.. fclose( filehandle ); - closes file 
> >     d.. fputs( string, filehandle ) - puts (writes) string to 
file 
> >     e.. fgets( filehandle ) - gets (reads) string from file 
(returns
> string) 
> >     f.. feof( filehandle ) - detects end-of-file marker ( gives 
True
> - if end of file reached ) 
> >   c.. PositionScore table is now shifted according to buy trade
> delay in regular mode too. (it was shifted so in rotational mode
> already). Caveat: make sure to set long and short delays to the same
> values if you are trading both long and short sides, otherwise only
> long trades get correct ranks. Note 2: PositionSize is not and was
> never shifted with trade delays
> >   to allow code for purchasing N stocks working with any delay,
> example PositionSize = 5 * BuyPrice 
> >   a.. added new option to File->Database Settings->Intraday 
settings
> "Use local time for daily compression".
> >   All previous versions used exchange or data vendor time to do
> build daily bars (this means that regardless of your time shift
> settings daily bars looked the same because they used exchange or 
data
> source time (for example if you are using QuoteTracker it was US EST
> time) - this caused problems for Australian users using QuoteTracker
> as data source because QuoteTracker reported ASX quotes with US time
> that lead to invalid daily bars. Now if you check "Use local time 
for
> daily compression" AmiBroker will use your local time (according to
> 'time shift' setting) to build daily bars. Note that switching this 
on
> means that daily bars may look different when you change time zone
> (i.e. time shift setting)
> > 
> >   b.. ASCII importer: support for importing unadjusted Yahoo data
> performing adjustment on the fly: 
> > 
> >     a.. new field ADJCLOSE - to read adj. close column from Yahoo.
> Works _only_ in conjunction with CLOSE field. When both CLOSE and
> ADJCLOSE are present in the ASCII format definition then importer
> calculates split factor by dividing ADJCLOSE/CLOSE. It then 
multiples
> OPEN, HIGH, LOW and CLOSE fields by this factor and divides VOLUME
> field by this factor. This effectively converts unadjusted prices to
> split adjusted prices. Split ratio gets locked once ADJCLOSE drops
> below 0.05.
> > 
> >     b.. new command $ROUNDADJ decimaldigits - causes split-
adjusted
> prices (see above) to be rounded to 'decimaldigits' precision. By
> default no rounding is done.
> > 
> >     c.. new command $RECALCSPLITS 1 - (off by default) causes that
> splits are recalculated by AmiBroker
> >     by the algorithm that tries to construct correct adjusted 
price,
> based on inaccurate information provided by Yahoo.
> >     Note that Yahoo provides only 2 decimal digits in adj. close
> field therefore the more adj. close approaches zero due to
> adjustements the error grows. The option $RECALCSPLITS 1 is intended
> to address this problem (at least partially).
> >     It works as follows:
> >     1. for each bar ratio ADJCLOSE/CLOSE is calculated
> >     2. if the ratio changes in two consecutive bars by more than 
10%
> it means that
> >     split happened that bar. True split ratio is guessed by 
matching
> true fraction
> >     in the format of X/Y, where X and Y = 1..9, to the change in 
ratios.
> >     3. Then true split ratio is used to adjust all past bars until
> new split is detected.
> > 
> >     d.. new command $RAWCLOSE2OI 1 - (off by default) - causes 
that
> OpenInterest field gets assigned CLOSE (raw close) field value
> multiplied by 100
> > 
> >   c.. new aqh.format file included in "formats" subfolder using 
new
> ASCII importer commands to import and adjust prices from Yahoo.
> Compatible with existing AmiQuote versions. 
> > CHANGES FOR VERSION 4.45.0 (as compared to 4.44.1)
> > 
> >   a.. score of 999999 is no longer recognized. Use constant
> scoreNoRotate instead.
> > 
> >   b.. UI simplification:
> >   Rotational mode: separate settings for rotational mode trade 
price
> and delay and worst rank held have been removed.
> >   Rotational mode now uses buy price and buy delay settings from
> "Trade" tab. You can also set delay from the code SetTradeDelays( 1,
> 1, 1, 1 ); will give you one bar delay. To set 'worst rank held' use
> SetOption function in your formula:
> >   SetOption("WorstRankHeld", 5 );
> > 
> >   c.. stops implemented in rotational trading mode (limitation:
> stops in rotational mode can only be static, they can not change
> >   'stop amount' from symbol to symbol or from bar to bar like in
> regular mode)
> > 
> >   d.. re-entry delay implemented for all kind of stops
> > 
> >   e.. user interface added in the settings for n-bar stops
> > 
> >   f.. ApplyStop function now takes 6 parameters:
> >   ApplyStop( Type, Mode, Amount, ExitAtStop = True, Volatile =
> False, ReentryDelay = 0 )
> > 
> >   g.. rotational mode docs moved to this page 
> > CHANGES FOR VERSION 4.44.1 (as compared to 4.44.0)
> > 
> >   a.. fixed problem with rotational mode, trading price: open 
> > CHANGES FOR VERSION 4.44.0 (as compared to 4.43.2)
> > 
> >   a.. fixed crash with 'detail mode' and large number of open
> positions/ranks used
> > 
> >   b.. max. in-memory cache size can be set now to 20000 (please 
note
> that this large cache requires lots of RAM (more than 512MB))
> > 
> >   c.. listview copy to clipboard feature now copies also column
> header names
> > 
> >   d.. SetForeign( ticker, fixup = True, tradeprices = False) and 
> >   RestorePriceArrays( tradeprices = False ) 
> >   have new flag now: tradeprices (False by default)
> >   when tradeprices is set to TRUE, then not only OHLC, V, OI, Avg
> arrays are set to foreign symbol values, but also BuyPrice, 
SellPrice,
> ShortPrice, CoverPrice, PointValue, TickSize, RoundLotSize,
> MarginDeposit variables are set to correspond to foreign security.
> >   This allows Equity() to work well with SetForeign.
> >   Example:
> >   // your rules
> >   buy = ...
> >   sel = ...
> >   SetForeign("MSFT", True, True );
> >   e = Equity(); // backtest on MSFT
> >   RestorePriceArrays( True ); // <- should match parameter used in
> SetForeign
> > 
> >   e.. Name(), FullName(), GetExtraData() work well with SetForeign
()
> (i.e. give foreign name/data instead of currently selected)
> > 
> >   f.. SetOption("PriceBoundChecking", False ); - disables checking
> and adjusting buyprice/sellprice/coverprice/shortprice arrays to
> current symbol High-Low range.
> > 
> >   g.. % profit added to detailed log mode
> > 
> >   h.. fixed bug in portfolio backtester occuring when 'allow same
> bar exit' was turned off and 'immediate stops' was turned on 2 buys
> and 2 sells occurred the in 2 bars in row
> > 
> >   i.. Auto Analysis/Settings,setting modified "portfolio report
> mode: trade list/detailed log" moved to "report" tab
> > 
> >   j.. Auto Analysis/Settings, rotational mode: added selection of
> trade price and trade delay to portfolio settings page
> > 
> >   k.. Auto Analysis/Settings, portfolio backtester (both regular 
and
> rotational modes): added ability to pad and align all symbols to
> reference symbol. Note: by default this setting is OFF. Use
> responsibly. It may slow down backtest and introduce some slight
> changes to indicator values when your data has holes and holes are
> filled with previous bar data. The feature is intended to be used 
ONLY
> when your system uses general market timing (generates global 
signals
> based on data and/or indicators calculated using Foreign from
> 'reference' symbol). Note 2: if reference symbol does not exist, 
data
> won't be padded.
> > 
> >   l.. Auto Analysis/Settings, report tab: added ability to define
> risk-free rates for Sharpe and Ulcer Performance Index calculations.
> > 
> > CHANGES FOR VERSION 4.43.2 (as compared to 4.43.0)
> >   a.. backtester generates now error message when someone attempts
> to use buy/sell/short/cover signals in rotational mode
> >   b.. column headings fixed in AA porfolio backtest report 
> > CHANGES FOR VERSION 4.43.0 (as compared to 4.42.0)
> > 
> >   a.. Portfolio Optimize mode added 
> >   b.. in regular backtest mode now it is possible to specify the
> score of the symbol (on bar-by-bar basis) via PositionScore 
variable.
> In this mode the score is used only at trade ENTRY to decide which
> securities should be traded in case when there are more simultaneous
> entry signals than max. allowable positions or available funds.
> AmiBroker will 'prefer' securities with higher absolute value of the
> score. If PositionScore is not used then it is assumed to be 1 for 
all
> securities.
> >   NOTE: regular mode must be used for all your backtesting except
> the cases when you want rotational-trading (fund switching). Only
> regular mode uses buy/sell/short/cover signals.
> > 
> >   c.. rotational-trading mode must now be turned on by calling new
> EnableRotationalTrading() function at the top of your formula.
> >   AA / Settings / Portfolio:
> >   1. Max. Traded renamed to more meaningfull "Max. Open 
Positions" -
> defines the maximum number of positions (trades) that can be open
> simultaneously (at any time)
> >   2. Max. Ranked renamed to more meaningfull "Worst Rank Held"
> (rotational trading mode only) - must be equal or greater than max.
> open positions, if it is greater than Max. open positions then once 
a
> position is taken in a security it will not be exited until the
> ranking of that security drops below "Worst Rank Held"
> > 
> >   d.. "Allow same day exit (single bar trade)" now affects 
Portfolio
> test too.
> > 
> >   e.. SetOption() calls affect Portfolio backtest now added:
> >   SetOption("MaxOpenPositions") 
> >   SetOption("WorstRankHeld")
> >   SetOption("MinShares")
> > 
> >   f.. fixed Avg Profit/Loss figures in "all trades" section of
> portfolio report
> > 
> >   g.. added average PERCENT profit/loss figures
> > 
> >   h.. internal accuracy of calculations of LinearReg, LinRegSlope,
> LinRegIntercept, StdErr, TSF raised from 32 bit floating point to 64
> bit floating point
> > 
> >   i.. fix: rotational trading mode does not enter position when
> score is 999999
> > 
> >   j.. fixed column setup in AA
> > 
> >   k.. other minor fixes
> > 
> >   l.. as a temporary solution for people using Rx new version now
> uses HTMLView2.exe (that is shipped with the beta) to display the
> portfolio report.
> > 
> > CHANGES FOR VERSION 4.42.0 (as compared to 4.41.2)
> >   a.. first (incomplete) early beta version of the portfolio 
backtester
> >   b.. fixed plot of Null arrays using styleArea 
> >   c.. fixed display problem with % progress in single-stock
> optimization 
> >   d.. other minor fixes
> > 
> > CHANGES FOR VERSION 4.41.2 (as compared to 4.41.1)
> > 
> >   a.. now Sum produces values for periods upto and including
> BarCount, so Sum( array, BarCount ) gives the value instead of Null 
> >   b.. fixed problem with saving parameters on exit when the user 
did
> not specify default value for string parameter using ParamStr
("name", "")
> >   c.. fixed 38-byte memory leak when returning values from
> user-defined functions
> >   d.. real-time mode: after AFL syntax error commentary AFL editor
> is not refreshed until error is fixed and user presses 'apply'
> > 
> >   e.. eSignal 1.6.0 plugin 
> >   (available separately from
> http://www.amibroker.com/bin/eSignal160.exe):
> >     a.. much quicker backfills
> >     b.. implemented force-reconnect feature in eSignal plugin
> >     c.. fixed minor timing issue in eSignal plugin 
> >     d.. implemented workaround to invalid tick numbers sent
> sometimes by eSignal's data manager. 
> >   thanks to all users for reporting errors and helping ironing out
> outstanding issues.
> > 
> > CHANGES FOR VERSION 4.41.1 (as compared to 4.41.0)
> >   a.. fixed chart refresh locking that happened when user was
> drawing some object and abandonend it by pressing ESC key.
> >   b.. View->Refresh and View->Refresh All menus now reset internal
> chart refresh lock flag just in case.
> >   c.. plugin status is refreshed more often
> > 
> >   d.. maximum number of chart sheets increased to 60 (Caveat: when
> you increase the number of sheets you would not be able to use the
> layouts with OLDER versions of the software)
> >   e.. TimeFrameSet() now affects result of Interval() AFL 
function.
> TimeFrameRestore() resets it back.
> >   f.. Plot() makes copies of OHL arrays when styleCandle or 
styleBar
> is used so statements like
> >   SetForeign("AAPL");
> >   Plot( C, "Price", colorYellow, styleCandle );
> >   SetForeign("MSFT");
> >   Plot( C, "Price 2", colorBlue, styleCandle );
> >   plot correctly. Previously one would need to use PlotOHLC() or
> PlotForeign()
> > 
> >   g.. separate heap for syntax tree walker implemented, so larger
> AFL programs like PortfolioTrader should execute faster while
> retaining the speed improvement gained in 4.40.4 for small formulas.
> > 
> > CHANGES FOR VERSION 4.41.0 (as compared to 4.40.4)
> > 
> >   a.. legacy 'stoch()' function removed. Use StochK and StochD 
instead.
> >   b.. weekly / monthly charts are not affected by intraday
> compression settingsin preferences any more and always use last
> available day date for time stamp of time-compressed bar. 
> >   c.. Pref: Misc: auto-hide timeout field: added check for allowed
> values from 1...32
> > 
> > 
> >   d.. TimeFrameSet( interval ) function implemented
> >   - replaces current price/volume arrays: open, high, low, close,
> volume, openint, avg with time-compressed bars of specified interval
> once you switched to a different time frame all calculations and
> built-in indicators operate on selected time frame. To get back to
> original interval call TimeFrameRestore() funciton.
> > 
> >   e.. TimeFrameRestore()
> >   - restores price arrays replaced by SetTimeFrame. 
> >   Note that only OHLC, V, OI and Avg built-in variables are 
restored
> to original time frame when you call TimeFrameRestore(). All other
> variables created when being in different time frame remain
> compressed. To de-compress them to original interval use 
TimeFrameExpand
> > 
> >   f.. TimeFrameCompress( array, interval, mode = compressLast )
> >   - compresses single array to given interval using given mode,
> available modes:
> >   compressLast - last (close) value of the array within interval
> >   compressOpen - open value of the array within interval
> >   compressHigh - highest value of the array within interval
> >   compressLow - lowest value of the array within interval
> >   compressVolume - sum values of the array within interval
> > 
> >   g.. TimeFrameExpand( array, interval, mode = expandLast )
> >   - expands time-compressed array from 'interval' time frame
> >   ('interval' must match the value used in TimeFrameCompress or
> TimeFrameSet)
> >   Available modes:
> > 
> >     a.. expandLast - the compressed value is expanded starting 
from
> last bar within given period (so for example weekly close/high/low 
is
> available on Friday's bar)
> >     b.. expandFirst - the compressed value is expanded starting 
from
> first bar within given period
> >     (so for example weekly open is available from Monday's bar)
> > 
> >     c.. expandPoint - the resulting array gets not empty values 
only
> for the last bar within given period (all remaining bars are Null 
(empty))
> >     Caveat: expandFirst used on price different than open may look
> into the future.
> >     For example if you create weekly HIGH series, expanding it to
> daily interval using expandFirst will enable you to know on MONDAY
> what was the high for entire week.
> > 
> >     graph0 = TimeFrameExpand( TimeFrameCompress( Close, inWeekly,
> compressLast ), inWeekly, expandLast );
> >     graph1 = TimeFrameExpand( TimeFrameCompress( Open, inWeekly,
> compressOpen ), inWeekly, expandFirst );
> > 
> >   h.. TimeFrameGetPrice( pricefield, interval, shift = 0, mode =
> expandFirst );
> >   - references OHLCV fields from other time frames.
> >   This works immediatelly without need to call TimeFrameSet
> > 
> >   TimeFrameGetPrice( "O", inWeekly, -1 ) - gives you previous week
> OPEN price
> >   TimeFrameGetPrice( "C", inWeekly, -3 ) - gives you weekly Close
> price 3 weeks ago
> >   TimeFrameGetPrice( "H", inWeekly, -2 ) - gives you weekly High
> price 2 weeks ago
> >   TimeFrameGetPrice( "O", inWeekly, 0 ) - gives you this week open
> price.
> >   TimeFrameGetPrice( "H", inDaily, -1 ) - gives previous day high
> when working on intraday data
> > 
> >   Price field is one of the following
> >   "O", "H", "L", "C", "V", "I" (open interest)
> > 
> >   Shift works as in Ref() function but it is applied to compressed
> time frame.
> >   Note these functions work like these 3 nested functions
> >   TimeFrameExpand( Ref( TimeFrameCompress( array, interval,
> compress(depending on field used) ), shift ), interval, 
expandFirst )
> >   therefore if shift = 0 compressed data may look into the future 
(
> weekly high can be known on monday ). If you want to write a trading
> system using this function please make sure to reference PAST data 
by
> using negative shift value.
> >   The only difference is that TimeFrameGetPrice is 2x faster than
> nested Expand/Compress.
> > 
> >   i.. new interval / timeframe constants:
> >   in1Minute = 60
> >   in5Minute = 5 * 60 
> >   in15Minute = 15 * 60 
> >   inHourly = 3600 
> >   inDaily = 24 * 3600
> >   inWeekly = 5 * 24 * 3600 
> >   inMonthly = 25 * 24 * 3600 
> > 
> >   compressLast = 0 
> >   compressOpen = 1 
> >   compressHigh = 2 
> >   compressLow = 3 
> >   compressVolume = 4 
> > 
> >   expandLast = 0 
> >   expandFirst = 1 
> >   expandPoint = 2 
> > 
> >   j.. SetForeign( 'ticker' )
> >   - replaces current price/volume arrays with those of foreign
> security, returns True if ticker exists, False otherwise.
> >   If ticker does not exist (and function returns false) price 
arrays
> are not changed at all.
> > 
> >   Equivalent to the following sequence:
> >   C = Foreign( "ticker", "C" );
> >   O = Foreign( "ticker", "O" );
> >   H = Foreign( "ticker", "H" );
> >   L = Foreign( "ticker", "L" );
> >   V = Foreign( "ticker", "V" );
> >   OI = Foreign( "ticker", "I" );
> >   Avg = ( C + H + L )/3;
> > 
> >   but 6x faster (SetForeign takes about the same time as single
> foreign). To restore original prices call
> >   RestorePriceArrays();
> > 
> >   EXAMPLE:
> >   SetForeign( "MSFT" );
> >   dm = MACD(); // dm holds MACD of MSFT regardless of currently
> selected symbol
> >   RestorePriceArrays();
> >   Plot( dm, "MACD of MSFT", colorRed );
> >   Plot( MACD(), "MACD of " + Name(), colorBlue );
> > 
> >   k.. RestorePriceArrays();
> >   restores arrays overwritten by SetForeign/TimeFrameSet
> > HOW TO REPORT BUGS
> > 
> > If you experience any problem with this beta version please send
> detailed description of the problem (especially the steps needed to
> reproduce it) to bugs@xxxx


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/