CHANGES FOR VERSION 4.90.4 (as compared to 4.90.3)
- PointValue is now automatically set to 1 if FuturesMode is NOT enabled for given backtest (pre-4.90 behaviour)
- Fixed crash @040ecde occuring when user incorrectly specifed NULL as a plot color (this is user error but anyway should not crash) (FC#: 848)
- Fixed problem with data tips non displaying under some rare circumstances(FC#: 844)
- Fixed problem with loading layout that referenced non-existing symbol
- Max Title len increased to 9K characters (FC#: 534)
- Changes made to color/Thickness/Style of LOCKED studies is saved now even if position did not change (FC#: 846)
- Ticker bar now only needs pressing ESC once to lose focus (FC#: 842)
CHANGES FOR VERSION 4.90.3 (as compared to 4.90.2)
- Fixed GIF export from OLE level when bitdepth was not specified (FC#816)
- Notepad DEL key deletes one character now, not two (FC#817)
- MDITab titles are refreshed properly after loading the layout (FC#811)
- Layouts switching is faster
CHANGES FOR VERSION 4.90.2 (as compared to 4.90.1)
-
new account manager: fixed partial scaling out calcs
-
OLE automation server registration checks registry access rights
correctly on Windows Vista now (this prevents "Failed to update
registry. Try using REGEDIT" message on Vista)
-
Setup program now registers OLE servers by itself using elevated
rights on Vista (programs run with ordinary rights do not have access to
OLE
registration
on Vista)
-
AddToComposite: the combination
of atcEnableInIndicator + atcDeleteValues now invalidates cached foreign
data (FC#:
809)
CHANGES FOR VERSION 4.90.1 (as compared to 4.90.0)
CHANGES FOR VERSION 4.90.0 (as compared to 4.89.0)
- Fixed problem with information window length constraint being set wrong
sometimes. (for example TickSize in View->Information was limited
to 4 digits after entering Currency field)
- Bar Replay current position static is now updated when changing start
date
- Fixed problem RTQ window stopped updating the symbol when it was listed
twice in different tabs and removed from one (FC#: 439)
- Fixed data tooltip display when xshift != 0 (FC#: 465)
- Fixed vertical grid Z-order when graphgridzorder = 1 (FC#: 377)
- Added "Use as default" box to Horizonal Line properties dialog
- when checked, current drawing "show value" selection is stored
as a default for all newly created horizontal lines (FC#: 389)
- Added File->New->Pane (creates blank pane)
- Added File->New->Blank chart (creates blank chart - you can drag-drop
formulas on it)
- Window->New Linked window menu has been replaced by File->New->Linked
Chart
- #30339 the limit of drawings per symbol has been increased from 5000
to 65000
[And contrary to previous (faulty) behaviour when limit is reached, you don't
lose your previous drawings. Now you just can't save more than 65000 drawings
per one symbol.]
- Renamed Tools->Auto-update quotes (US & Canada) to Auto-update
quotes (AmiQuote only) - new installations only
- Removed Tools->Export to CSV - new installations only
- Clipboard copy/paste now works OK on "Symbol ticker" combo
(in the toolbar)
- Warning message when deleting symbols changed to "Are you sure to
delete current symbol from the DATABASE !"
- Added open interest as a predefined formula
- Account manager: 5-tier commission table added
- Duplicate shortcut Alt+d for Edit / Define removed. Define now uses
'f' shortcut (FC#: 219)
- BarReplay is now paused temporarily when user is drawing objects or
printing
- Thick dotted line is now plotted with geometic pen on Win2000/XP or
higher (FC#: 720)
- Fixed problem with passing HGDI handles when printing
- Account manager cash calculation when scaling in fixed (FC#: 793)
- Added styleNoRescale to Bollinger Bands in Price (all-in-one).afl
- ASCII importer: volume is now NOT to adjusted when ADJCLOSE and CLOSE
is used
[To turn on adjusting (old, pre-4.90 behaviour) you need to add $SPLITADJVOL
1 to command to ASCII importer definition]
- FuturesMode setting set using SetOption #24503 works the same as in the
settings dialog
[The difference was due to the fact that PointValue set in the Information
window was not transfered to the formula when
Futures Mode was NOT set in the Settings dialog (further change by SetOption
did not transfer it).
Now Point Value is transfered always.]
CHANGES FOR VERSION 4.89.0 (as compared to 4.88.0)
- AFL: Static variables are now case insensitive (FC#: 663)
- AFL: SetSortColumns() function (FC#: 607)
SetSortColumns( col1, col2, .... )
sets the columns which will be used for sorting.
col1, col2, ... col10 -Column numbers are ONE-based. Positive number means
sort ASCENDING, negative number means sort DESCENDING. Upto 10 columns can
be specified for multiple-column sort. Each subsequent call to SetSortColumns
overwrites previous one.
Examples:
SetSortColumns( 5 ) - sort by 5th column in ascending order
SetSortColumns( -3 ) - sort by 3rd column in descending order
SetSortColumns( 1, -2 );
- sort by 1st column in ascending order and then by second column in descending
order (multiple-column sort).
- Web Research: Synchronization with currently selected symbol has now
three options:
Don't sync - does not synchronize with currently selected symbol
Sync active - synchronizes only when web research is active (or becomes active
by clicking on it)
Sync always - synchronizes web page always, even if web research window is
not active - warning: resource intensive
- New Account Manager added (completed: 2006-12-19)
Account manager provides ability to track your account portfolio. Account
manager functionality provides superset of features offered by old portfolio
manager, but still some things are left todo namely: multi-currency handling,
more stats (backtest-like), multi-tiered commission schedules etc.
Short Instructions:
CREATE A NEW ACCOUNT:
Use File->New->Account menu to create new account
FUNDING AN ACCOUNT:
Before you do any trading, you have to fund your account. To do so press "FUNDING" button
on the account manager toolbar, then select "Deposit" as operation
type, enter the DATE when you have funded your account and enter the amount.
Note that funding date must PRECEDE any trading, as account manager won't
allow you to trade prior to funding date. Initial deposit will show as "initial
equity" in summary tab.
CHECK THE SETTINGS
It is good idea to go to "Summary tab" and setup commissions and
trading mode. If this account is used for End-of-day trading you should set "EOD
Mode" to YES, otherwise (if you trade intraday) you should set "EOD
Mode" to NO. Depending on this setting Buy/Sell dialogs will allowyou
to enter date and time of the trade or only date.
Commission schedule currently is only one-tier, in the future multiple-tier
commission schedules will be possible.
ENTERING TRADES:
Once you funded an account you can enter trades.To buy (enter long position
or cover short position ) click on "BUY" button.
Then in the Buy dialog you need to select the symbol, the trade date/time.
Once they are entered AmiBroker will display price of given symbol at the
selected date/time (or preceding one if no exact match is found). It will
also calculate maximum possible quantity taking price and available funds
into account.
You can change the price and quantity manually.
All other values (net market valye, commission, market deposit, currency,
fx rate) are calculated or retrieved automatically from Symbol->Information
page. Once values are good, click OK to confirm transaction. If you made
mistake, you can press UNDO (Edit->Undo) to revert last transaction.
Similar procedure is for selling (entering short positions or closing longs)
with the exception that you should press "SELL" button instead.
All transactions that you made are listed in the "Transactions" sheet.
All open positions are listed in "Open Positions" sheet. If you
enter the trade for symbol that has position already open, AMiBroker will
adjust "open positions" accordingly (perform scaling in/out). Once
open position is closed it is removed from "open positions" list
and moved to "Closed trades" sheet.
After each transaction, "Equity history" sheet is updated with
current account equity value and also "Summary" page is updated
with basic open/long/short trade stats.(More stats are to come).
IMPORTANT:
You have to remember that you must enter all transactions in chronological
manner(oldest first, newest last), as account manager won't allow you to
add trades out-of-order. If you make mistake, there is one-level undo that
you can use to revert to state before last transaction. If you made more
mistakes, the only option is to close account without saving and re-open
original file.
SAVING YOUR ACCOUNT DATA:
To save edits made to account use File->Save (or File->Save As to save
under new name). Note that account files are NOT encrypted now, and it is
quite easy to read the file for everyone who has the access to it. So make
sure not to leave your files on some public computer. Password protection/encryption
is planned but NOT implemented yet.
OPENING PREVIOUSLY CREATED ACCOUNT:
To open account file, go to File->Open, in the File dialog,select "Account
(*.acx)" from "Files of type" combo-box, and select the account
file you want to load.
MULTIPLE ACCOUNTS:
You can create/open multiple accounts at once (just use File->New->Account,
File->Open many times).
- Vertical selector line has now user-definable color / bold style and
it is plotted behind all graphs so it does not affect readability
Use Tools->Preferences->Color to adjust selector line color and style
- Charts: by default extra 3% space is added on the top of chart compared
to previous versions (4.88 or earlier)
- printf/strformat are now protected against buffer overrun (1024 bytes)
- Scroll-Bar Zoom feature implemented (dragging left or right edge of
chart scrollbar resizes it allowing to zoom in/out from the scrollbar)
(FC#619)
[To turn it OFF use
Tools->Preferences "Charting" tab:
UNCHECK "Enable Scroll Bar Zoom" box.]
- RequestTimedRefresh() was not always starting up correctly since 4.86
- fixed now.
- Range markers are now green (begin) and red (end) and are plotted with
lines with small 'flag-like' rectangle at the end
- When user types non-existing symbol in ticker box, AmiBroker asks whenever
it should be added or not
This allows very quick adding of new symbols directly from ticker box.
Just type symbol and press ENTER - if it does not exist - it will be added
and backfilled if you use real time data source
- When adding/deleting symbols, charts displayed keep selected symbol
- Added ability to create composites (using AddToComposite) inside indicator
code via new atcFlagEnableInIndicator flag (FC#: 191)
- AA window: now 'Sync chart' box is hidden when result list is maximized
- AFL: Implemented Say("text") function that speaks provided
text (Windows XP, on lower-end Windows you need to install Microsoft Speech
API, voice settings are in Windows Control Panel)
Example:
Say("Testing text to speech engine");
CHANGES FOR VERSION 4.88.0 (as compared to 4.87.1)
- Automatic Analysis window: Added "Sync chart on select" checkbox
when turned ON, selection of any line from result list automatically synchronizes
(displays) relevant chart. Selection can be made not only by mouse but
also by keyboard effectivelly allowing you to scroll through AA result
list using key down button and charts will be switching automatically.
Also when you press SPACE button, the arrows for selected trade/signal
will appear (only after backtest / scan)
- AFL Lexer code optimizations
Removed strncmp() C runtime calls from lexer and replaced it with hand optimized
code, gives on average 15% speed improvement on AFL execution on larger
formulas. NB. multi-line comment handling is speeded up this way as much
as 7 times.
- Bar Replay feature implemented (Tools->Bar Replay)
Bar Replay feature plays back data for ALL SYMBOLS at once. It means that
data for all symbols will end at specified "playback position".This
affects all formulas (no matter if they are used in charts or auto-analysis).
Controls description:
|<< - rewinds back to the beginning
< - one step back
[ ] - stop - turns bar replay OFF (chart are not affected by bar
reply)
|| - pause - pauses current playback or enters pause mode that
allows to manually drag the slider bar and affect chart display - in PAUSE
mode data are internally modified so quotes past selected "playback" position
are invisible to any part of AmiBroker ( charts / automatic analysis ),
except quotation editor
> Play - playback bars history
> - one step forward
>> | - goes to end of selected range
Slider bar - allows to see the playback progress as well as MANUALLY
move back and forward by dragging the slider thumb.
Start/End - controls provide start and end simulation dates. The
playback works so that all data UPTO currently selected "Playback
position" are visible. Data past this position are invisible. "Playback
position" can change from user-defined "Start" to "End"dates.
The small ^ buttons on the right side of Start / End date fields
allow to set Start/End to currently selected date on the chart.
Step interval - defines interval of the step. Recommended setting
is base interval of your database. So if you have 1-minute database, step
interval should be 1 minute. If you have EOD database, step interval should
be daily, however it is allowed to select higher step intervals. Note that
chart viewing interval is independent from that. So you can playback 1
minute database and watch 15 minute bars (they will look like real - building
last "ghost" bar as new data come in)
Speed parameter defines step frequency. It means how many steps
will be played back within one second.Default is 1. Maximum is 5 minimum
is 0.1. If you select 3 for example, AmiBroker will play one step every
0.333 sec giving total of 3 steps per second.
Skip afterhours - when turned on, playback skips hours outside
regular trading hours as defined in File->Database Settings->Intraday
Settings
Skip weekends - when turned on, playback skips Saturdays and Sundays
To ENTER PLAYBACK mode - press PLAY or PAUSE buttons - then data are truncated
at current "playback position")To EXIT PLAYBACK mode - press STOP
button or close Bar Replay dialog - the full data set will be restored.
Note that playback simulation is done internally and the database is kept
untouched in fact (all data are still visible in Quote Editor), so there
is no risk using Bar Reply.
- Added Insert->Select to Tools->Customize->Keyboard command list
to allow customers to add keyboard accelerator to this action
- Fib. TIME extensions , "lock position" now works correcly.
Also "bold" attribute can be now applied
CHANGES FOR VERSION 4.87.1 (as compared to 4.87.0)
- fixed symbol tree, right mouse click on the watch list causing exception
CHANGES FOR VERSION 4.87.0 (as compared to 4.86.0)
- Added "Request data on save" checkbox to File->Database
Settings->Intraday Settings
When this is turned ON, AmiBroker will query data plugin for fresh data when
saving database. This ensures that all collected real time data is transferred
to AmiBroker's own database.
Caveats:
1. if external data source uses automatic backfill - it may cause triggering
backfills during saving 2. turning this feature ON may slightly increase
CPU load
Recommendations:
Generally speaking all data sources with no backfill or slow backfill should
turn ON this feature,others (with fast backfill covering long histories)
should have this turned OFF.
IB plugin: recommended setting: ON
This feature is designed specifically with IB plugin in mind as it has very
limited backfill capabilities and it is good to savedata so it does not need
to be re-filled on next session.
eSignal plugin: recommended setting: OFF
Using eSignal with this feature turned on may cause excessive backfills and
exceeding eSignal symbol limit
IQFeed plugin: recommended setting: OFF
DDE plugin: recommended setting: ON
- Fixed minor save on exit problem
- New menu options
1. File->New -> Default Chart replaces Window->New
2. File->New -> Web Browser - creates new web browser window tab
3. File->New -> Account - creates new account manager window (still
in development, not available now) (Tools->Portfolio manager will soon
become obsolete)
4. File->New -> Database - replaces File-> New database
5. File->Save / Save As.- allows to save current document (such as HTML
page from the browser, or account information (in development))
6. File->Save All - saves ALL modified, open documents including all open
formula files
7. File->Close - closes currently open document (chart, browser or account)
Removed View->Profile menu option as it is now replaced by superior File->New->Web
Research
- Added Web Research window: multi-tab web browser with multiple built-in
financial sites templatized shortcuts
This feature effectively replaces and extends previous View->Profile functionality
that allowed to view single symbol profile web page. Now via File->New
-> Web Research you can open multiple (unlimited) tabbed web browsers
that allow to display unlimited(user configurable in Tools->Customize->Web
Pages. In addition to that the browser now features regular "Address" bar
that allows to type ANY URL address and use it as regular web browser.
" Open in New Window" option available from right click menu now opens
new web browser inside tab.
"
Sync" button when activated synchronizes web page with currently selected
symbol, so you can browse for example profiles of different symbols by
simply switching active symbol from the tree or combo box, without having
to type complex URL addresses.
- Added Customizing of Web Research addresses in Tools->Customize->Web
Pages dialog
Configuration data are stored in webpages.cfg plain text file that holds
any number of URL templates in the form of:
URLTemplate|Description
Description part is optional.URL template may use {t} marker that will be
replaced in runtime with currently selected ticker. For more info see:http://www.amibroker.com/guide/h_profiles.html(note
that old profile window is no longer available however, the URL template
encoding remains the same)
- Added ability to turn off MDI tabs (Tools->Customize->Appearance "Show
MDI tabs") - note however that it is not recommeded to turn them off
since window navigation will be more difficult
- Added Symbol->Next Sibling / Symbol->Prev Sibling commands to
Tools->Customize->Keyboard page (FC#.ID: 550)
This allows to navigate through symbols WITHIN selected category. On NEW
installations it will default to Alt+Shift+Left arrow/Right arrow
- Fixed "Remove" button positioning in Organize assignments
dialog
- Fixed combo box contents when "Indexes" are choosen in Assignment
organizer
- Implemented File->Save All - which saves all open, MODIFIED documents/files,
including AFL formulas
Note that because there is no editing functionality for HTML pages (Web Research
window) they are never in modified state, so they never get saved using "Save
All". To save HTML page you need to manually do Save on selected HTML
doc.
- Pane Up/Pane Down function does not change the original height of panes
moved
CHANGES FOR VERSION 4.86.0 (as compared to 4.85.0)
-
Added 'every tick' RT chart refresh in Professional Edition to already
existing 1-sec and up refresh intervals
To enable 'every tick' chart refresh in Professional Edition, go to Tools->Preferences,
Intraday tab and enter ZERO (0) into "Intraday chart refresh interval" field.
(note Standard Edition won't allow to do that).
Once you enter zero, AmiBroker will refresh all charts with every new
trade arriving provided that the formulasyou use execute fast enough.
If not, it will dynamically adjust refresh rate to maintain maximum possible
refresh rate without consuming more than 50% of CPU (on average). So
for example if your charts take 0.2 sec to execute AmiBrokerwill refresh
them on average 2.5 times per second.
Note: built-in Windows Performance chart shows cumulated CPU consumption
for all processes, to display PER-PROCESS CPU load use SysInternals free
software http://www.sysinternals.com/Utilities/ProcessExplorer.html
-
MDI tabs implemented
-
AFL: Added GetPerformanceCounter( bReset = False ) function
SYNTAX: GetPerformanceCounter( bReset = False )
RETURNS: Number
GetPerformanceCounter retrieves the current value of the high-resolution
performance counter. Returned value is in milliseconds. Resolution is
upto 0.001 ms (1 microsecond).The value of high-resolution counter represents
number of milliseconds from either system start (boot) or from last counter
reset.To reset the counter you need to call GetPerformanceCounter function
with bReset parameter set to True. Note that reseting counters inside
one formula does not affect counters in other formulas.Since returned
values are very large (time in milliseconds since system start is usually
quite large), for precise measurements of single function or small function
block execution times it is strongly recommended to reset counter at
the beginning of the block so floating point resolution (7 digits) does
not affect the precision of measurement. Example:
GetPerformanceCounter(True); //
reset counter to zero
for(
i = 0; i < 1000;
i++ )
{
k = sin( i
);
}
elapsed=GetPerformanceCounter();
"Time [ms] = "+elapsed;
The code above shows that 1000 iterations of sin() calculation takes about
1.7 milliseconds. Note that call to the GetPerformanceCounter() has overhead
of about 0.015 ms (15 microseconds)
GetPerformanceCounter function may also be used to report time since system
start:
elapsed=GetPerformanceCounter();
StrFormat("Time
since system start %.0f days, %.0f hours, %.0f minutes, %.0f seconds,
%.0f milliseconds ",
floor(elapsed/(24*60*60*1000)),
floor( elapsed/(60*60*1000)
) % 24,
floor( elapsed/(60*1000)
) % 60,
floor( elapsed/1000 )
% 60,
elapsed % 1000 );
It can be also used in trading system automation to measure time in
milliseconds between various events (just subtract values returned by
GetPerformanceCounter() during two different events)
Caveat: this function relies on Windows API QueryPerformanceCounter
function and CPU RTDSC instruction and it may yield to inaccurrate results
if you have multiple-core processor and AMD's "Cool and Quiet" enabled
in BIOS or other CPU clock stepping technologies enabled. If this applies
to you, you may check Microsoft hotfix to this problem at: http://support.microsoft.com/?id=896256
-
Fixed crash that sometimes occurred when chart using RequestTimedRefresh()
was closed
-
Added "Cancel" button to "Do you want to save database:
Yes/No" dialog that appears on AB exit when database is modified
-
Added registry key for controlling built-in exception handling.
If you are 3rd party developer working with Visual C++ debugger and
wanting exceptions to be caught by Visual Studio debugger instead of
AmiBroker's built-in crash recovery system contact AmiBroker support
and we will provide instructions how to disable it.
-
AFL: atan2( y, x ) implemented
atan2 returns the arctangent of y/x. If x is 0, atan returns 0. If both
parameters of atan2 are 0, the function returns 0. While atan returns a
value in the range –PI/2 to PI/2 radians; atan2 returns a value in
the range –PI to PI radians, using the signs of both parameters to
determine the quadrant of the return value.
-
AFL: FFT( array, size = 0 ) function implemented
FFT( array, len = 0 )
performs FFT (Fast Fourier Transform) on last 'len' bars of the array,
if len is set to zero, then FFT is performed
on entire array. len parameter must be even.
Result:
function returns array which holds FFT bins for first 'len' bars. There
are len/2 FFT complex bins returned,
where bin is a pair of numbers (complex number): first is real part of
the complex number and second number
is the imaginary part of the complex number.
result = FFT( array, 256 );
where:
0th bin (result[0] and result[1]) represents DC component,
1st bin (result[1 ] and result[2]) represents real and imaginary parts
of lowest frequency range
and so on upto result[ len - 2 ] and result[ len - 1 ]
remaining elements of the array are set to zero.
FFT bins are complex numbers and do not represent real amplitude and
phase. To obtain amplitude and
phase from bins you need to convert inside the formula. The following code
snipplet does that:
ffc = FFT(data,Len);
for( i = 0;
i < Len - 1;
i = i + 2 )
{
amp[ i ] = amp[ i + 1 ]
= sqrt(ffc[ i ]^ 2 + ffc[
i + 1 ]^2);
phase[ i ] = phase[ i + 1 ]
= atan2( ffc[ i + 1],
ffc[ i ] );
}
IMPORTANT note: input array for FFT must NOT contain any Null values.
Use Nz() function to convert Nulls to zeros
if you are not sure that input array is free from nulls.
Example formula:
SetBarsRequired(100000,100000);
Len = Param("FFT
Length", 1024, 64, 10000, 10 );
Len = Min( Len, BarCount );
x = BarIndex();
x1 = x - BarCount +
Len;
input = C;
a = LastValue( LinRegIntercept(
input, Len - 1 )
);
b = LastValue( LinRegSlope(
input, Len - 1 )
);
Lr = a + b * x1;
data = input - Lr;// de-trending
ffc = FFT(data,Len);
for( i = 0;
i < Len - 1; i
= i + 2 )
{
amp[ i ] = amp[ i + 1 ]
= sqrt(ffc[ i ]^ 2 + ffc[
i + 1 ]^2);
phase[ i ] = phase[ i + 1 ]
= atan2( ffc[ i + 1],
ffc[ i ] );
}
auto = ParamToggle("Auto
dominant cycle", "No|Yes", 1 );
sbar = Param( "Which
FFT bin", 1, 0, 50 );
skipbin1 = ParamToggle("Skip
1st FFT bin", "No|Yes", 1 );
if(
auto )
{
sbar = int( LastValue(ValueWhen(
amp == LastValue(Highest( IIf(
skipbin1 AND x < 4, 0 ,
amp ) )), x / 2 )) );
}
fv = Status("firstvisiblebar");
thisbar = Ref( int(x/2)
== sbar, -fv);
Plot( Ref(amp,-fv),
"amplitude (bin " + Ref( int(x/2),
-fv ) +")", IIf(
thisbar, colorRed, colorBlack ),styleArea);
Plot( IIf( BarCount - BarIndex() < Len,
data, Null )
,
"de-trended input ("+Len+" bars)", colorOrange, styleLeftAxisScale );
Plot( cos(
phase[ sbar * 2 ]
+ (sbar) * x1 * 2 * 3.1415926 /
Len ),
"
dominant cycle "+ Len/(sbar) + "(" +
sbar + " bin) bars", colorBlue, styleOwnScale );
GraphZOrder=1;
GraphXSpace = 10;
-
Fixed: pre-defined color table in broker.prefs sometimes got corrupted
-
Repainting of RT quote window is now flicker-free on Windows XP and
higher
-
Symbol->Organize assignments, added ability to remove multiple symbols
at once from watch list, index and favourite categories
CHANGES FOR VERSION 4.85.0 (as compared to 4.84.0)
- AFL: Added DateTimeConvert function (FC#: 297)
DateTimeConvert( format, date, time = Null )
The function allows to convert from DateTime format to DateNum and TimeNum
and vice versa.
format parameter controls the direction of conversion:
format = 0 - converts DateTime format to DateNum format, example
mydatenum = DateTimeConvert( 0, DateTime()
);// - this returns DateNum
date argument should be in datetime formattime argument in this case should
not be used
format = 1 - converts DateTime format to TimeNum format, example:
mytimenum = DateTimeConvert( 1, DateTime()
); // - returns timenum
date argument should be in datetime formattime argument in this case should
not be used
format = 2 - converts from DateNum and optionally TimeNum to DateTime format,
example:
mydatetime = DateTimeConvert( 2, DateNum(), TimeNum()
);
date argument should be in datenum formattime argument (optional) should
be in timenum format. In case of EOD data you can skip time argument:
mydatetime = DateTimeConvert( 2, DateNum()
);
- K-ratio is now reported with 4 decimal places (FC#: 357)
- Added 'left side' display option to horizontal line labels and fixed
problem with label sometimes disappearing (completed: 2006-08-15) (FC#:
342)
- AFL: fgetstatus( filename, what, format = 0 )
Implemented
fgetstatus( filename, what, format = 0 )
function that retrieves file properties/status.
Returns NUMBER or STRING depending on format parameter
If file does not exist it returns Null.
Parameters:
filename - the name of the file (with or without full path) to query
what - specifies what file property to retrieve, allowable values
0 - the date/time the file was created
1 - the date/time the file was last modified
2 - the date/time the file was last accessed for reading
3 - the file size in bytes
4 - attribute byte of the file
format - specifies return format of date/time values (format specifications
are the same as in Now() function):
allowed values:
0 - returns string containing date/time formatted according to system settings
1 - returns string containing date only formatted according to system settings
2 - returns string containing time only formatted according to system settings
3 - returns DATENUM number with date
4 - returns TIMENUM number with time
5 - returns DATETIME number with date/time
6 - returns date DAY (1..31)
7 - returns date MONTH (1..12)
8 - returns date YEAR (four digit)
9 - returns date DAY OF WEEK (1..7, where 1=Sunday, 2=Monday, and so on)
10 - returns date DAY OF YEAR (1..366)
Note that Windows supports only 2 second resolution of file date/time stamps.
Example:
// get modification
date string of portfolio.afl file
fgetstatus("formulas\\Equity\\portfolio.afl",1,0);
- AFL: GetTradingInterface uses WaitForInputIdle now instead of fixed
interval wait when launching IB interface
- Disabled snapping to pixel resolution after manual editing of drawings
#32071
CHANGES FOR VERSION 4.84.0 (as compared to 4.83.1)
- Added GradientFillSlow code to support gradients on printers and metafiles
which do not support them natively (completed: 2006-07-28)
- Added GraphGridZOrder variable to control when grid lines are plotted
(completed: 2006-07-31) (ext.ID: 351)
When you specify
GraphGridZOrder = 1;
then grid lines are plotted on top of any charts
- AFL: new function RequestTimedRefresh( interval, onlyvisible = True )
(completed: 2006-08-06)
RequestTimedRefresh( interval, onlyvisible = True )
- causes given indicator window to refresh automatically every <interval> seconds
regardless of data source used or connection state.
interval parameter defines timeout in seconds between refreshes.
AmiBroker attempts to align refreshes to second boundaryso if you call
it RequestTimedRefresh( 5 ) you should get refreshes at 0, 5, 10, 15, 20,
25, 30, 35, 40, 45, 50 and 55 second of the minute.Due to the way how regular
(low overhead) timers are implemented in Windows they have accurracy of
+/-55ms providedthat CPU is not very busy. Don't expect to get first line
of your code to execute exactly at .000 milliseconds. This varies depending
on machine load, number of quotes, system time slice and tens of other
factors.Usually (on my testing machines) the first line of the code executes
anywhere in the first 100 ms of the second, provided that other processes
do not interfere. Windows is not real-time operating system and it does
not guarantee any fixed execution/reaction times.
onlyvisible parameter set to True (default value) means that refreshes
are triggered only for visible and not minimised windows. This applies
also to main AmiBroker window - when it is minimised charts are NOT refreshed
by default. To force refreshes when window is minimised you need to set
this parameter to False. Note that this visibility applies to mostly to
'minimised' state or the situation when you move chart outside the boundary
of physical screen so it is not visible to an eye but still open. It does
not apply to chart windows that are on placed on inactive sheets, as they
do not really exist until they are shown (this way AmiBroker conserves
memory and CPU) and as non-existing, can not be refreshed.
Example:
RequestTimedRefresh( 5 ); // automatically refresh this particular chart
every 5 seconds
Hint: to detect whenever given refresh comes from timer or user action you
can use Status("redrawaction") function. It returns 0 for regular
refresh (user action) and 1 for timer-refresh
- AFL: Status("redrawaction") added (completed: 2006-08-06)
Status function now supports new field: redrawaction
Status("redrawaction")
It returns 0 (zero) for regular refreshes, and 1 for refreshes triggered
via RequestTimedRefresh(). Note that in the future more return values can
be added.
Example:
if( Status("redrawaction")
==1 )
{
_TRACE("\nTIMED
REFRESH"+Now());
}
RequestTimedRefresh(1);
- CreateStaticObject() actually calls internal CreateStaticObject :-)
- for some reason it was calling regular CreateObject() instead. (completed:
2006-07-27)
- Fixed problem with HoldMinDays sometimes allowing exit too soon (completed:
2006-07-29)
- Fixed: Custom metric sort problem in optimization result list (occurred
in 4.83 only) (completed: 2006-07-29) (ext.ID: 345)
- Pane resizing algorithm changed so if you drag the divider between panes
only neighbouring panes are resized (others remain unchanged)
- Real time quote parent window has WS_CLIPCHILDREN style in order to
fix some minor redraw issue (completed: 2006-07-31)
CHANGES FOR VERSION 4.83.1 (as compared to 4.83.0)
- Fix to FC#302 caused problems with calling COM properties with parameters.
This is now fixed.
CHANGES FOR VERSION 4.83.0 (as compared to 4.82.0)
- Added detection of multiple copies of plugins for the same data source
(completed: 2006-07-26)
This (multiple copies of the plugins for same data source) was causing problems
and lots of support issues because people were using old plugins even if
they installed (newer) copy of the plugin. This was so becasue AB always
used first one encountered in given directory and it usually was the oldest
one. Now AB displays warning message that there are multiple copies of the
same plugin and then they must be renamed or removed.
- Added HoldMinDays and EarlyExitDays options to SetOption() (completed:
2006-07-27)
In addition to already exitsing functionality of HoldMinBars / EarlyExitBars,
new options to specify min hold/penalty period in CALENDAR DAYS (as opposed
to bars).
SetOption("HoldMinDays", 30 ); //
set minimum holding period to 30 calendar days
SetOption("EarlyExitDays", 90 ); //
set penalty period to 90 calendar days
Note that you can use one or another (not both at the same time) for one
parameter, so you can specify minimum holding period in either days or bars
(but not both at the same time). The same with EarlyExit period. You may
however use different specifications (i.e. days/bars) for EarlyExit and HoldMin
(they are independent from each other).
- Added scoreExitAll constant that causes rotational mode backtester
to exit all positions regardless of HoldMinBars (completed: 2006-07-27)
Note that this is global flag and it is enough to set it for just any single
symbol to exit all currently open positions, no matter on which symbol you
use scoreExitAll (it may be even on symbol that is not currently held). By
setting PositionScore to scoreExitAll you exit all positions immediatelly
regardless of HoldMinBars setting.
Example:
PositionScore = ..your normal score..
// if market timing signal goes negative close
all posiitons
PositionScore = IIf(
MarketTimingSignal < 0, scoreExitAll, PositionScore );
NOTE: This flag works ONLY in rotational trading mode (in regular mode it
is easy to generate such global exit by ORing sell signal with global sell
signal).
- CBT: Added ExitReason property to Trade object (completed: 2006-07-18)
(FC#: 88)
- Chart Tree - RMB - Edit - now restores and focuses to already opened
formula editor (if it is during editing) (completed: 2006-07-24) (FC#:
300)
Note that you can still open NEW instance of the editor with the very same
file (for comparison and to see the original contents) by holding down SHIFT
key when choosing "EDIT" menu.
- Eliminated extra unnecessary refreshes of commentary window when new
symbol was picked from ticker selector (completed: 2006-07-24)
- Fixed calling parameter-less JScript functions from AFL level via GetScriptObject()
(completed: 2006-07-19) (FC #: 302)
- Fixed: wrong estimated time in progress dialog when number of steps
is greater than 2^32 (4294967296) (allocated to: 4.80.2) (completed: 2006-07-24)
- AFL: Added Gradient background coloring (SetChartBkGradientFill function)
(completed: 2006-07-26)
Gradient fill of chart interior is now available via SetChartBkGradientFill
function.
Please note that this is independent from chart background color (background
color fills entire pane, gradient fill is only for actual chart interior,
so axes area is not affected by gradient fill)
SetChartBkGradientFill( topcolor, bottomcolor, titlebkcolor =
default )
topcolor - specifies top color of the gradient fill
bottomcolor - specifies bottom color of the gradient fill
titlebkcolor - (optional) the background color of title text. If not specified
then top color is automatically used for title background.
Example:
SetChartBkGradientFill( ParamColor("BgTop", colorWhite),ParamColor("BgBottom", colorLightYellow));
- Multiple tabs in RTQ window (completed: 2006-07-18) (FC#: 22)
RT quote window tabs behave the same as chart tabs: can be renamed with right
mouse button and dragged from one place to another.
20 tabs are currently available.
- Non-numeric custom trade metrics are not formatted with thousands separators
anymore (completed: 2006-07-21) (FC#: 314)
- now Tools->Preferences->Misc "Decimal places in RT quote window" allows
to specify upto 6 decimal places. (completed: 2006-07-25)
- OLE: Fixed default property (Item) marker for Windows collection (completed:
2006-07-18)
- Progress dialog: now estimated time is displayed in years/days if it
is large enough (completed: 2006-07-24)
CHANGES FOR VERSION 4.82.0 (as compared to 4.81.1)
CHANGES FOR VERSION 4.81.1 (as compared to 4.81.0)
- fixed problem with some of the watch lists not showing up in 4.81.0
CHANGES FOR VERSION 4.81.0 (as compared to 4.80.2)
- Database structure changed to hold new fundamental data - quarterly EAT/EBT/Sales
figures, Code and Nominal value have been replaced by new fields.
Despite these changes files are still backward and forward compatible - so
it can be read by any other AB version, the only minor inconvenience is that
if you load new file into old version (pre-4.81) of AmiBroker you will see
weird numbers in old "Finances" dialog as well as in "Shares
out." and "Book Value" fields.
- Implemented new View->Information property page featuring extra fundamental
data fields
-
OLE: added new fundamental data fields to Stock object
Stock object has now the following properties:
string Ticker;
Collection Quotations;
string FullName;
boolean Index;
boolean Favourite;
boolean Continuous;
long MarketID;
long GroupID;
float Beta;
float SharesOut;
float BookValuePerShare;
float SharesFloat;
string Address;
string WebID;
string Alias;
boolean IsDirty;
long IndustryID;
long WatchListBits;
long DataSource;
long DataLocalMode;
float PointValue;
float MarginDeposit;
float RoundLotSize;
float TickSize;
long WatchListBits2;
string Currency;
string LastSplitFactor;
DATE LastSplitDate;
float DividendPerShare;
DATE DividendPayDate;
DATE ExDividendDate;
float PEGRatio;
float ProfitMargin;
float OperatingMargin;
float OneYearTargetPrice;
float ReturnOnAssets;
float ReturnOnEquity;
float QtrlyRevenueGrowth;
float GrossProfitPerShare;
float SalesPerShare;
float EBITDAPerShare;
float QtrlyEarningsGrowth;
float InsiderHoldPercent;
float InstitutionHoldPercent;
float SharesShort;
float SharesShortPrevMonth;
float ForwardDividendPerShare;
float ForwardEPS;
float EPS;
float EPSEstCurrentYear;
float EPSEstNextYear;
float EPSEstNextQuarter;
float OperatingCashFlow;
float LeveredFreeCashFlow;
-
AFL: new function GetFnData() - allows accessing fundamental data
SYNTAX: GetFnData("field")
RETURNS: number
"field" can be one of the following:
"EPS"
"EPSEstCurrentYear"
"EPSEstNextYear"
"EPSEstNextQuarter"
"PEGRatio"
"SharesFloat"
"SharesOut"
"DividendPayDate"
"ExDividendDate"
"BookValuePerShare"
"DividendPerShare"
"ProfitMargin"
"OperatingMargin"
"OneYearTargetPrice"
"ReturnOnAssets"
"ReturnOnEquity"
"QtrlyRevenueGrowth"
"GrossProfitPerShare"
"SalesPerShare"
"EBITDAPerShare"
"QtrlyEarningsGrowth"
"InsiderHoldPercent"
"InstitutionHoldPercent"
"SharesShort"
"SharesShortPrevMonth"
"ForwardDividendPerShare"
"ForwardEPS"
"OperatingCashFlow"
"LeveredFreeCashFlow"
"Beta"
"LastSplitRatio"
"LastSplitDate"
-
ASCII importer: added support for new fundamental data fields :
$FORMAT command now supports additional fields:
DIV_PAY_DATE
EX_DIV_DATE
LAST_SPLIT_DATE
LAST_SPLIT_RATIO
EPS
EPS_EST_CUR_YEAR
EPS_EST_NEXT_YEAR
EPS_EST_NEXT_QTR
FORWARD_EPS
PEG_RATIO
BOOK_VALUE (requires SHARES_OUT to be specified as well)
BOOK_VALUE_PER_SHARE
EBITDA
PRICE_TO_SALES (requires CLOSE to be specified as well)
PRICE_TO_EARNINGS (requires CLOSE to be specified as well)
PRICE_TO_BV (requires CLOSE to be specified as well)
FORWARD_PE (requires CLOSE to be specified as well)
REVENUE
SHARES_SHORT
DIVIDEND
ONE_YEAR_TARGET
MARKET_CAP (requires CLOSE to be specified as well - it is used to calculate
shares outstanding)
SHARES_FLOAT
SHARES_OUT
PROFIT_MARGIN
OPERATING_MARGIN
RETURN_ON_ASSETS
RETURN_ON_EQUITY
QTRLY_REVENUE_GROWTH
GROSS_PROFIT
QTRLY_EARNINGS_GROWTH
INSIDER_HOLD_PERCENT
INSTIT_HOLD_PERCENT
SHARES_SHORT_PREV
FORWARD_DIV
OPERATING_CASH_FLOW
FREE_CASH_FLOW
BETA
(see Formats\aqfe.format and Formats\aqfn.format files for example usage)
-
Removed Stock->Information and Stock->Finances dialogs (this
functionality is replaced by View->Information - new dockable property
window)
-
AFL: new function StrReplace( string, oldsubstring, newsubstring
)
-
Fixed crash occuring sometimes if "Symbol->Watch List->Type-in" symbol
was longer than maximum allowable length (allocated to: 4.80.2)
-
Foreign() function changed. Now by default missing data bar OHL
fields are filled using previous bar Close and volume is set to zero.
It is possible to turn old behaviour (filling missing bar OHL fields
using previous bar OHL fields and copying previous bar volume) if you
use
Fixup parameter set to 2.
Foreign("MSFT","O", 2 ); // old-style (pre-4.81)
fill
-
Scaling-in profit% calculations modified to use total cost instead
of max. pos value
-
ships with AmiQuote 1.90 featuring automatic download and import
of fundamental data from Yahoo Finance. See
AmiQuote\ReadMe2.html for
the details.
CHANGES FOR VERSION 4.80.2 (as compared to 4.80.1)
-
Changed %profit calculation when scaling-in is used to use maximum
number of shares ever held as a “base” of %profit calculation
- this leads to “most conservative” % figures, compared to
using just initial entry value.
-
Prec() function improved so it does not show rounding errors when
working on integer
CHANGES FOR VERSION 4.80.1 (as compared to 4.80.0)
- fixed problem with Easy Alert window not accepting new alerts in some
circumstances
- included new IB plugin version 1.6.2 (FC issue #54)
CHANGES FOR VERSION 4.80.1 (as compared to 4.80.0)
- fixed problem with Easy Alert window not accepting new alerts in some circumstances
- included new IB plugin version 1.6.2 (FC issue #54)
CHANGES FOR VERSION 4.80.0 (as compared to 4.79.0)
-
Added extra information to "detailed log" to show commissions
charged during scaling and both average and current exit price
-
Partial exit (scale-out) profits are included now in trade stats
-
Fix EOD missing Friday if "Filter weekedns" is turned
ON and Daily compression uses Night / Day session settings (#28659)
-
AFL Editor: Added F1 handling of for/while/do-while/if-else
-
"SCAN" now displays prices using 4 decimal places
-
Fixed problem with progress bar locking active window instead of
AA window when in run-every mode
-
Fixed: Layouts messed up with multiple instances running (ext.ID:
3)
-
"Margin requirement" in the AA settings renamed to "ACCOUNT
margin" to clearly show that it is NOT futures margin
-
Eliminated resource leak in ExportImage OLE function
-
Fixed potential thread interlock in Indicator Maintenance wizard
(should prevent hangup especially on multi-CPU/core machines)
-
Indicator tables are written to file (broker.newcharts) after each
chart insert, before and after Ind. Maintenance just to prevent data loss
if AB is not closed properly
-
Symbol->Watch List->Import refreshes entire symbol tree,
not only watch list leaf
- added few new formulas into Formulas\Indicators folder
CHANGES FOR VERSION 4.79.0 (as compared to 4.78.1)
- Added HoldMinBars feature that disables exit during user-specified number
of bars even if signals/stops are generated during that period
Please note that IF during HoldMinBars period ANY stop is generated it is
ignored. Also this period is ignored when it comes to calculation of trailing
stops (new highest highs and drops below trailing stops generated during
HoldMinBars are ignored).This setting, similar to EarlyExitFee/EarlyExitBars
is available on per-symbol basis (i.e. it can be set to different value for
each symbol)
Example:
SetOption("HoldMinBars", 127 );
Buy=BarIndex()==0;
Sell=1;
// even if sell signals are generated each day,
//they are ignored until bar 128
- additional checks added to ensure proper operation of individual equity
chart
AA window generates error if it can not write LastBacktestFormula to the
registry AA complains with error message when individual equity formula does
not contain #include @LastBacktestFormula statement that is required for
proper operation
(it includes the formula used in last backtest so Equity() function can process
it)
- AFL formula editor toolbar / menu is now customizable
Asc() function for converting first character of the string to the ASCII
code
Asc( string, pos = 0 )
Returns the ANSI character code corresponding to the first letter in a string
(if position is not specified) or code of character at specified position.
If you don't specify position (pos argument) then first character is used.
Negative values of pos reference characters counting from the end of string.
Useful for creation of exploration that displays single letters for signals
instead of numbers.
Buy = Cross(MACD(),Signal());
Sell = Cross(Signal(),MACD());
Filter = Buy OR Sell;
AddColumn( IIf( Buy,
Asc("B"), Asc("S")), "Signal", formatChar );
- Changed EarlyExitFee functionality so it does NOT affect equity (and
stats like drawdowns) if position is not liquidated during early bars
- Chart sheet tabs improvements: added drag-drop moving, quick selection
menu, home/end buttons
- Fix: double click on Y axis does not turn <> range markers anymore
(allocated to: 4.79.0)
- Fix: Param slider, when step =2 and start is odd (for example 3 ) then
subsequent values were even (they should be odd 3, 5, 7,...) now it is
fixed
- Fixed handling of mixed color encodings in AddColumn (pre-defined color
constants did not work together with ColorRGB / ColorHSB, now it is fixed)
Example of code that did not work correctly in 4.78.1 and earlier but now
works fine.
Filter = 1;
AddColumn(Close, "Close", 1.2, colorDefault, ColorRGB(255, 0, 0)
); // this
works
AddColumn(Close, "Close", 1.2, ColorRGB(0, 0, 255), ColorRGB(255, 0, 0)); // this
works
AddColumn(Close, "Close", 1.2, colorBlue, ColorRGB(255, 0, 0)); //
this works in 4.79, but didn't in previous versions
AddTextColumn(" ", " ");
AddColumn(Close, "Close", 1.2, ColorRGB(255, 0, 0), colorDefault); // this
works
AddColumn(Close, "Close", 1.2, ColorRGB(255, 0, 0), ColorRGB(0, 0, 255)
); // this
works
AddColumn(Close, "Close", 1.2, ColorRGB(255, 0, 0), colorBlue); //
this works in 4.79, but didn't in previous versions
- Fractional increments on Y axis: added 1/320 increment (to use for example
with ZT contract) and changed display method so integer part is separated
from fractional part by ^ character
- Implemented easy real-time alerts (allocated to: 4.79.0)
"easy alerts" are available from RTquote window context menu.
(Click on Real Time Quote window with RIGHT mouse button and select "Easy
Alerts" option
- then define alerts you want to generate using real time streaming quotes).
If you add any alerts, please note that symbols used in alerts add up to
total number of streaming symbols, so if you have 50 symbol limit on your
data source and have 40 symbols in your real time quote window you will be
able to setup alerts for only 10 extra symbols (if you use the same symbols
as in real time quote window then it does not add up to the total count)
- OLE: added ability to control sorting in AA window from OLE level
Object:
Analysis
New method:
SortByColumn( iColumn, bAscending, bMultiMode )
where iColumn - is zero-based column index to sort bybAscending - true/false
decides the order we wantbMulti - if set to false - it means that we want
to sort by single column or we define starting column for multi-column sortif
set to true - it means that we are defining additional columns for multiple-column
sort.So to sort by many columns you need to call SortByColumn once with bMulti
set to false and then call SortByColumn for all remaining sort columns with
bMulti set to true.
Example (multiple column sort by column 1 and 2):
AB = new ActiveXObject("Broker.Application");AA
= AB.Analysis;
// sort by date/time column
AA.SortByColumn( 1, False, False );
// add secondary sort column (see last argument
= True)
AA.SortByColumn( 2, False, True );
- OLE: added Application.Visible property
AB = new ActiveXObject("Broker.Application");
AB.Visible = True;
WScript.Sleep(1000);
AB.Visible = False;
WScript.Sleep(1000);
AB.Visible = True;
WScript.Sleep(1000);
AB.Quit();
- OLE: when AmiBroker is created from OLE, it loads default layout now
(previous versions did not
- Scaling in/out fixes: added extra checks not to exceed available cash
(scaling-in) and not to drop below zero shares (scaling out)
- Time&sales now allows the user to disable display of bid/ask and/or
trades
By default both trades and bidl/ask quotes are shown, but now you can decide
to turn off either one or both by clicking with RIGHT mouse button over Time&Sales
window and checking/unchecking "Show Trades" and "Show Bid
/ Ask Quotes"
menu items.
- Tools: Preferences: Misc, renamed "Save on exit" to "Auto-save" and
changed auto-save logic, so layouts are saved on each change
When Auto-save: Layouts is turned ON, currently loaded layout is saved on
change (i.e. when another layout is loaded, previously selected layout changes
are saved first), the same with database load - if you load different database
then recently used layout is stored automatically. IMPORTANT: changes are
saved now to most recently loaded layout (not to 'default' one as it was
before). So default layout is NOT affected by auto-save if you manually loaded
different layout.
CHANGES FOR VERSION 4.78.1 (as compared to 4.78.0)
- atcFlagEnableInPortfolio now works fine with atcFlagCompositeGroup flag.
Previously using atcFlagCompositeGroup (or atcFlagDefaults) prevented creation
of composite in custom backtest procedure (even if atcFlagEnableInPortfolio
was specified). atcFlagEnableInPorfolio worked only without it. Now it
is fixed (works fine with or without atcFlagCompositeGroup)
- AFLEditor: Edit->Replace fixed
- HTMLExport: fixed crash occuring sometimes when lots of columns were
used
- HTMLExport: fix: colorDefault is not BLACK for background (bgcolor in <TD> tag
is skipped) [(this also reduces file size)
- HTMLExport: header row is in separate line (CR at the end)
- backward compatiblity fix for ExportImage() function (when width and
height are not provided then default - current window size - is used)
(NOTE: this also fixes Edit->Image->Export )
CHANGES FOR VERSION 4.78.0 (as compared to 4.77.0)
- AA: HTML export added that supports FULL COLOR output
To export to HTML just click "EXPORT" button in AA window and select "HTML
files" from "Files of type" combo box in file dialog.
You can also use OLE interface Export method - if EXTENSION provided in the
file name is .html then AmiBroker will output HTML file,
otherwise it will output CSV (text) file. If you want colorful output in
Excel, just EXPORT the file to HTML and load it into Excel (or drag-drop
to excel).
Please note that Excel color palette is limited (not all 16 million colors
available in AmiBroker can be represented in Excel) Example colorful test
exploration:
Filter=1;
for( i = 0;
i < 256; i = i
+ 16 )
AddColumn( C, "C"+i, 1.2, colorDefault, ColorHSB(
( BarIndex() + i )
% 256, 255-i, 255 )
);
- List control code reviewed for better 64bit compatibility
- List selection is maintained after sorting
- Multiple column sort implemented in AA result list (and other list controls
as well)
To sort by more than one column:
a) click the FIRST column then
b) SHIFT-click second, third, fourth column ... and so on (upto 40 columns
can be sorted at once)
(to SHIFT-click means to click with left mouse button while having SHIFT
key pressed down)
c) to change the Asc/Desc order click on the same column again
To restart sorting, release SHIFT key and click on column (it will become
first).
Subsequent columns (in the order you have clicked on them) are marked with
1, 2, 3, 4, 5, 6, 7, 8, 9 numbers
(if you select more than 10 columns, then all columns above 10th will be
marked with '...')
- Backtester: added EarlyExitBars/EarlyExitFee functionality (not supported
by old (v.4.4) backtester)
Early exit (redemption) fee is charged when trade is exited during first
N bars since entry.
The fee is added to exit commission and you will see it in the commissions
reported for example in detailed log. It is also reflected in the portfolio
equity (so for first N bars since entry portfolio equity is lower by early
exit fee).
// these two new
options can be set on per-symbol basis
// how many bars (trading days)
// an early exit (redemption) fee is applied
SetOption("EarlyExitBars", 128 );
// early redemption fee (in percent)
SetOption("EarlyExitFee", 2 );
(note 180 calendar days is 128 or 129 trading days)
// how to set it up on per-symbol basis?
// it is simple - use 'if' statement
if( Name()
== "SYMBOL1" )
{
SetOption("EarlyExitBars", 128 );
SetOption("EarlyExitFee", 2 );
}
if( Name()
== "SYMBOL2" )
{
SetOption("EarlyExitBars", 25 );
SetOption("EarlyExitFee", 1 );
}
- AA: "Scan every" feature has been renamed to "Run every" and
allows automatic repeat of scan or exploration (new feaeture) it allows
also shorter intervals
Run every intervals can now be defined in MINUTES (default) or SECONDS.
To enter run-every interval in seconds simply add "s" or "sec" at
the end of interval value, for example:
10 sec - for run every 10 seconds
5 s - for run every 5 seconds
13 min - for run every 13 minutes
35 m - for run every 35 minutes
7 - for run every 7 minutes (if time unit is not specified then by default
minutes are used)
- OLE: ExportImage() now supports Width and Height parameters
ExportImage function that now allows to specify width and height.
So to export say 640x480 gif image you need to write:
AB = new ActiveXObject("Broker.Application");
Win = AB.ActiveWindow;
Win.ExportImage( "test.gif", 640, 480 );
and you will get perfect image with no jagginess or any scaling artifacts.
And it works independently of your current window size and it does NOT affect
your current window size.
- fix: customColor1 can be selected again using color picker
CHANGES FOR VERSION 4.77.0 (as compared to 4.76.0)
- styleDashed now uses correct background color when it is modified using
SetChartBkColor
- AFL Editor: when there is nothing more to undo/redo beep sound is produced
- AFL: OBV() and AccDist() now work correctly with TimeFrameSet (#26768)
- AFL Editor: Edit->Replace implemented (Ctrl+H shortcut)
- CBT: AddCustomMetric now has new parameter that controls number of decimal
places used to display custom metric
Trade.AddCustomMetric( "Name", value, [optional] decplaces = 2
);
Backtester.AddCustomMetric( "Name", Value, [optional] LongOnlyValue
= Null, [optional] ShortOnlyValue = Null, [optional] decplaces = 2 );
where
decplaces defines how many decimal places are used to display given metric
in the report.If not specified it defaults to 2 decimal places.
Example code:
bo.AddCustomMetric( "Somestat", 100*kr, Null, Null, 4 ); //
5th parameter controls number of decimal places
- Tooltip "value" field now uses Prefs setting (Tools->Preferences->Misc: "Decimal
places in chart titles/tools") + 1 digit decimal points
- All Fibonbacci tools now use user-defined number of decimal places (Tools->Preferences->Misc: "Decimal
places in chart titles/tools").
Note that this setting applies to NEWLY drawn or MODIFIED fibonacci retracements.
Already existing ones won't be affected until you modify/move them.
- Added new submenu under "Symbol": "Real Time Quote" with
3 new options: Add selected symbol / Add watch list / Remove all symbols
IMPORTANT NOTE: to see new menu you need to go to Tools->Customize, select "MENU" bar
and press "RESET" button
- AFL: PlotText("Text", x, y, color, bkcolor = colorDefault )
New AFL function:
PlotText( "text", x, y, color, bkcolor = colorDefault )
Writes text in specified co-ordinates
where
x - is x-coordinate in bars (like in LineArray)
y - is y-coordinate in dollars
color is text color
bkcolor is background color
If bkcolor is NOT specified (or equal to colorDefault) text is written with
TRANSPARENT background
any other value causes solid background with specified background color
Example:
Plot(C,"Price", colorBlack, styleLine );
Plot(MA(C,20),"MA20", colorRed );
Buy=Cross( C, MA(C,20 )
);
Sell= Cross( MA( C, 20 ), C );
dist = 1.5*ATR(10);
for( i = 0;
i < BarCount;
i++ )
{
if( Buy[i]
) PlotText( "Buy\n@" + C[
i ], i, L[
i ]-dist[i], colorGreen );
if( Sell[i]
) PlotText( "Sell\n@" + C[
i ], i, H[
i ]+dist[i], colorRed, colorYellow );
}
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed )
);
- AFL: VarGetText
New function
VarGetText( "varname" )
the same as VarGet but always returns always string values
(if underlying variable has different type it is converted to string)
Allows for example appending to text variable no matter if it is defined
earlier or not:
Title = VarGetText("Title") + "something"; // this will
work correctly regardless of whenever title was defined earlier or not]
- VarSetText
New function
VarSetText( "varname", "value" )
the same as VarSet but operates on string values.
- Auto-analysis backtest result summary modified (added row count and removed
wordwrap)
- Enlarged "Additional commands" field in ASCII Import Wizard
- CBT: Fixed "Out of range" message generated by OLE wrappers
when GetValue method of CBT Metrics object returned infinite value (for
example as result of division by zero)
- Fixed handling of CLICK - DRAW - CLICK drawing mode (#26994) during RT
refresh
- Fixed incorrect candle color occuring sometimes when candle body was
only 1-pixel high
- Fixed potential crash occuring sometimes when RTQ window was never shown
but RT update arrived
- Fixed problem with double arrows appearing on chart with ID == 1
- Fixed problem with selected date in Print/PrintPreview/Image copy
- RTQ context menu "Delete symbol" renamed to "Remove symbol"
- UI: simplification, Removed (default) from File->Database Settings
Base Time interval Combo and "(default)" from local data storage
and removed "IMPORTANT ..." static
CHANGES FOR VERSION 4.76.0 (as compared to 4.75.2)
- Renamed "Number of bars to load" to just "Number of bars"
- Fixed problem with weird Time&sales background colors (bug introduced
in 4.75.x)
- Fixed 1.#INF in P/E colum (RT quote window)
- Editor: fixed actionBacktest / actionExplore mix in auto-complete dropdown
- Chart Y-axis can now be displayed as fractions (1/4, 1/8, 1/16, 1/32,
1/64, 1/128) - to switch this use Parameters -> GRID -> FORMAT
- CBT: Trade object has now "Handle" property that can be passed
to ExitTrade and ScaleTrade methods instead of symbol to allow control
over exiting/scaling multiple positions of the same symbol
// This is sample formula that allows
// to open multiple, separate positions on the
same symbol
// without averaging effect (i.e. each position
on the same
// symbol is completely independent).
//
// Sample code is provided for trading one symbol
// Enter symbol you want to trade below
Symbol = "MSFT";
Buy=Sell=Short=Cover=0; //
real rules are defined inside custom backtest proc
SetCustomBacktestProc(""); //
enable custom backtest
if( Status("action")
== actionPortfolio )
{
// actual backtest routine
// (low-level)
bo = GetBacktesterObject();
SetForeign(
Symbol );
// make sure to calculate actual buy
and buyprice arrays for symbol we need to backtest
Buy = 1; //
For testing purposes just enter new position every bar
BuyPrice = Open;
RestorePriceArrays();
// actual backtest loop
bo.PreProcess();
for(
i = 1; i < BarCount;
i++ )
{
// first update
backtest stats and handle stops
bo.UpdateStats( i, 0 );
bo.HandleStops( i );
bo.RawTextOutput("Bar " +
i );
if( Buy[
i - 1 ] ) //
if buy signal in previous bar
{
bo.EnterTrade( i, Symbol, True, BuyPrice[
i ], 500 /*
$5000 into one trade */);
}
for(
OpenPos = bo.GetFirstOpenPos(); OpenPos; OpenPos = bo.GetNextOpenPos() )
{
//
exit positions if their age is > 5 bars and they are profitable
if(
OpenPos.BarsInTrade > 5 AND OpenPos.GetProfit() > 0 )
{
//
HERE IS A NEW PART !!!
//
WE ARE PASSING HANDLE instead of ticker symbol
//
THIS ENSURES PROPER OPERATION even if we have multiple positions of the same
//
stock
bo.ExitTrade(
i, OpenPos.Handle, OpenPos.GetPrice( i, "O" )
);
}
}
bo.RawTextOutput("Number
of open positions: " + bo.GetOpenPosQty() );
bo.UpdateStats( i, 2 );
}
bo.PostProcess();
}
- CBT: Small fix for low-level CBT backtest - internal current bar counter
is set now via UpdateStats
- ASCII import wizard: Additional commands field accepts "ENTER" key
alone (previously one needed CTRL+ENTER to create new line)
- ASCII importer limits the volume to 2147483647 so after convertion to
32bit integer it never becomes negative
- Added parameter list to backtest report (Settings page)
CHANGES FOR VERSION 4.75.2 (as compared to 4.75.1)
- when no data we available chart background is correct now (it was black
instead of one choosen in prefs in 4.75.x)
- Added ability to disable fixed ruin stop
When you add
SetOption("DisableRuinStop", True);
to your formula the backtester will not use built in 99.96% loss stop (ruin)
Note: it is recommended NOT to use it unless you really have to.
- added new option to SetOption:
SetOption("EveryBarNullCheck", True)
SetOption("EveryBarNullCheck", True)- allows to turn on checking
for Nulls in arithmetic operations on every bar in the array(by default it
is OFF - i.e. AmiBroker checks for nulls that appear in the beginning of
the arrayand in the end of the array and once non-null value is detected
it assumes no further holes (nulls) in the middle). Turning "EveryBarNullCheck" to
True allows to extend these checks to each and every barwhich is the way
4.74.x and earlier versions worked.
Note however that turning it on gives huge performance penalty (arithmetic
operations are performed even 4x slower when this option is ON, so don't
use it unless you really have to).
- Added small result summary after backtest in the status line
- Fixed problem with plotting xshifted charts occuring when formula referenced
future bars
- logical (boolean) operators check for nulls on every bar and treat null
as "false" to maintain backward compatibility with formulas written
for previous versions
- Modified file dialog buffer size from 262144 (0x40000) bytes to 262143
(0x3FFFF) to workaround 16 bit (64KB) buffer limit of Windows 95/98/NT4
(yes surprisingly NT4 is limited to 64K buffer in file dialogs)
16-bit windows (95/98) and NT4 were treating 0x40000 as 0 (zero) because
only lower 16 bits were interpreted. Thanks to move to 0x3FFFF it is now
interpreted as 0xFFFF on 16 bit windows.
- Potential crash fixed when formula using AddToComposite atcEnableInBacktest
is verified in the AFL editor
- Added XShift parameter to PlotOHLC and PlotForeign functions
- fixed re-mapping of built-in and custom colors in grid color picker
CHANGES FOR VERSION 4.75.1 (as compared to 4.75.0)
- ParamColor now accepts 24 bit colors without crashing
- Null values appearing at the end of data series (array) are handled
appropriately (propagate through arithmetic operators)
This fixes problem that 4.75.0 had with "trendline" formulas that
used Null values put into the array at the end of the data series.
- Most recently picked drawing tool color is preserved between runs
- EncodeColor was not handling all 24 bit color combinations correctly.
Fixed now.
- Chart tree fix: Moving or renaming formula in charts tree now updates
all paths in indicators that use this formula
CHANGES FOR VERSION 4.75.0 (as compared to 4.74.6)
- New chart style (styleCloud) to be used to create "cloud" chart
as in Ichimoku charts. Also useful for indicator charts like MACD.
This style fills non-rectangular (free shaped) area between HIGH and LOW
arrays provided
by PlotOHLC function. Open and Close arrays are not relevant for plotting
however Close
is used as usual to display value label and title. So recommended use is
to use "upper" bounding value
in Open and High arrays and "lower" bounding value in "Low" and "Close" arrays
Sample Ichimoku cloud:
SL = ( HHV( H, 26 )
+ LLV( L, 26)
)/2;
TL = ( HHV( H, 9 )
+ LLV( L, 9 )
)/2;
DL = Ref( C, 25 );
Span1 = Ref( ( SL
+ TL )/2, -25 );
Span2 = Ref( (HHV( H, 52)
+ LLV(L, 52))/2,
-25);
Plot( C, "Price", colorBlack, styleCandle );
Plot( SL, "SL", colorRed, styleThick );
Plot( TL, "TL", colorGreen, styleThick );
PlotOHLC( 0,
span1, span2, span2, "Cloud", colorLightOrange, styleCloud );
Simple MACD cloud:
m = MACD();
Plot( Signal(), "Signal", colorBlue, styleThick );
PlotOHLC( m,m,0,m, "MACD", IIf(
m > 0, colorGreen, colorRed ), styleCloud );
Another MACD cloud (difference):
m = MACD();
s = Signal();
Plot( s, "Signal", colorBlue);
Plot( m, "MACD", colorRed );
PlotOHLC( m,m,s,m, "MACD", IIf(
m > s, colorLime, colorLightOrange), styleCloud );
- when File->Open database or MRU list is choosen then old database is
saved first
- When default database is deleted, AB now asks for new default database
folder, instead of re-creating it
- when database is deleted from the outside and user picks it via MRU list
-then gets removed from MRU list and is not recreated anymore
- When AmiBroker is launched with incorrect "Start in" (working directory)
then it automatically switches to "last good" path
"
Last good" path is saved in the registry HKEY_CURRENT_USER\TJP\Broker\Defaults\LastGoodPath,
during successful launch in correct directory (whenever working directory
is correct or not it is determined by checking for presence of Broker.chm
file (help file))
Using correct working directory is important because AmiBroker uses relative
paths to most components.
- AFL: new function: StaticVarRemove()
StaticVarRemove("varname")
removes static variable and releases associated memory
- Start-up time decreased significantly by implementation of on-demand
loading of formulas
(on slow, low-end machines loading time decreases from 10 seconds to just
0.5 second)
- printf/StrFormat/SelectedValue functions no longer affect number of extra
future bars calculated by QuickAFL
- Minor plugin status change (as in IB backfill) does not cause sound (only
tooltip is displayed)
- Increased the limit of files that can be selected using Windows file
dialog
Now import wizard and ascii importer file dialogs use 256KB buffer for file
names that on average should allow 20000 files to be selected at once.
- Further speed improvements by rewriting chart ID lookup routine (GetChartInfoByID)
- Chart title string is clipped so Y axis is never obscured
- Chart title can be automatically wrapped now
Use 'Parameters' window,
" Axes & Grid" tab,
Miscellaneous->Wrap title: YES
If you want to set it programmatically from the formula use
SetChartOptions( 2, chartWrapTitle );
- Auto-hide panes slide slightly faster
- All basic array arithmetic and logical operators inlined and hand optimized
on assembly level for speed, gives upto 450% speed increase in basic array
calculations
Example speed increases:
a) purely "theoretical" example
million iterations of array addition
for(
i = 0; i < 1000;
i++ )
for(
k = 0; k < 1000;
k++ )
Sumh = H + L;
runs 4.8 times (+480%) faster (5 seconds in 4.75 compared to 24 seconds in
4.74 and older, Athlon64@2GHz)
2000 data bars.
This gives ( 2000 * 1000000 additions ) / 5 sec = 400 MEGAFLOPS (millions
of floating point operations per second) AFL array-based AFL execution speed.
b) "real-world" examples:
" Projection Oscillator"
http://www.amibroker.com/library/detail.php?id=344
single security optimization runs 85% faster
(13 seconds (4.75) compared to 24 seconds (4.74 or older) )
" RSIS"
http://www.amibroker.com/library/detail.php?id=153
single-security optimization 5000 iterations runs 21% faster
(28 seconds (4.75) compared to 34 seconds (4.74 or older))
NOTE: Performance increase depends on complexity of the formula. Biggest
gains can be observed for formula doing LOTS of mathematical calculations
on arrays (using lots of +, -, *, /, ^, %, comparisions <, >, ==, !=, <=, >=,
etc).
- AFL: new function: SetChartBkColor( color )
sets chart background to user-specified color
- Added View->Time & Sales menu back
- Added chart timing display (you can turn it on via Tools->Preferences->Display
chart timing)
when turned on, in the bottom of each chart the following information is
displayed:
Total time X sec, AFL exec time Y sec (Z %), # extra bars back Q, fwd R
where
X - is total time in second spent during chart refresh ( this includes AFL
execution and actual screen painting/drawing, grid / scale calculations,
etc)
Y - is time spent in chart AFL execution only (without any actual screen
painting, grid / scale calcs)
Z - is percentage of time that AFL execution takes compared to total time
required for refresh
Q - is a number of previous bars (before first visible bar) that are needed
to calculate the indicator (QuickAFL estimation)
R - is the number of future bars (after last visible bar) that are needed
to calculate the indicator (QuickAFL estimation)
- Added asin/acos to the AFL function reference
- AFL: 24-bit (16 million) truecolor support for indicators and exploration
output.
- new ColorRGB() and ColorHSB functions to access full 24 bit palette
ColorRGB( red, green, blue )
returns color value to be used in Plot/PlotOHLC/AddColumn/AddTextColumn
red, green, blue - represent color component values in range 0..255 each
For more information about RGB color model please read:
http://en.wikipedia.org/wiki/RGB_color_model
ColorHSB( hue, saturation, brightness )
returns color value to be used in Plot/PlotOHLC/AddColumn/AddTextColumn
hue - represents gradation of color within the optical spectrum (as in rainbow)
saturation represents "vibrancy" of the color
brightness represents brightness.
Each parameter ranges from 0 to 255, where 0 represents 0% saturation/brightness
or 0 degree hue in HSV color wheel,
and 255 represents 100% saturation/brightness or 360degrees hue in HSV color
wheel
When you modify hue from 0 to 255 you will see consecutive
rainbow colors starting from red, through yellow and green to blue and violet.
For more information about HSB color space please read:
http://en.wikipedia.org/wiki/HSB_color_space
Example MA rainbow chart (bring up parameters dialog and play with it):
side = 1;
increment = Param("Increment",2, 1, 10, 1 );
for( i = 10;
i < 80; i = i +
increment )
{
up = MA( C,
i );
down = MA( C,
i + increment );
if( ParamToggle("3D
effect?", "No|Yes" )
)
side = IIf(up<=down AND Ref(
up<=down, 1 ), 1, 0.6 );
PlotOHLC(
up,up,down,down, "MA"+i, ColorHSB( 3*(i
- 10),
Param("Saturation", 128, 0, 255 ),
side * Param("Brightness", 255, 0, 255 )
), styleCloud | styleNoLabel );
}
///////
Color-parade exploration
Filter=1;
for( i = 0;
i < 256; i = i + 16 )
AddColumn( C, "C", 1.2, colorDefault, ColorHSB(
( BarIndex() +
i ) % 256, 255-i, 255 )
);
CHANGES FOR VERSION 4.74.6 (as compared to 4.74.5)
- Fixed problem with RTQuote failing to load symbol list during first
show
- Fixed problem in AA-Apply To-Date that was introduced because of tab
order change
CHANGES FOR VERSION 4.74.5 (as compared to 4.74.4)
- Toolbar theme was reset when entering Formula Editor, now it is fixed
- Quote Editor list now remembers columns size and order between runs
- Keyboard shortcut editor now allows using punctation characters like
Ctrl+[, Ctrl+], - =, etc
- Automatic Analysis: Pick button now has shortcut on Alt+I to avoid conflict
with Alt+P (Parameters), also fixed tab order
- Fixed ParamDate to return DateNum instead of YYYYMMDD (4 digit year)
CHANGES FOR VERSION 4.74.4 (as compared to 4.74.3)
- New "Appearance" tab in Tools->Customize, allowing to select
menu/toolbar/docking pane themes and tab location
- Layout and Symbol trees are marked for refresh when database is changed
and refreshed when user brings them up
- Fixed exception that occurred after customization when ticker bar was
removed from all toolbars
- Fixed ticker bar losing focus when Shift/Insert/CapsLock/NumLock pressed
- Real-time Quote column order/size is remembered correctly again
CHANGES FOR VERSION 4.74.3 (as compared to 4.74.2)
- Fixed losing focus by ticker combobox when Shift, CapsLock, NumLock,
Insert keys were pressed
CHANGES FOR VERSION 4.74.2 (as compared to 4.74.1)
- Ticker combo is now correctly refreshed on database change even if moved
to other toolbar than default
- Previously when Reset was used on Ticker toolbar it became blank - now
it is fixed, ticker combo is refilled after closing customization mode
- Edit field in Ticker combobox does not scroll horizontally now when
edited text is too long
- Numeric keypad keys now work with File MRU menu (most recently used files)
- Global shortcuts continue to work when focus is inside ticker combo
- "Profile" button in View toolbar works correctly now
CHANGES FOR VERSION 4.74.1 (as compared to 4.74.0)
- Fixed incorrect message displayed in the progress window during some
longer explorations
CHANGES FOR VERSION 4.74.0 (as compared to 4.73.0)
- New user interface: fully user-customizable advanced docking panes/toolbars/menus.
New UI features:
- Tear-Off Tabs
- Nested docking pane grouping
- WYSIWYG docking
- sliding auto-hide pinnable windows
- modern "Whidbey" look
- Tear-Off menus and toolbars
- Add/copy/Delete/Modify/drag-drop commands
- User-defined toolbars
For a little video presentation see: http://www.amibroker.com/video/uicustomize.htmlNote:
toolbar and keyboard customizations made in old versions need to be re-done
because they can not be imported by new system due to fundamental differences
(I am sorry about that)]
- GroupID(), IndustryID(), SectorID, MarketID(), InWatchList(), IsIndex()
and IsContinuous() functions are now affected by SetForeign
- Removed debug messages cluttering DebugView output (that appeared in
4.73)
- Changed the way drawing color picker is working: now it works like in
Word (or other text editor) - keeps selected color even if drawing with
different color is clicke
- Fixed false message "The note has been modified outside the notepad
editor." occuring when file did not exist
- OLE: Changed Window.LoadTemplate to return FALSE when file can not be
found
- OLE: Window.LoadTemplate now refreshes display so it is not necessary
to use SelectedTab = 0
- Removed constant RT refreshes in interpretation window when text does
not change
- ZoomToRange: last selected bar in range is visible after zooming now
CHANGES FOR VERSION 4.73.0 (as compared to 4.72.1)
- OLE: Window object, new method ZoomToRange( From, To )
ZoomToRange( From, To )
From and To parameters are of any type that can be converted to date(you
can use string or OLE date for example).
Example code (JScript):
AB=new ActiveXObject("Broker.Application");
AW = AB.ActiveWindow;
if( AW.ZoomToRange( "2005-04-01", "2005-08-01" ) )
{
WScript.Echo("Zoom successfull" );
}
- Fixed: Chart got shrinked a bit with each overlaid plot, now the Y scale
does not change (unless really needed)
- Fixed: XShift now works correctly with styleOwnScale and styleLeftScale
- Fixed: Volume chart overlaid on price chart in log scale (overlay) was
compressed to flat line, now it is fixed (volume chart overlay uses linear
scale always)
[#22262]
- AFL: Added AlmostEqual function (completed: 2005-09-16)
AlmostEqual( x, y, ulps = 5 )
this is a helper function for comparing floating point numbers.It returns
True if x and y are equal or almost equal upto defined accurracy (ulps).It
is recommended to use this function instead of equality check (==) as itleads
to more reliable comparisons and less headache caused by IEEE floating pointacurracy
issues.
Parameters:x, y - the numbers or arrays to be compared,Ulps stands for "units
in last place" and represents maximum relative error of the comparison.
Since 32 bit IEEE floating point numbers have accurracy of 7 significant
digits, 1 unit in last place(ulp) represents relative error of 0.00001 %.
The default value of ulps parameter is 5 which gives roughtly 0.00005% "comparison
sensitivity".
Example code:
if( 1/3 == 0.3333333 )
{
printf("32-bit Floating point IEEE exact equality\n");
}
if( AlmostEqual( 1/3, 0.3333333 ) )
{
printf("Numbers are almost equal\n");
}
Thanks to Bruce Dawson for his fast routine.
- Optimize() function now checks if min < max, step > 0 and checks
if parameter name is not empty
- Made Time&Sales case insensitive (when "case sensitive tickers" option
is turned off")
- OBV/AccDist/Chaikin functions adjusted to be SetForeign-aware
- OLE: Application object new methods
BOOL LoadLayout( filename )
BOOL SaveLayout( filename )
AB = new ActiveXObject("Broker.Application");
AB.LoadLayout("C:\\Program Files\\AmiBroker\\Data\\Layouts\\Default.awl");
- OLE: Window object new property: SelectedTab
AB = new ActiveXObject("Broker.Application");
AW = AB.ActiveWindow;
tabindex = AW.SelectedTab; // read selected tab
AW.SelectedTab = 3; //switch to tab 3
AW.SelectedTab = tabindex; // restore originally selected tab
- Fixed: Exception was generated when GetRTDataForeign was called with
non-existing ticker
- OLE: Window object new methods: LoadTemplate, SaveTemplate
AB = new ActiveXObject("Broker.Application");
AW = AB.ActiveWindow;
AW.SaveTemplate("Test.abt");
AW.LoadTemplate("Test.abt");
CHANGES FOR VERSION 4.72.1 (as compared to 4.72.0)
- fixed out-of-memory problem sometimes occuring during scan of large (>512MB)
databases
CHANGES FOR VERSION 4.72.0 (as compared to 4.71.1)
- " Currency" field support in ASCII importer
added command:
$CURRENCY USD
and field:
$FORMAT Name,Currency$OVERWRITE 1$AUTOADD 1]
- Added "Additional commands" field in the Import wizard for
typing any extra $- commands that are not available via checkboxes
- Added parameter to AddColumn/AddTextColumn to control column width
AddColumn( ARRAY, "Caption", format = 1.2, color = colorDefault,
bgcolor = colorDefault, width = -1);
AddTextColumn( "Text", "Caption", format = 1.2, color
= colorDefault, bgcolor = colorDefault, width = -1 );
- AddToComposte new flag to work when Status("action")== actionPortfolio
(completed: 2005-09-09)
new flag is called atcEnableInPortfolio
Example:
if( Status("action" ) == actionPortfolio )
{
... Custom backtest mode here ....
AddToComposite( some_array, "~COMPOSITE", "X", atcFlagEnableInPortfolio
| atcFlagDefaults );
}
- AFL added: tanh(), sinh(), cosh() functions
Hyperbolic tangent, sine and cosine function
- AFL functions: StrToUpper and StrToLower
- Fixed: Tick ASCII import: last tick of previous import was deleted on
subsequent import, now it is corrected
- Function to detect mouse button state
GetCursorMouseButtons() returns mouse button state at the time when chart
formula is executed
0 - if no mouse button is pressed
1 - if left mouse button is pressed
2 - if right mouse button is pressed
4 - if middle mouse button is pressed
plus combinations:3 - left + right5 - left + middle6 - right + middle 7 -
left + right + middle]
- GetRTDataForeign (retrieving values for other symbols)
GetRTDataForeign( "field", "symbol")
- Pane is not deleted if shrinked down to zero (prevents from accidential
deletion of panes)
- Plot function now has xshift parameter that allows to visually shift
the chart past the last bar
Example 20-bar Moving average shifted 10 bars into the future past the last
bar:
Plot(Close,"Close",colorBlack,styleCandle);Plot(MA(Close,20), "Shifted
MA", colorRed, styleLine, Null, Null, 10 );
Note that shift occurs during plotting and does not affect source array
- Removed data source selection from preferences because it caused user
confusion way too often
- Stock.Currency available via OLE
- Title variable now supports new special token {{OHLCX}} which is replaced
at runtime by string "Open ..., Hi .... Lo ... Close (...%)" showing
current price
This way it is possible to implement formula that will show OHLC prices with
number of decimal places set in the preferences.
Example:
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}} {{OHLCX}} {{VALUES}}" );
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle
| ParamStyle("Style") | GetPriceStyle() );
- user-definable number of decimal places in chart titles (completed:
2005-09-09)
Number of decimal places displayed in default chart title is now user-definable
inTools->Preferences->Miscellaneous"Decimal places in chart titles".
Allowable values:
-1 - dynamic mode (number of decimal places automatically adjusted)
0..6 - fixed number of decimal places
- QuoteArray resizing now uses heuristic algorithm to minimize memory
fragmentation and increase performance
- atcFlagDeleteValues now highlighted properly in the AFL editor
CHANGES FOR VERSION 4.71.1 (as compared to 4.71.0)
- fixed compatibility problem with AmiQuote (due to changed order of OLE
properties/method while AmiQuote was using old ones)
- now ASCII importer in $TICKMODE does not delete quotes older than oldest
(first) record in the imported file, so you can safely import tick data
from subsequent files (older first, newest later)
CHANGES FOR VERSION 4.71.0 (as compared to 4.70.5)
- AFL: added GetCursorXPosition() and GetCursorYPosition() functions
Functions return current mouse cursor position.
Values returned are equal to those visible in the status bar, and these functions
require status bar to be visible. Returned values represent cursor position
at the formula execution time (or few milliseconds before it) and accurracy
is subject to pixel resolution of the screen (first cursor position is read
in screen pixels (integer) and then converted to actual value therefore for
example when screen resolution is 1024x768 maximum obtainable resolution
in X direction is 0.1% and in Y direction 0.13%), also X values are snap
to datetime of nearest data bar.
It only makes sense to use these functions in indicator/interpretation code.
Using them in AA window may yield random values.GetCursorXPosition() function
returns X position in DateTime format (the same as used by DateTime() function).You
can convert it to string using DateTimeToStr() function.GetCursorYPosition()
returns Y position (as displayed in Y axis of the chart).
Example:
ToolTip="X="+DateTimeToStr(GetCursorXPosition()) +"\nY="+GetCursorYPosition();
-
AFL: added DateTimeToStr() and StrToDateTime() functions
These functions allow to convert string to datetime format and vice versa.
Example:
ToolTip="X="+DateTimeToStr(GetCursorXPosition()) +"\nY="+GetCursorYPosition();]
-
Added ability to store charts as .GIF (in addition to PNG)
-
ASCII importer maximum supported line length is increased to 2048 characters
-
Fixed: .aflsafe files didn't get deleted automatically
- Added N-volume bars charts and timeframe support.
Custom N-volume bar intervals are definable (as usual) in Tools->Preferences->Intraday.
TimeFrame functions were also extended to support N-volume bars using new
TimeFrameMode() function calling
TimeFrameMode( 0 );
- switches time frame functions to time-based operation (the default)
TimeFrameMode( 1 );
- switches time frame functions to N-tick operation (positive values passed
to TimeFrameSet are treated now as N-tick)
TimeFrameMode( 2 );
- switches time frame functions to N-volume bar operation (positive values
passed to TimeFrameSet are treated nowas N-volme bars)
Example:
TimeFrameMode( 2 );
TimeFrameSet( 50000 ); // 50'000 share bars..
...do something ...
TimeFrameRestore();
Note: N-volume bars are somewhat weird (compression of data to N-volume
bar may actually deliver MORE output bars - for example if one tick is
1000 shares and you have specified 100V bars then single tick will be
expanded to TEN 100V bars - ten times original size)
TimeFrame functions are protected against array overrun and will not decompress
beyond original array size (you will get an "Error 47. N-volume bar
compressed data longer than base time frame").
Also switching main time frame to some weird N-volume bar value will result
in limiting the output to maximum twice original data size(without error
message).
You should keep that in mind and avoid using too small N-volume bar intervals
that could lead to such condition.
Also due to the nature of N-volume bars the only TimeFrameSet() function
will yield correct N-volume bar values, TimeFrameGetPrice() may give slightly
distorted results.
It is also possible to use n-volume bars in TimeFrame functions without
calling TimeFrameMode() - it is then necessary to specify n-volume bars
as negative number offset by -1000000 (minus one million):
TimeFrameSet( -1000000 - 2000 );
// gives 2000V barsSimilarly formatted negative numbers will be reported
by Interval() function when n-volume bars are selected.
-
OLE: Save As PNG / GIF callable from automation
Example script:
AB = new ActiveXObject("Broker.Application");
AB.ActiveWindow.ExportImage("Test.png");
-
Plugin is not called when GetExtraData is used for symbol that has "use
only local database" flag turned on, and NULL is returned instead
of an error
-
Protected against changing application's current working directory
by printing to file
-
Toolbar does not get wrapped when main frame window is resized
-
OLE: Analysis object has new method MoveWindow( x, y, width, height)
that allows to control position and size of automatic analysis window
AB = new ActiveXObject("Broker.Application");
AB.Analysis.MoveWindow( 10, 10, 200, 200 );
It has some restrictions on size: specified size can not besmaller than
10x10 pixels and can not be bigger than entire screen dimensions.
Also when "No minimum size for resizing dialogs" box in UNCHECKED
in Tools->Prefs->Misc it won't shink AA window below default size
necessary to fully display all controls.
-
ASCII importer: added ability to import tick data from text files
ASCII importer now allows tick data files to be imported.
Tick data files consist of several records having the same timestamp.This
makes it impossible to use normal import mode which assumes different
(unique) timestampsfor each data row (when same timestamp is found then
new data overwrites old).
To turn on TICK mode you need to add manually
$TICKMODE 1
line to ASCII importer definition file.
$TICKMODE is a special mode of importer that allows to import quotes that
haveduplicate time stamps.
It makes two assumptions:
a) input data should come in the ascending time order (i.e. OLDER records
first, LATEST records last)
b) input data should consist of entire tick history because importer will
DELETE any existing quotes (to avoid creating multiple copies of the same
ticks).
Once again: Turning on
$TICKMODE 1
will DELETE ANY QUOTES that already exist in the database and then will
import all ticks from input data file.
You have been warned.
For example data files like this:
MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,2MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,11MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,40
Can be imported using the following definition file:
$FORMAT Ticker, Skip, Date_YMD, Time, Open, High, Low, Close, Volume
$SKIPLINES 1
$SEPARATOR ,
$CONT 1
$GROUP 255
$AUTOADD 1
$DEBUG 1
$TICKMODE 1
Sometimes it happens that input files have invalid timestamps (seconds > 59).
For example:
MOL,0,20050606,162970,16400.0000,16400.0000,16400.0000,16400.0000,2
Please take a closer look at first line shown in this example it has time:16:29:70
(you see 70 seconds !)
So I had to add a special flag to the importer that works around such
data errors.
It is called $ALLOW99SECONDS 1 and will convert all records with invalid
seconds (i.e greater than 59)to 59s.
So record stamped 16:29:70 will be treated as 16:29:59
Now for tick mode to work with such incorrect records you would need
to add two lines to ASCII importer definition:
$TICKMODE 1
$ALLOW99SECONDS 1
CHANGES FOR VERSION 4.70.5 (as compared to 4.70.4)
-
Fixed problem with Indicator Maintenance wizard not
reading certain layouts correctly, thus deleting indicators that were
in fact in use (allocated to: 4.70.5) (completed: 2005-05-08)
-
Custom backtester: EnterTrade method uses RoundLotSize
parameter from the AA settings if none is specified in function call
and RoundLotSize field in Symbol->Information is set to zero (allocated
to: 4.70.5) (completed: 2005-05-04)
-
StaticVarSet - increased resolution to maximum supported
by 32-bit IEEE (allocated to: 4.70.5) (completed: 2005-05-08)
-
When trade size limit expressed as % of bar volume shrinks
down the trade below "MinPosValue" then such trade is not
entered (allocated to: 4.70.5) (completed: 2005-05-04)
CHANGES FOR VERSION 4.70.4 (as compared to 4.70.3)
-
Closing editor window while AA operation is running
does not result in crash if formula generates error (allocated to:
4.70.4) (completed: 2005-05-01)
-
When margin requirement was set to 100 (no margin) then
very small artifacts (0.0000000000001) were displayed as margin loan, this
is now corrected (allocated to: 4.70.4) (completed: 2005-05-01)
-
Added message "Formula execution halted because
of an error - no chart to display" instead of "black pane" (allocated
to: 4.70.4) (completed: 2005-04-30)
-
AFL Editor: Fixed problem with errorneous horizontal
scrolling when editing lines longer than 256 characters (allocated to: 4.70.4)
(completed: 2005-04-19)
-
Default layout is saved automatically when Tools->Indicator
Wizard menu is selected (allocated to: 4.70.4) (completed: 2005-04-30)
-
Fixed styleThick and styleLine small 'dash' artifact
(allocated to: 4.70.4) (completed: 2005-04-30)
-
Setup: Mixed mode EOD/Intraday is selected in demo eSignal
database (allocated to: 4.70.4) (completed: 2005-04-30)
-
Time-compressed N-minute bars are no longer reset on
USA EST 00:00:00 when align to session times is turned on (allocated to:
4.70.4) (completed: 2005-04-21)
-
Time-compression of bars: open interest is now correctly
using "last" value (allocated to: 4.70.4) (completed:
2005-04-15)
-
Tools->Indicator Wizard keeps old built-in indicator slots untouched
CHANGES FOR VERSION 4.70.3 (as compared to 4.70.1)
-
Added "TIME" control to Text study properties (allocated to:
4.70.3) (completed: 2005-03-24)
-
Assigning hyper-long strings to Title variable does not cause program
termination anymore (allocated to: 4.70.3) (completed: 2005-03-18)
- Modified daily time compression and weekend filtering when daily bars
are set to use day/night session start/end times (allocated to: 4.70.3)
(completed: 2005-03-24)
[Now it works so that if day/night session is enabled then weekend begins with
the start of Friday night session and ends with the beginning of Sunday night
session]
- "Filter weekends" option added to View->Intraday menu,
so now it is not necessary to go to File->Database Settings->Intraday
settings to change it (allocated to: 4.70.3) (completed: 2005-03-24)
- "Override weekly/monthly bars use date of last trade" Preferences
setting was affecting daily charts too. Now it is fixed (only weekly
and monhtly charts are affected) (allocated to: 4.70.3) (completed:
2005-03-24)
- Exception when using a left open Param window after the indicator has
been closed (allocated to: 4.70.3) (status: fixed) (completed: 2005-03-21)
[now if Param window is closed if corresponding indicator pane is closed]
- Fixed crash occuring sometimes when #included file was missing (allocated
to: 4.70.3) (completed: 2005-03-21)
- Fixed crash occuring when run-time or syntax error occurred in the #included
file that was longer than 16000 characters (allocated to: 4.70.3) (completed:
2005-03-24)
- Fixed GetCommission() method in Trade object not to ignore bInclExit
parameter (allocated to: 4.70.3) (completed: 2005-03-24)
- Control over tooltip text from AFL formula level (allocated to: 4.70.3)
(completed: 2005-03-24)
[available now via new reserved variable called TooltipTooltip = "My Tooltip
text shows Close " + Close;note that X/Y coords are displayed in the
tooltip anyway and that custom tooltip text length is limited to 1000 characters.]
- GetPositionValue() method of Trade object returned entry value instead
of current value. Now it is fixed (i.e. CURRENT value is returned) (allocated
to: 4.70.3) (completed: 2005-03-24)
- Implemented "Min. pos value" in addition to "Min. shares" (allocated
to: 4.70.3) (completed: 2005-03-24)
[This sets global minimum on position (trade) size. Backtester will
not open trades below this limit. Default value is zero (no minimum
trade size).The
setting is available via: AA, Settings: Min. Pos. Value field, and via SetOption("MinPosValue",
... )]
- Updated "READ ME" and some minor corrections in the User's
Guide (allocated to: 4.70.3) (completed: 2005-03-24)
- "Max. trade drawdown" for short trades was incorrect, now
fixed (allocated to: 4.70.3) (completed: 2005-03-24)
CHANGES FOR VERSION 4.70.1 (as compared to 4.70.0)
-
Updated old parts of the User's Guide to present current status-quo.
-
First
trade exit price was sometime reported as -1#QNAN, this should be fixed
now (allocated
to:
4.70.1)
(completed:
2005-03-16)
-
"Delete indicator" in CONTEXT (chart) menu (allocated to:
4.70.1) (completed: 2005-03-10)
-
Add ownStyle scaling factor so it is not necessary to use Highest(V) in
volume chart (allocated to: 4.70.1) (completed: 2005-03-15)
-
Added Help->AFL functions by name, Help->AFL functions by category,
Help->AFL reference menu items to AFL editor (allocated to: 4.70.1)
(completed: 2005-03-15)
-
added maskAll, maskDefault, maskPrice maskHistogram, chartShowDates, chartLogarithmic,
chartShowArrows constants to syntax-colorizer def (allocated to: 4.70.1)
(completed: 2005-03-12)
-
Adjusted formatting of param window min/max values so it does not use engineering
notation (xEy) for numbers smaller than 1e8 (100 million) (allocated to:
4.70.1) (completed: 2005-03-12)
-
BUG: Applying preferences resets price style to candlesticks even if
something different is selected in View->Price chart style (allocated
to: 4.70.1) (status: fixed) (completed: 2005-03-15)
-
BUG: Choosing File->Print and then pressing "CANCEL" button
blocked further RT refreshes, now fixed. Also now page count is set to 1
(avoid "Next page") (allocated to: 4.70.1) (status: fixed)
(completed: 2005-03-15)
-
BUG: GetPriceStyle() included styleDots even if currently selected style
was candlestick or bar (allocated to: 4.70.1) (status: fixed) (completed:
2005-03-15)
-
BUG: RT Quote, Context menu -> HIDE - does not shrink the panel
(allocated to: 4.70.1) (status: fixed) (completed: 2005-03-15)
-
Change default include directory to "Formulas\Include" (allocated
to: 4.70.1) (completed: 2005-03-15)
-
Display chart ID in Axes/Grid: Misc: part of parameters dialog and adjust
description of Study() (allocated to: 4.70.1) (completed: 2005-03-12)
-
Make IDR_BROKERTYPE and IDR_MAINFRAME menus the same (allocated to: 4.70.1)
(completed: 2005-03-15)
-
Modify registration checking to allow only licenses 4.20 and above (allocated
to: 4.70.1) (completed: 2005-03-15)
-
New version of IB plugin: 1.3.6 - max. number of streaming symbols increased
to 100 (allocated to: 4.70.1) (completed: 2005-03-02)
-
Pressing 'X' button in the main frame during Print preview closes print
preview only instead of exiting application (allocated to: 4.70.1) (completed:
2005-03-15)
-
Quotes for symbols beginning with non-US characters are not saved (should "land" in
'_' folder but they don't) (allocated to: 4.70.1) (completed: 2005-03-12)
-
Replaced IQFeed plugin with smaller (release) version (allocated to: 4.70.1)
(completed: 2005-03-12)
-
Symbol->Categories, "This group uses own intraday settings" checkbox
and button are now repositioned correctly when dialog is resized (allocated
to: 4.70.1) (completed: 2005-03-12)
CHANGES FOR VERSION 4.70.0 (as compared to 4.69.8)
- Rewriten all price formulas to use GetPriceStyle()
- _DEFAULT_NAME() uses indicator title if there is no _SECTION defined
- Changed default background color for the charts
- Removed obsolete color pickers from preferences
- when styleOwnScale is selected and min scale value is <= 0 then logarithmic
scaling is turned off for this particular plot
- data plugin interface adjusted back to allow NULL RecentInfo pointer even
if ticker is not null
- Removed all obsolete specialized drawing routines for old built-in charts
- Syntax highlighting: default text and number color changed from pink to
violet (easier for the eyes)
- Hiding chart pane causes auto-arrange (if selected in preferences)
- Chart panes with date axis displayed take more space than panes without
axis if auto-arrange selected
- fixed problem with handling scripting parts written in language that is
new-line sensitive (VBScript)
- Changed "cyclic" colors in ParamColor
- fixed display of negative parameter values in Param dialog
- Fixed "scale shrinking" effect when no plot is drawn
- ParserCleanup is called when exception occurs inside interpretation
- if no GraphXSpace variable is defined then default 2% extra space is added
- support for TWS API 8.30 - add primaryExchange=Exchange = "SMART" (or "BEST")
CHANGES FOR VERSION 4.69.8 (as compared to 4.69.0)
- Added copying error message in AFL editor (Edit->Copy Error Message)
- New column in AA Trade List report: Scale In/Out - showing the number
of scale-in and scale-out operations within given trade
- Added protection against re-opening the same formula in multiple editor
windows via "Edit Formula"
- Price chart style switchable from the menu
- new AFL function:
GetPriceStyle() returns price chart style value
to be used in Plot statement
Returned value depends on selection in View->Price chart style menu
- added View->Price chart style->Line with dots
- IB plugin auto-refresh configurable via File->Database Settings->Configure, "Force
instant quote retrieval for all symbols"
- Fold/unfold directory in Chart tree causes inserting chart (fix double
click handler)
- Fixed 1-tick interval handling when mixed eod/intraday data was enabled
- Fix toolbar display problem when manually sizing down the editor window
to zero, closing and re-opening the editor
- Bar requirements were not recalculated after modifying formula since
introduction of drag-drop. Fixed now.
- Added: You are about to save the file that is located in hidden drag-drop
folder, do you want to move it to Custom folder so it is visible in the
chart tree?" message
- Plot() function protected against specifying negative color
- Indicator exception handler calls now CleanupParser when exception occurred
outside parser but still somewhere inside drawing routine so other indicators
continue to work even if fatal exception occurred during drawing
- added #include_once preprocessor command
- When a formula was drag-and-dropped from the Chart tree on to the AA
window, the formula loaded, but all the parameters were not reset from
the previous formula. Fixed now.
-
- ApplyStop changes: Fixed problem with trailing stop and exitatstop=2
in regular mode. Also better consistency of trailing stops between "Allow
same day stop" mode set to true and false
- action* constants now highlighted by AFL editor
- additional PositionSize methods
New SetPositionSize function:
SetPositionSize( size, method )
'size' and 'method' parameters are ARRAYS:
'method' can be one of:
spsValue (=1) - dollar value of size (as in previous versions)
spsPercentOfEquity (=2) - size expressed as percent of portfolio-level equity
(size must be from ..100 (for regular accounts) or .1000 for margin accounts)
spsShares (=4) - size expressed in shares/contracts (size must be > 0
)
spsPercentOfPosition (=3) - size expressed as percent of currently open position
(for SCALING IN and SCALING OUT ONLY)
For example to liquidate 50% of position simply use
SetPositionSize( 50, spsPercentOfPosition * ( Buy == sigScaleOut ) );
spsNoChange (=0) - don't change previously set size for given bar (allows
to write constructs like that):
SetPositionSize( 100, spsShares ); // 100 shares by default
SetPositionSize( 50, IIF( buy == sigScaleOut, spsPercentOfPosition, spsNoChange
) ); // for scale-out use 50% of current position size
New SetPositionSize function automatically encodes new methods of expressing
position size into old "positionsize" variable as follows:
values below -2000 encode share count,
values between -2000 and -1000 encode % of current position
values between -1000 and 0 encode % of portfolio equity
values above 0 encode dollar value
Although it is possible to assign these values directly to old-style PositionSize
variable, new code should use SetPositionSize function for clarity.
Example of code that exits 50% on first profit target, 50% on next profit
target and everything at trailing stop:
Buy = Cross( MA( C, 10 ), MA( C, 50 )
);
Sell = 0;
// the system will exit
// 50% of position if FIRST PROFIT TARGET stop
is hit
// 50% of position is SECOND PROFIT TARGET stop
is hit
// 100% of position if TRAILING STOP is hit
FirstProfitTarget = 10; //
profit
SecondProfitTarget = 20; //
in percent
TrailingStop = 10; //
also in percent
priceatbuy=0;
highsincebuy = 0;
exit = 0;
for( i = 0;
i < BarCount;
i++ )
{
if(
priceatbuy == 0 AND Buy[
i ] )
{
priceatbuy = BuyPrice[
i ];
}
if(
priceatbuy > 0 )
{
highsincebuy = Max( High[
i ], highsincebuy );
if(
exit == 0 AND
High[
i ] >= ( 1 + FirstProfitTarget
* 0.01 ) * priceatbuy )
{
//
first profit target hit - scale-out
exit = 1;
Buy[
i ] = sigScaleOut;
}
if(
exit == 1 AND
High[
i ] >= ( 1 + SecondProfitTarget
* 0.01 ) * priceatbuy )
{
//
second profit target hit - exit
exit = 2;
SellPrice[
i ] = Max( Open[
i ], ( 1 + SecondProfitTarget
* 0.01 ) * priceatbuy );
}
if( Low[
i ] <= ( 1 - TrailingStop
* 0.01 ) * highsincebuy
)
{
//
trailing stop hit - exit
exit = 3;
SellPrice[
i ] = Min( Open[
i ], ( 1 - TrailingStop
* 0.01 ) * highsincebuy
);
}
if(
exit >= 2 )
{
Buy[
i ] = 0;
Sell[
i ] = exit + 1; //
mark appropriate exit code
exit = 0;
priceatbuy = 0; //
reset price
highsincebuy = 0;
}
}
}
SetPositionSize( 50, spsPercentOfEquity );
SetPositionSize( 50, spsPercentOfPosition *
( Buy == sigScaleOut )
); // scale out 50% of position
- Change default value of "stop parsing at first error" pref
switch to FALSE
- Context-sensitive help system (press F1, and help page relevant to current
dialog / menu is brought up)
Note that help itself is from version 4.60, so some topics may be missing
yet, but it will be all updated with official release 4.70 as it will come
with a new Users Guide.
- Fixed bug: Drag-drop from one editor instance to another sometimes generated
random characters in source editor
- Added "Error 46. Missing comma" error message to the error
list
CHANGES FOR VERSION 4.69.0 (as compared to 4.68.2)
- Extended error information available now by pressing F1 key after highlighting
error line
- "Syntax error" message improved
[Now the parser attempts to tell you what is the exact reason of the error,
so it may tell you for example that:a) there is probably missing semicolon
in the previous lineb) that it is expecting '{' at the beginning of function
bodyc) that it expects ( after "if" , "for" and "while"etc,
etc.]
- "Missing comma" error message added if there is no comma in
variable declaration list or formal parameter list of the function
- Error line position calculated correctly even if using #include in the
formula
- Word wrap feature removed (as it caused problems with reporting line
number on syntax errors)
- Fixed handling of "Parameter" dialog inside Auto-Analysis
- Empty block statement allowed {}
- Edit button in AA window has now Alt-D shortut instead of Alt-E (no
conflict with &Exploration)
CHANGES FOR VERSION 4.68.2 (as compared to 4.68.1)
- Improved syntax checking so it points to correct row/col even if case
of block statements (completed: 2005-01-25)
[also with "bad arguments" error message arguments are now counted
from 1 (instead of 0).]
- AFL editor now highlights with yellow color the line in which error
occurred (Win XP, Win 2000 only) (completed: 2005-01-25)
[(there is a setting that allows to turn of this feature in Tools->Preferences->Editor "Highlight
error line")]
- Error list in AFL editor (completed: 2005-01-25)
[All error messages are now displayed in the listbox beneath AFL editor.
When you click on each error message, appropriate code line in the editor
is localized.]
- Improved handing of "stop on first error" flag (completed:
2005-01-25)
[Previously only syntax errors were terminating parsing, now also run time
errors terminate parsing on first error (when "stop on first error" flag
is set)]
- Added protection against parser re-entry during formula execution (completed:
2005-01-25)
- ListTrades method of Backtester object now produces output only when "Trade
List" mode is selected in the settings (completed: 2005-01-25)
[In previous versions (4.68.x) this method listed trades regardless of output
mode selected causing misaligned output when "summary" mode was
selected or optimization was run]
- Summary mode shows backtester metrics again (somehow it got broken in
4.68.1) (completed: 2005-01-25)
CHANGES FOR VERSION 4.68.1 (as compared to 4.68.0)
- When re-displaying resizable window its stored size and position is now
adjusted to fit on screen, also maximized state is stored separately (category:
UI - General) (status: fixed) (completed: 2005-01-23)
[(sometimes users moved windows outside desktop and had trouble getting them
back)]
- The reminder message about "Show trade arrows" working in
trade list mode is shown only once per session (category: UI - General)
(status: changed) (completed: 2005-01-23)
- Allow custom metrics to work with 3D optimization charts (category:
AFL - Backtester) (status: fixed) (completed: 2005-01-23)
CHANGES FOR VERSION 4.68.0 (as compared to 4.67.0)
- added: Default Custom backtest proc file path setting in the AA Settings
-allows to define external formula that will be default user-defined backtester
applied to all formulas that do not use its own procedure
- added: SetCustomBacktestProc function to allow changing custom backtest
procedure file from formula level
SetCustomBacktestProc( "filename", enable = True )
filename parameter instructs backtester to use external formula file as custom
backtest procedure
if empty - it means use current formula
enable = True (default) - enables custom backtesting procedure (the same
as SetOption("UseCustomBacktestProc", True );
enable = False - disables custom proc
- added: new ListTrades method of Backtest object and NoTradeList optional
parameter in Backtest method
This allows easier implementation of custom per-trade metrics. One can use
Backtest( 1 ) to disable default listing of trades then iterate via position
and trade list and then call ListTrades method. This is somewhat simpler
then implementing entire backtest loop just to add few per-trade metrics.
- added: Per-trade metrics
Trade object now features AddCustomMetric method.
Note that in contrast to Backtest.AddCustomMetric method that is usually
called after PostProcess, the Trade.AddCustomMetric should be called before
PostProcess call because PostProcess lists trades. Using Trade.AddCustomMetric
after PostProcess gives no result, because trades are already listed.
- added: new field suppoted by SetOption(): PortfolioReportMode
0 - trade list
1 - detailed log
2 - summary
3 - no output (custom only)
- Fixed crash occuring when trying to display error message about COM
exception and COM
- Fixed "Reverse signal forces exit" handled incorrectly in
4.67.0
- changed: BarsInTrade in Trade object should start from 1, not from 2
BarsInTrade property of Trade object is now zero-based. Note however that
the value of zero is available only when trade is just opened in "low-level" approach,
so normally you would see numbers >= 1 (all other reporting in AB remains
as it was, so enter today and exit tommorrow counts as 2-bar trade)
- fixed: click on "NEW" button in Formula editor should generate
new file name in the toolbar
- fixed: Re-enable SAVE button when formula name changes
- added: Raw text output (allocated to: 4.68)
Backtester object features now RawTextOutput method that just outputs any
string to the backtest result list at the time of the call. The user can
output text formatted in multiple columns using \t (tab) character.
- quick access to price arrays of open positions in Trade object (GetPrice
method)
GetPrice( Bar, Field ) method of Trade object retrieves the values of the
following fields:
O (Open)
H (High)
L (Low)
C (Close)
F (Fx currency rate)
NOTES:
1. GetPrice function is available only for OPEN POSITIONS, when called on
closed trade returns Null value
2. Open interest field is not available GetPrice
3. Bar must be between 0..BarCount-1, otherwise exception will occur
CHANGES FOR VERSION 4.67.0 (as compared to 4.66.2)
- when copy-paste results from Exploration, color codes appeared in Excel
as "square" characters. Now it is fixed.
- Automation interface change:
_Item (default property) with id of zero added to Stock.Quotations collection
Old Item() property remains with id of 5. This should ensure backward-compatibility.
- removed FreeExtra function to avoid possible memory fragmentation caused
by constant growing/shrinking memory when accessing data from RT sources
when requested bar count was twice as much as retrieved.
- added error message when the plugin returns incorrect size of quote
array
- removed requesting of quotes from RT data plugins during database save
(this should address exceeding symbol count when saving large databases
running with eSignal plugin)
- new method of Analysis OLE automation object:
Edit( [optional] ForceReload = False )
- displays AFL Editor window for currently loaded formula in AA window, optional
ForceReload parameter (default=false) allows to force AFL edito to reload
the formula from the file.
AB = new ActiveXObject("Broker.Application");
AA = AB.Analysis.
AA.LoadFormula("myFormula.afl");
AA.Edit( 1 ); // force reload
- new method of Analysis OLE automation object:
ShowWindow( nShowCmd ) - allows to show/minimize/maximize/restore AA window
nShowCmd uses standard WinAPI values, few most popular:
SW_HIDE 0
SW_SHOWNORMAL 1
SW_SHOWMINIMIZED 2
SW_SHOWMAXIMIZED 3
SW_RESTORE 9
- Scaling-in and scaling-out (pyramiding) is now supported by the backtester.
Two special constants: sigScaleIn / sigScaleOut added to provide means to
tell the backtester when you want to scale-in/out
All you have to do to implement pyraminding is to:
- Assign sigScaleIn to BUY/SHORT variable if you want to scale-in (increase
size of) LONG/SHORT position
- Assign sigScaleOut to BUY/SHORT variable if you want to scale-out (decrease
size of) LONG/SHORT position
Scaling size is defined by PositionSize variable which in case of scaling
defines not absolute positionsize but dollar increase or decrease.
IMPORTANT: Please note that backtester treats trade that you scale-in/out
as SINGLE trade (i.e. will show single row in trade list). The only difference
versus plain trade is that it will calculate average entry price (and avg.
entry fx rate) based on all partial entries and average exit price (and avg.
exit fx rate) based on all parial exits and will show average prices in entry/exit
price field. The commission is of course applied correctly to each (partial)
entry/exit depending on partial buy/sell size.
If you want to see details about scaling you have to run backtest in "DETAIL
LOG" mode as only then you will see how scaling-in /out works and how
average prices are calculated.
Note also that scaling-in/-out and multiple-currency support is available
only in portfolio backtester. Old backtester as well as Equity() function
do NOT handle scaling-in/out nor multiple currencies (they simply ignore
scaling commands).
Easy examples:
a) dollar-cost averaging (each month you buy stocks for fixed dollar amount)
FixedDollarAmount = 500;
MonthBegin = Month()
!= Ref( Month(),
-1 );
FirstPurchase = Cum(
MonthBegin ) == 1;
Buy = IIf(
FirstPurchase, 1, //
True (or 1) represents regular buy signal
IIf(
MonthBegin, sigScaleIn, //
each month increase position
0 )
); // otherwise no signal
Sell = 0; //
we do not sell
PositionSize =
FixedDollarAmount;
b) dollar-cost averaging
(simplified formula because AB treats first sigScaleIn as buy anyway)
FixedDollarAmount = 500;
MonthBegin = Month()
!= Ref( Month(),
-1 );
FirstPurchase = Cum(
MonthBegin ) == 1;
Buy = IIf(
MonthBegin, sigScaleIn, 0 ); //
each month increase position
Sell = 0; //
we do not sell
PositionSize =
FixedDollarAmount;
c) increasing position when profit generated by trade without pyramiding
becomes greater than 5% and decreasing position when loss is greater than
-5%
// percent equity change threshold when pyramiding
is performed
PyramidThreshold = 5;
// regular trading rules (no pyramiding)
Buy = Cross( MACD(), Signal()
);
Sell = Cross( Signal(), MACD()
);
e = Equity(1); //
generate equity without pyramiding effect
PcntProfit = 100 *
( e - ValueWhen( Buy,
e ) )/ValueWhen( Buy,
e );
InTrade = Flip( Buy, Sell );
// ExRem is used here to ensure that scaling-in/out
occurs
// only once since trade entry
DoScaleIn = ExRem(
InTrade AND PcntProfit > PyramidThreshold, Sell );
DoScaleOut = ExRem(
InTrade AND PcntProfit < -PyramidThreshold, Sell );
// modify rules to handle pyramiding
Buy = Buy + sigScaleIn *
DoScaleIn + sigScaleOut *
DoScaleOut;
PositionSize = IIf(
DoScaleOut, 500, 1000 ); //
enter and scale-in size $1000, scale-out size: $500
- fixed appearent hang occuring on rare occassions when backtesting very
large symbol set with trade size limit and round lot sizes enabled. Under
such conditions the price cache that backtester uses could fill up due
to the delayed release when limit of trade volume was hit and round lot
size or min. shares setting did not allow to enter smaller trade.
- AFL editor changes:
- added separate menu
- auto-saving of formula when user triggers analysis from AA window
instead of AFL editor
- when analysis is triggered from AA window and editor window is
open then any parsing error brings editor to the top
- AFL OLE support extended to allow SETTING OLE properties (previously
only calling methods and getting properties was possible)
Now AFL supports setting/getting properties in usual (brace-less) way:
For example:
AB = CreateObject("Broker.Application");
Stock = AB.Stocks("MSFT");
Stock.FullName = "Microsoft"; //
setting OLE property
- (for advanced users only, work in progress)
implemented new interface allowing to control 2nd phase of portfolio backtest
This allows multitude of applications including, but not limited to:
a) position sizing based on portfolio-level equity
b) implementing advanced rotational systems (you have now access to ranking
arrays and can decide what trades to take after knowing which symbols scores
best on bar-by-bar basis)
c) adding your custom metrics to backtest and optimization statistics
d) implementing custom formulas for slippage control
e) advanced scaling-in/-out based on portfolio equity and other run-time
stats
f) advanded trading systems that use portfolio-level statistics evaluated
on bar-by-bar basis to decide which trades to take
Full documentation on this new interface will be posted in a separate document.
Note: this interface is work-in-progress and any documentation is preliminary
and subject to change
- logical operators between number and dispatch (OLE) objects are performed
OK now. Also dispatch objects may be used in conditional expressions.
CHANGES FOR VERSION 4.66.2 (as compared to 4.66.1)
- Custom Tools menu re-enabled again (it was disabled in 4.66.0 and 4.66.1)
CHANGES FOR VERSION 4.66.1 (as compared to 4.66.0)
- fixed problem with duplicate chart sheets (which appeared in 4.66.0)
CHANGES FOR VERSION 4.66.0 (as compared to 4.65.2)
- Multiple-currency support in backtester.
Now backtester allows to backtest systems on securites denominated in different
currencies. It includes ability to use historical (variable) currency rates.
Currency rates are definable in "Currencies" page in the preferences.
The currency in which given symbol is denominated in can be entered in
Symbol->Information page
- "Currencies" page in Preferences - allows to define base currency
and exchange rates (fixed or dynamic)
for different currencies. This allows to get correct backtest results when
testing securities denominated in different currency than your base portfolio
currency.
- (for advanced users only, beginners should leave it untouched)
ability to change AFL formula root folder. Tools->Preferences->AFL
This not only changes preferences setting but also moves all formula files
from old location to new one and
re-links all charts to files in new location. If you specify new folder please
make sure to create an empty one. Do NOT use root directories like 'C:\'
(Please use this feature with caution, as it may cause problems if you have
more than one copy of AmiBroker installed in different directories, and upgrade
scripts may not find your new formula folder automatically, thus formulas
shipped with AB may not be updated on next installation *)
* - actually I will make installers aware of new folder location but this
will only work if you have one installation or if multiple installations
use the same formula folder.
- Custom indicator storage increased to 3000 slots
- Tools->Preferences->Data, new settings
"In-memory cache size max MegaBytes" -
now allows to limit the in-memory cache size to certain amount of megabytes
(in addition to limiting number of symbols). The default value is 20% of
physical RAM size (calculated by AB at first run)
- Indicator Maintenance Wizard (in Tools menu)
"Indicator Maintenance Wizard" scans all your hard drives for layout
files, then reads them all and checks which indicators are in use, then presents
you with a list of files that are not in-use and can be
deleted. Folders in drag-drop folder are automatically marked for deletion,
the other can be marked manually. And with one click you can delete unused
ones. The wizard can be run on whenever you need.
- new Interactive Brokers plugin (1.3.0) that collects data for all symbols
in RT quote window and forces AB to retrieve collected data even if no
chart is displayed for given symbol nor any scan is run
(note this feature requires not only new plugin but also AmiBroker 4.66.0
or higher)
CHANGES FOR VERSION 4.65.2 (as compared to 4.65.1)
- AFL Formula Editor: toolbar truncation problem solved
- AFL Formula Editor: new "Analysis" button with submenu allows
launching AA Scan/Exploration/Backtest/Optimize directly from the editor.
Subsequent clicks on "Analysis" button repeat last selected action.
- Automatic Analysis window redesigned:
- removed formula edit field - replaced by common editor that is
accessible via "Edit" button,
- changing active formula via "Pick" button
- layout modifed - now more space for result list
- additional button ^ allows to extend result list to cover entire
area of Auto-Analysis window.
- Now it is easy to have the same formula for indicator and AA. Just
edit the formula and insert chart and use the very same formula in
AA. Now when you modify the formula and save it - the changes will
be immediatelly applied to both AA and IB.
- Analysis menu accessible from Formula tree allows to load any formula
from tree directly to AA window.
AA window is also drag-drop target window so you can load the formula to
it via drag-drop too.
CHANGES FOR VERSION 4.65.1 (as compared to 4.65.0)
- fixed unexpected exit of AmiBroker that happened when your formula had
SetChartOptions() call and AFL Editor-> Verify or Insert chart was used
- added automatic saving of fail-safe copy before "Verify" in
AFL editor. Fail-safe copy is saved with .aflsafe extension. The copy is
automatically deleted if check was OK and no crash occurred. In case of
crash you can load the backup file to AFL editor (change "Files of
type" combo to "Fail-safe AFL backup" in the Open File dialog)
CHANGES FOR VERSION 4.65.0 (as compared to 4.64.3)
- AFL formula tree fold/unfold state restoring works with unlimited nesting
levels
- files and entire folders can be now moved using drag & drop mechanism
in AFL formula tree. To MOVE files/folders drag them with RIGHT MOUSE BUTTON,
to overlay on indicators - drag them using LEFT mouse button
- unnecessary formula tree refreshes removed
- multiple-level UNDO in AFL editor
- multiple-level REDO in AFL editor
- other minor 'undo' feature improvements (entering new line character
triggers undo)
- fixed crash when clicked AA->Parameters->Reset All
- Formula Editor has now "Formula name" field that allows to
specify file name quickly and save it without need to open "Save As" dialog
Files are stored by default in Formulas\Custom folder
- Save As... toolbar icon replaced by Save drop down menu
- Save function now uses "formula name" field (no need to open
file dialog)
- Scaling Min/Max properties now use plain edit fields (no sliders)
- Negative custom scale works again
- Numeric parameter editing enhanced:
- if you click on left-side part of the parameter value field then regular
edit field is displayed
- if you click on right-side part of the parameter value field then slider
control is displayed
- when "Step" argument in Param() function call is equal to zero,
then slider is disabled and parameter is editable only via regular edit control
- Formula Editor now features "Apply indicator" button that
works like old "Apply"
(i.e. checks syntax, saves and inserts ONCE) as well as "Insert indicator" (available
from submenu) that allows to insert multiple chart panes linked to the same
formula
- Formula Editor now has "Verify AFL" button that allows to
verify syntax of your AFL
formula without saving
- Automatic Analysis -> Individual Equity and Portfolio Equity now link
directly to
"Formulas\Equity\Individual.afl" and "Formulas\Equity\Portfolio.afl" files.
If you want to have your own customized equity chart you can modify those files
(remember that they will be overwritten by setup program). You can also have
unlimited number of your own equity charts defined as custom indicators.
- Portfolio equity chart allows to turn on/off cash/drawdown/bars since
last high/lin reg parts using Parameter dialog (by default they are all
off)
CHANGES FOR VERSION 4.64.3 (as compared to 4.64.2)
- fixed broker.newcharts file saving routine (should solve 'black panes'
problem that appeared in 4.64.0)
CHANGES FOR VERSION 4.64.2 (as compared to 4.64.1)
- during Layout/Template save, all currently used formulas are marked
as 'used' so they do not get deleted if the user closes the pane using
the same formula in some other layout. (Should solve 'black panes' problem
that appeared in 4.64.0)
- when choosing "Delete" option from the formula tree AmiBroker
displays the warning message that the formula may be in used in some indicators
if the formula was 'linked' to some pane at least once.
CHANGES FOR VERSION 4.64.1 (as compared to 4.64.0)
- formula tree is refreshed after using "Save As..." function
in Formula editor (to show any newly created files)
- "Parameters" menu option is turned on always
CHANGES FOR VERSION 4.64.0 (as compared to 4.63.1)
- QuickAFL is turned ON always
(it does not affect regular AFL code, only may affect some loops and/or plugins
but a graceful period of almost 2 years was given to every user to get
used to it and adjust the code if necessary, note: if particular formula
needs all bars use SetBarsRequired function)
- Quick built-in charts is turned ON always
- Y-axis drag area is now thinner (to make de-selecting date easier)
- resizing dialogs remember not only size but also position
- time&sales windows remember size and positions separately for each
symbol
- time&sales window now uses TimeShift setting from "Intraday
Settings" screen
- max. trade drawdown stat figure is now also updated at exit price of
the max. loss stop
- on startup all formulas (built-in and custom) that were stored in broker.charts
/ broker.bcharts files are now automatically converted to individual AFL
files and stored under: Formulas\Old\Built-in
and Formulas\Old\Custom
- found and fixed few byte memory leak when using #include
- #include can now read from registry using @ character
#include @LastBacktestFormula
will include the formula that was used in last backtest run (useful for custom
equity formulas)
- Workspace tab control now sizes down without displaying tab scroll bar
- all TimeFrame* AFL functions extended to work with N-tick bars too.
N-tick intervals are specified by NEGATIVE numbers passed in 'interval'
parameter.
So for example:
TimeFrameSet( -10 ); // switch to 10-tick interval
- Workspace -> Charts tree now supports file deletion, renaming, creation
of new files and folders plus more via Right-mouse button (RMMB) menu.
Options available from RMB menu:
- Insert - creates a copy of the selected file,
insert _SECTIONS if necessary and inserts charts into new pane
-
Insert Linked - just inserts chart into new pane
- the pane links directly to selected formula (so if you have more
than one pane using the same formula, modifying it will modify the
chart in all panes linked to it)
- Overlay - overlays selected formula onto "active" pane.
Active pane is the pane you have clicked on recently
- Edit - opens Formula Editor and loads selected
file for editing
- Rename - allows to rename formula file
- Delete - deletes the formula (permanently !)
- charts panes linked to it will become black
- New->Formula - creates new formula file
- New->Folder - creates new folder
- Refresh - refreshes directory/file tree
- Indicator builder removed and replaced by "Formula Editor"
- you can now control axis and grid settings from "Parameters" dialog
- "Main" chart, "Indicators" and "Other indicators" preference
pages removed. Now all charts use new drag & drop system
CHANGES FOR VERSION 4.63.1 (as compared to 4.63.0)
- fixed one more multiple-monitor problem with color popup control
- Parameters dialog works again in Automatic-Analysis window
- new AFL function: ParamTrigger
ParamTrigger( "Name", "Button text")
- to be used in indicator builder - to create triggers (buttons).
If you place ParamTrigger in the indicator code it will create a "button" in
Parameter dialog that can be pressed.
Normally ParamTrigger will return zero (0) but when button in the param window
is pressed then it will refresh the chart and ParamTrigger will return 1
(one) for this single execution (further refreshes will return zero, until
the button is pressed again)
Example:
trigger = ParamTrigger("Place
Order", "Click here
to place order");
if( trigger
)
{
// your one-shot
code here
}
- new AFL function: ParamList
ParamList( "Name", "Values", default = 0 )
- generates the parameter that consist of the list of choices (specified
in "values" parameter - | or comma separated). default parameter
defines ordinal position of the default string value specified in "values" parameter.
Returned value is a STRING representing choosen item.
Example:
OrderType = ParamList("Order
Type", "MKT|LMT|STP" );
CHANGES FOR VERSION 4.63.0 (as compared to 4.62.1)
- 6th parameter for the Param() - sincr - now has correct default value
of zero.
- trading arrows are correctly aligned again - there was a problem introduced
in 4.62.1 with arrows alignment
- fixed redraw problem of layers list
- new AFL function added:
GetTradingInterface("Name")
- retrieves OLE automation object to automatic trading interface. "Name" is
the interface name. You have to have trading interface installed separately
to make it work otherwise you will get the error message attempting to use
this function. Trading interface for Interactive Brokers will be released
separately.
- layer list item width is adjusted automatically now when sizing the
workspace pane
- colour-popup is aware of multiple-monitor configurations now and opens
up on correct monitor.
- 'Arrange' works properly now after 'pane maximize'
- added warning message when dropping files to AFL formula window.
- added realtime Time&Sales window (View->Time & Sales, or
right click over real time quote window)
Standard Edition: only one time & sales window open
Professional Edition: no limits on simultaneously open Time & Sales windows
Note that Time & Sales window requires true tick-by-tick streaming data
source (like eSignal) to operate properly. Certain feeds may not provide
enough information to allow time&sales window operation. eSignal has
been tested and it works fine, as for the others - there will be 'compatibility
guide' published soon.
- added automatic marking on "show arrows" flag for old-style
Price chart
- new AFL function (advanced users only)
SetChartOptions( Mode = 0, Flags = 0, gridFlags = chartGridMiddle )
allows to set/clear/overwrite/set defaults for chart pane options
- Mode - specifies how options are set:
- 0 - set only the DEFAULT values for new chart. Defaults are
applied only once when chart is inserted in a new pane, so later
you can modify any option using Indicator Builder
- 1 - overwrite - the values specified in 2nd and 3rd argument
overwrite any previously set values
- 2 - set flag - flags specified in 2nd and 3rd parameter are
binary-ORed with the current values, so effectively these options
are set while remaining are unchanged
- 3 - reset flag - flags specified in 3nd and 3rd parameter are
cleared while the others remain unchanged.
- Flags - allowable flags are:
chartShowDates, chartLogarithmic, chartShowArrow
- gridFlags - (for internal AmiBroker use - do not use it in your own
coding as this parameter will be eventually removed) allowable values
are: chartGridDiv100, chartGridPercent, chartGridDiv1000, chartGridMargins
chartGridMiddle, chartGrid0, chartGrid30, chartGrid70, chartGrid10, chartGrid90,
chartGrid50,chartGrid100,chartGrid20,chartGrid80,chartGrid1
Example:
to mark "Show arrows" by default in a new chart use
SetChartOptions( 0, chartShowArrows );
CHANGES FOR VERSION 4.62.1 (as compared to 4.62.0)
- new AFL function
ParamStyle("name", default = styleLine, mask = maskDefault ) -
allows to select the styles applied to plot
- new constants:
styleHidden - a combination of styleNoDraw | styleNoRescale
styleDashed - dashed line
to be used with ParamStyle
maskDefault - show thick, dashed, hidden, own scale styles (this is default
mask for ParamStyle)
maskAll - show all style flags
maskPrice - show thick, hidden, own scale, candle, bar
maskHistogram - show histogram, thick, hidden, own scale, area
- colorCycle - accepted only by ParamColor function as default value,
causes that default color cycles through red, blue, green, turquoise, gold,
violet, bright green, dark yellow
- added new setting in Preferences->Charting "Ask for parameters
of newly inserted indicators"
(default = TRUE) ensures that AmiBroker displays parameter dialog when inserting
or dropping new indicators
- removed obsolete "max number of custom indicators" setting
- Param() function accepts 6 parameters now
Param("name", defvalue, min = 0, max = 100, step = 1, sincr = 0
);
(Only for advanced users)
a new parameter sincr is defines the increase of default value when more
than one section of the same kind is inserted (dropped) onto the chart
For example:
Periods = Param("Periods", 15, 2, 200, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle
), ParamStyle("Style") );
now when more than one moving average is dropped onto the chart then subsequent
moving averages default to 15, 25, 35, 45, ... and so on (starting value
is 15, increase per new section is 10)
CHANGES FOR VERSION 4.62.0 (as compared to 4.61.0)
- implemented indicator drag and drop mechanism. See video tutorial: http://www.amibroker.net/video/dragdrop1.html
- new "Chart" tab in the workspace window (lists all AFL files
and directories from "Formulas" subfolder)
- Automatic Analysis formula window is now drag&drop target too (you
can drag formulas and AFL files onto it)
- new AFL special functions used to automatically create formulas from
code snipplets dragged onto the the indicator pane.
_SECTION_BEGIN, _SECTION_END, _SECTION_NAME, _DEFAULT_NAME, _PARAM_VALUES
- new styleNoTitle causing that given Plot name and values are not included
in the title bar of the indicator
- new ParamField function allowing to pick price field
- new ParamToggle function allowing for boolean (Yes/No) parameters
- In Tools->Preferences , Keyboard you can how define single key shortcut
for maximizing and restoring chart pane via View : PaneToggle
- "Allow mixed EOD/intraday data" switch does not affect N-day
bars anymore
- Parameters are not reset to default values when changing the formula-
user-edited values are kept
- new parameters dialog allowing using sections (for example from drag&drop
generated code)
- parameters dialog displays the items in the order as they appear in
the formula
- fixed Y-axis scale shrinking problem occuring when styleOwnScale was
used for all plots
- Insert->Standard Charts, Insert->Custom Indicators menu options
removed (now everything is handled by drag & drop) (You can still insert
old indicators from Indicator Builder dialog though)
CHANGES FOR VERSION 4.61.0 (as compared to 4.60.4)
- custom time interval support extended to N-day bars.
Now you can define N-day bars in Preferences (Intraday tab) as well as you
can use N-day bars via TimeFrame functions. For example
TimeFrameSet( 3 * inDaily ); // switch to 3-day time frame
VERY IMPORTANT:
inWeekly constant is now 432001 ( 5*inDaily + 1 ) - in previous version it
was 432000
inMonthly constant is now 2160001 ( 25*inDaily + 1 ) - in previous version
it was 2160000
It is changed because now N-day custom intervals are supported and they will
interfere with weekly/monthly.
Note that 5*inDaily is now DIFFERENT than inWeekly. 5*inDaily creates 5-day
bars that DO NOT necesarily cover Monday-Friday
while inWeekly ALWAYS creates bars that begin on Monday and end on Friday.
Also 25*inDaily creates 25-day bars that DO NOT necesarily represent full
month, while inMonthly always begins with first day of the month and ends
at the last day of the month
CAVEAT:
if your code uses hard-coded numbers like 432000 for weekly and 2160000 for
monthly then you MUST change your code to use inWeekly constant and inMonthly
constant instead.
- Study properties dialog has now new checkbox
"Lock position" - when checked study can not be moved or re-sized
- ExitAtStop has a new meaning for N-BAR stop type.
If ExitAtStop = 0 then N-bar stop has the lowest priority (so if for example
profit target stop is hit on the same bar then profit target is evaluated
first)
If ExitAtStop = 1 then N-bar stop has highest priority and it is evaluated
before all other stops.
The same effect is obtained by checking "Has priority" box in AA
Settings window.
- new maximizing/restoring chart pane functionality available via:
View->Pane->Maximize
View->Pane->Restore
as well as via right click menu.
Remember that you can assign your own keyboard shortcuts for that using Tools->Preferences->Keyboard
- New drawing tool: Arrow
- draws a line that ends with an arrow
- New drawing tool: zig-zag line
draws a series of connected trend lines (Hint: press ESC key to finish the
series)
- new File functions in AFL:
-
fdelete( "filename" ) - deletes file
"filename" is path to the file name (relative or full path).
If just file name without path is specified then AmiBroker directory
is used, returns TRUE if file successfully deleted, FALSE otherwise
- fmkdir( "dirname" ) - creates (makes)
a directory
"dirname" specifies path of the directory to be created. Please note
that this function creates only ONE directory at a time.
So if you want to create nested directory tree you have to call it multiple
times, for example to create C:\MyDirectory\MySubDirectory folder you
have to call it twice:
fmkdir( "C:\\MyDirectory" );
fmkdir( "C:\\MyDirectory\\MySubDirectory" );
Note also that it is safe to call it even if directory already exists
(then no change to file system is applied)
Returns TRUE if directory successfully created, FALSE otherwise
-
frmdir( "dirname" ) - removes a directory
"dirname" specifies path of the directory to be removed. Please note
that this function removes only ONE directory at a time.
So if you want to remove nested directory tree you have to call it multiple
times, for example:
fmkdir( "C:\\MyDirectory\\MySubDirectory" ); //
delete nested subdir first
fmkdir( "C:\\MyDirectory" );
Note that directory must be empty before removing it otherwise it will
not be possible to remove it.
Returns TRUE if directory successfully removed, FALSE otherwise
CHANGES FOR VERSION 4.60.3 (as compared to 4.60.2)
-
third point in 3-point drawing tools like triangle, pitchfork
and fib extensions is now snapped precisely when snap-to-price is enabled
-
user can override the maximum number of bars per symbol that AB allows
CHANGES FOR VERSION 4.60.2 (as compared to 4.60.1)
- october appears on date axis on weekly charts
- fixed small issue with returning global variables from functions (problem
appeared in 4.60.1 only)
- zero level in performance grid is plotted with default grid color
- fixed adding separator characted when percent scale is used
- fixed problem with N/A results occuring when trade size limit by symbol
volume was hit and round lot size was set to zero.
- Title variable templates: making Title statements easy.
Now you can embed special tokens in Title variable
that are replaced by appropriate values at run-time.
if you use {{VALUES}} inside Title string
it will be replaced by automatic-values generated by Plot function calls.
if you use {{NAME}} it will be replaced by ticker symbol.
if you use {{DATE}} it will be replaced by selected date
if you use {{INTERVAL}} it will be replaced by name of the interval
Example:
Title = "{{NAME}} - {{INTERVAL}} {{DATE}} - MyChart : {{VALUES}}";
- added information about the length of the cycle (in bars) when using
cycle drawing tool
CHANGES FOR VERSION 4.60.1 (as compared to 4.60.0)
- AA->Settings->Portfolio "Disable trade size limit if data
bar has the volume of zero" (true by default). When it is turned ON
and the entry bar volume is zero
the backtesterwill not apply the "limit trade size as % of entry bar
volume"- this is to allow backtesting mutual funds that come with zero
volume data When it is OFF and entry bar volume is zero then backtester will
not allow to enter the trade on such bar.
- AA->Settings->Portfolio "Use Previous Bar Equity For Pos Sizing" and
new field supported by SetOption/GetOption:
"UsePrevBarEquityForPosSizing"
Affects how percent of current equity position sizing is performed.
False (default value) means: use current (intraday) equity to perform position
sizing,
True means: use previous bar closing equity to perform position sizing
- cosmetic issues:
- replaced "stock" with "symbol" in some strings
- fixed minor painting problem occuring with cycle study drawn on intraday
charts
- using SelectedValue function does not grow future bar requirements anymore
- added StaticVarGetText to make using text static variables easier
http://www.amibroker.com/f?staticvargettext
- new built-in chart: Relative Performance - use right-click "Parameters" to
change the ticker list.
- ATR uses more bars now when quickafl is on
- scoreNoRotate is now highlighted in AFL editor
- fixed problem with access violations occuring sometimes when calling
the same function many times in single line and return statement in the
form: return varname;
- Status function supports now
"firstvisiblebar", "lastvisiblebar", "firstvisiblebarindex", "lastvisiblebarindex"
CHANGES FOR VERSION 4.60.0 (as compared to 4.59.0)
- fixed problem with not displaying 3D charts when profit was >1000%
(comma used as a thousand separator was causing problems - now the separator
is removed from the data file)
- O3G 3D graphing program improvements:
- optional flat orthogonal view
- translucent water level surface. You can move water level using
PageUp/PageDown keys and/or toolbar buttons Thanks to Mark Feierstein
for suggesting this.
- sizing and centering works much better now
- better font spacing/sizing
- you can now view the 3D chart of ANY statistic from optimization
results just CLICK on the list column HEADER you wish to chart and
then choose Report->3D graph and you will see the chart of selected
metric.
- charting improvements
- when text tool is active, selecting other tool automatically accepts
the text tool entry (no need for additional click on a chart to accept).
(You can of course abandon edits by pressing ESC key)
- trend-line bug (affecting other drawing tools) eliminated. (sometime
on multi-chart and multi-symbol setups the trendline randomly become
almost horizontal, now it is fixed)
- new drawing tool: CYCLE study
- pick start and end points and AmiBroker will plot 30 equally-spaced
cycles toward the past and 30 cycles towards the future
- new drawing tool: Fibonacci Extensions (Price)
- pick start and end point of the controlling trend line, then pick THIRD
point where extension lines will start
- new drawing tool: Fibonacci Time Extensions
- pick start and end point and AmiBroker will plot time cycle lines that
will represent fibonacci ratios multiplied by the number of bars between
start and end point
- drawing three point objects (triangle, pitchfork, and Fib Extensions)
simplified(now you can just click in three places - it is easier
for the beginners than clicking, holding down and dragging as it
worked previously. Old mode of operation works too)
- minor other fixes
- % sign appears again on grids using percent style
CHANGES FOR VERSION 4.59.0 (as compared to 4.58.0)
- added 3D, animated surface graph showing 2-parameter optimization results
(Automatic Analysis, Optimize button menu -> View 3D optimization graph
O3G - the 3D graphing program is pretty self-explaining.
Please note that you can move/rotate/animate the surface plot by mouse, keyboard
and toolbar buttons.
Mouse controls:
- to Rotate - hold down LEFT mouse button and move in X/Y directions
- to Zoom-in, zoom-out - hold down RIGHT mouse button and move in X/Y directions
- to Move (translate) - hold down LEFT mouse button and CTRL key and move
in X/Y directions
- to Animate - hold down LEFT mouse button, drag quickly and release button
while dragging
Keyboard controls:
SPACE - animate (auto-rotate)
LEFT ARROW KEY - rotate vert. left
RIGHT ARROW KEY - rotate vert. right
UP ARROW KEY - rotate horiz. up
DOWN ARROW KEY - rotate horiz. down
NUMPAD + (PLUS) - Near (zoom in)
NUMPAD - (MINUS) - Far (zoom out)
NUMPAD 4 - move left
NUMPAD 6 - move right
NUMPAD 8 - move up
NUMPAD 2 - move down
You can also copy the image as bitmap using Edit->Copy image
- intraday bar's portfolio equity (IBPE) is calculated from current bar
open price (IBPE is used only to calculate position size values when %
of portfolio is specified and reported only in 'detail log' mode). end-of-bar
equity (reported by equity chart) is calculated from close price (as it
always was)
- status bar is automatically shown when Crosshair tool is turned on
CHANGES FOR VERSION 4.58.0 (as compared to 4.57.0)
- 9 new AFL functions:
NoteGet( "Symbol" );
- retrieves note linked to "symbol". If symbol is "" (empty
string) then current symbol is used
NoteSet( "Symbol", "Text..." );
- sets text of the note linked to "symbol".
If symbol is "" (empty string) then current symbol is used.
If you overwrite note from AFL level that is opened at the same time in Notepad
editor the editor will ask you (when you switch the focus to it) if it should
reload new text or allow to save your manually entered text.
Example:
NoteSet("AMD", "Jun
15, 2004: AMD will deliver its first multi-core processors next year");
ClipboardSet( "Text" );
- copies the "text" to the Windows clipboard
ClipboardGet()
- retrieves current contents of Windows clipboard
// this can be used
to put dynamically-constructed texts into
// clipboard
//
ClipboardSet( "The
price of " + FullName()
+ " is " + Close );
VarSet( "varname", value )
- sets the value of dynamic variable*
VarGet( "varname" )
- gets the value of dynamic variable*
StaticVarSet( "varname", value )
StaticVarSetText( "varname", "value" )
- sets the value of static variable**
StaticVarGet( "varname" )
- gets the value of static variable**
* Dynamic variables are variables that are named dynamically, typically
by creating a variable name from a static part and a variable part. For example,
the following example dynamically constructs the variable name from a variable
prefix and a static suffix.
for(
i = 1; i < 10;
i++ )
{
VarSet( "C"+i, Ref( C,
-i ) );
}
// creates variables C1, C2, C3, C4, ...., C10
equal to Ref( C, -1 ), Ref( C, -2 ), ..., Ref( C, -10
)
// respectively
** Static variable - the variable has static duration (it is allocated
when the program begins and deallocated when the program ends)
and initializes it to Null unless another value is specified. Static variables
allow to share values between various formulas.
Only NUMBER and STRING static variables are supported now (not ARRAYS).
- new Preferences: Intraday setting
"Override: Weekly/monthly bars use day of last trade"
when checked (default) then weekly/monthly charts always use timestamp of
the day of last trade within a week/month (may not be Friday or last day
of the month) regardless of what is set in "Time stamp of compressed
intraday bars shows" radio buttons
If you uncheck this box and "time stamp of compressed intraday bar" is
set to END TIME of the interval, then weekly bars will be time-stamped with
last day of the week (sunday) and monthly bars will be time-stamped with
last day of the month regardless if trading has occured on that day or not.
- AddToComposite now by default deletes all previous data instead of setting
existing fields to zero at the start of the scan.
The flag default flag 1 has now the name of atcFlagDeleteValues the old flag
(now optional) atcFlagResetValues now has value of 32. Most formulas using
ATC should not be affected by that change.
- AA: Settings: "Pad and align to reference symbol" is now available
for all AA modes (not only portfolio backtest).
This allows for example to turn on aligning when running scans with AddToComposite
and thus ensuring that data holes do not generate valleys in composites.
This is useful to create intraday composites when data holes/misalignment
is often. (when creating intraday composites it is now recommended to check
alignining as well as changing "Time compressed bars use START (or END)
time of interval" in Tools->Preferences->Intraday)
CHANGES FOR VERSION 4.57.0 (as compared to 4.56.1)
- profit distribution chart took a bit long when profits were extremely
large - now it is fixed
- changed vertical line selection code to prevent line disappearing after
RT update
- vertical line selection is now working fine in multiple linked windows
displaying different time frames
- chart panes can be now moved up/down using View->Pane->Move Up/Down
without need to re-insert everything to change the order
- fixed 'approx. X days' text in the "Database Settings" window
that reported wrong values in versions 4.53..4.56
- when "show arrows" option is selected in AA window then correct
interval is selected in the chart (it was not functioning properly for
beta versions 4.53..4.56 and intraday data)
- added Notepad window (View->Notepad) that allows to store free-text
notes about particular security. Just type any text and it will be automatically
saved / read back as you browse through symbols. Notes are global and are
saved in "Notes" subfolder as ordinary
text files.
- implemented browser-like history Back/Forward in menu View->History
and in the toolbar,(keyboard shortcuts Back: Ctrl+Alt+LEFT, Forward: Ctrl+Alt+RIGHT,
you can change it in Tools->Prefs->Keyboard) Please note that due
to customization features of the toolbar on old installations the Back/Forward
buttons will not appear unless added manually (click with RIGHT mouse button
over standard toolbar, select "CUSTOMIZE" menu and add Back/Forward
buttons.)
CHANGES FOR VERSION 4.56.1 (as compared to 4.56.0)
- fixed crash at address: 0x474f54
- fixed K-ratio calculation. Now follows exactly corrected Excel sheet
from page 89 of "Quantitative Trading Strategies" by Lars Kestner
(published 2003).
- because of many people not reading the comment regarding new "Limit
trade size as % of entry bar volume" setting, implemented checking
for volume = 0 in data files. If volume is equal to 0 in your data file
then this trade size limit does not apply.
CHANGES FOR VERSION 4.56.0 (as compared to 4.55.1)
- fixed crash when RT quote window ticker list contained symbol that did
not exist in the database
- added Toolbar customization:
right-click over any toolbar and choose "CUSTOMIZE" menu to add/remove/arrange
toolbar buttons. You can also press ALT key and move/arrange buttons within
one toolbar without needing to open "customize" dialog
- eSignal plugin 1.7.1: fixed problem with zero data when the user selected
not enough bars to load (mixed mode requires a bit more bars)
CHANGES FOR VERSION 4.55.1 (as compared to 4.55.0)
- implemented workaround to Windows XP status bar display problem causing
plugin status indicator not 'disappearing' sometimes
- fixed problem with crash sometimes occuring when calling Import() OLE
automation method
when AB was not running.
Versions 4.54-4.55 are localization-enabled and month names are localized
too, localized strings have to be setup at the start of the program, but
this was working correctly only if GUI was launched. When creating AB OLE
object without GUI month name string were not
set-up correctly and this caused problems. (This fixes problems with CSI/UA
export as well as AQ trying to import to non-existing instance of AB)
- fputs/fgets/fclose/feof file functions are now protected against using
null file handle
(common coding error among AFL users)
- Parameter names are not truncated in the parameter list
CHANGES FOR VERSION 4.55.0 (as compared to 4.54.0)
- Median and Percentile calculations include current bar
- new symbols added via CategoryAddSymbol trigger workspace ticker list
refresh
- calling COM methods returning nothing (void) does not cause "type
mismatch" message
- duplicate parameters are no longer produced when user specifies parameter
names with trailing/leading spaces in Param()/ParamStr()/ParamColor()
- now it is safe to call AB.RefreshAll() from inside of AmiBroker because
this method is protected against locking up / looping by not allowing consequent
refresh if previous refresh occured in less than one second
- Parameters window now is resizable
- Parameters window now support date and time parameters.
Corresponding new AFL functions are:
ParamDate( "Name", "Default date", format = 0 );
where:
"Name" is a string holding parameter name
"Default date" is a string holding date in any any format:
YYYY-MM-DD
MM/DD/YY
DD-MM-YY
etc, etc.
format - defines return value format, allowable values are:
0 - return value is a NUMBER and holds DateNum. Ie: 990503 for May 3, 1999,
1 - return value is a STRING formatted holding date according to your windows
regional settings
ParamTime( "Name", "Default time", format = 0 );
where:
"Name" is a string holding parameter name
"Default time" is a string holding date in any of the following formats:
HH:MM:SS
HH:MM
format - defines return value format, allowable values are:
0 - return value is a NUMBER and holds TimeNum. Ie: 133515 for 13:35:15
1 - return value is a STRING formatted holding time according to your windows
regional settings
Examples:
Title = WriteVal( ParamDate("ParamDateAsDateNum","2004-05-14"),
7.0 );
Title = ParamDate("ParamDateAsString","2004-05-17",1);
- portfolio/individual backtester/optimizer, new setting in AA->Settings->Portfolio:
"Limit trade size as % of entry bar volume" (default = 10%)
This prevents from entering the trades greater than given percentage of entry
bar's volume.
For example if backtesting daily data and today's volume for thinly traded
stock is 177,000 shares, setting this to 10% will limit the maximum trade
size to 17,700 shares (10% of total daily volume). This prevents from 'affecting
the market'
by huge orders.
IMPORTANT NOTE:
Some instruments like MUTUAL FUNDS come without VOLUME data. To backtest
such instruments please set this field to ZERO (0). This effectively turns
OFF this feature. Otherwise you won't be able to enter any trade at all.
Suggestions are welcome how to handle this problem automatically (maybe just
detect if bar's volume is ZERO and then allow entering any size?)
- K-ratio calculation changed following the change made by its creator,
Mr. Lars Kestner.
Quoting from the book "Quantitative Trading Strategies" from 2003
by Lars Kestner:
[ - - - ]
" The K-ratio is a unitless measure of performance that can be compared
across markets and time periods. [ - - - ] Traders should
search for strategies yielding K-ratios greater than +0.50. Together, the
Sharpe ratio and K-ratio are the most important
measures when evaluating trading strategy performance. Note: When I created
the K-ratio in 1996, I thought I had created a
robust measure to evaluate performance. In mid-2000, trader Bob Fuchs brought
a small error to my attention regarding the
scaling of the K-ratio. He was correct in his critique and I have corrected
the error in this text. Publications prior to 2002 will
show a different formula for the K-ratio. The updated formula in this book
is correct."
Mr Lars Kestner has corrected his formula based on this critique:
K-ratio = slope / ( sterr * per )
slope: Linear regression slope of equity line
sterr: Standard error of slope
per: Number of periods in the performance test
Special thanks to Jeremy Berkovits who brought that to my attention.
CHANGES FOR VERSION 4.54.0 (as compared to 4.53.1)
- "Allow mixed EOD/intraday data" mode added (controllable from
File->Database Settings->Intraday, checkbox with the same name) it
allows to work with database that has a mixture of intraday and EOD data
in one data file. If this is turned on then in intraday modes EOD bars
are removed on-the-fly and in daily mode EOD bars are displayed instead
of time compressed intraday or if there is no EOD bar for corresponding
day then intraday bars are compressed as usual.
This mode works in conjunction with new versions of plugins that
allow mixed data. Mixed mode is now supported by MarketCast plugin
(1.1 or higher)(Australia) and eSignal plugin (1.7.0 or higher) only.
Mixed mode allows intraday plus very long daily histories in one
database.
Note that this is EXPERIMENTAL feature.
+ Real-Time quote window enhanced
Now only fields that are changed change the background to 'yellow' and
if the value in given field increases then it is displayed in green if
decreases then is displayed in red. This allows easy identification of
movement.
+ all strings in the program moved to resources for easy localization
+ fixed problem with SetForeign()+FullName() returning symbol instead
of full name of foreign security.
+ added new AFL function IsContinuous() to check if "continuous" flag
is turned on in Symbol->Information window
+ OLE properties can be retrieved (DISPATCH_PROPERTYGET) directly
from AFL now using parameterless function syntax. This allows reading
values exposed by OLE automation directly from AFL code. Example:
AB = CreateObject("Broker.Application");
Stocks = AB.Stocks(); // get collection
Stock = Stocks.Item( Name()
); // currently selected
"FullName : " +
Stock.FullName();
"Alias : " + Stock.Alias();
"Address : " +
Stock.Address();
"Shares: " + Stock.Issue();
"Book value: " +
Stock.BookValue();
"Market : " + Stock.MarketID();
"WebID : " + Stock.WebID();
You can check if OLE object is valid by calling IsNull() function,
example:
AB = CreateObject("Broker.Application");
Stocks = AB.Stocks(); // get collection
Stock = Stocks.Item( "INTC" );
if( IsNull(
Stock ) )
{
printf("COM
object invalid (Null) - symbol does not exist\n");
}
else
{
printf("COM
object valid - you can access its methods\n");
}
+ IsEmpty/IsNull and IsTrue functions operate with scalars and OLE
dispatches without upsizing them to array
CHANGES FOR VERSION 4.53.1 (as compared to 4.53.0)
- addressed problem with broker.layers file. Now version 4.53.1 correctly
reads broker.layers file saved with older versions however note that old
versions are not compatible with new format.
- layer properties dialog provides more comfortable setting of layer visibility
- other minor fixes
CHANGES FOR VERSION 4.53.0 (as compared to 4.52.0)
- per-group intraday settings (filtering/daily compression) Use Symbol->Categories: "GROUP" -> Use
own intraday settings, click
on "Intraday settings" button to define intraday settings specific
to given group.
- intraday settings now allow to specify separate day (RTH) and night (ETH)
sessions
- time filtering now allows to display:
a) 24 hours trading (no filtering)
b) day session only
c) night session only
d) day and night sessions only
- new intraday time compression mode: Day/Night - shows two bars (day and
night) per day
- daily compression can be now based on
a) exchange time (available since 4.00)
b) local time (available since 4.50)
c) day/night session times definable by the user (new)
- when "activatestopsimmediately" is turned ON then cash from
stopped out positions is NOT available to enter trades the same day
- easy access to selected category settings from Symbol->Information
window.
- Workspace tree supports in-place editing of market, group, sector, industry
and watch list names. Single click on category name and just enter the
name
CHANGES FOR VERSION 4.52.0 (as compared to 4.51.1)
- fixed problem with fixup=0 and handling multiple data holes in a row
- added new commands to ASCII format definitions:
$MINTICKERLEN <number> - defines minimum accepted length of the ticker
symbol
$MAXTICKERLEN <number> - defines maximum accepted length of the ticker
symbol
For example ASX users may wish to use
$MAXTICKERLEN 3
to make sure that ASCII importer accepts only symbols that have no more than
3 characters (this excludes ASX options and warrants)
- fixed problem with incorrect very first value of the array returned by
variable-period version of HHV/LLV
- fixed Procedure/function parameter overwrite issue when using built-in
price arrays and variable overwrite issue
- memory allocated for return value is marked for earlier freeing so calling
user-defined functions inside loops should consume less memory
- Interval() function enhanced. Now accepts format parameter:
Interval( format = 0 );
possible values:
format = 0 - returns bar interval in seconds
format = 1 - as above plus TICK bar intervals are returned with negative
sign
so Interval() function applied to 10 tick chart will return -10
format = 2 - returns STRING with name of interval such as "weekly/monthly/daily/hourly/15-minute/5-tick"
- vertical quote selection line in linked windows is now independent
- changing "same day stops" via SetOption("ActivateStopsImmediately")
in portfolio backtest mode has an effect now (previously reacted only on
manual settings)
- SetOption("CommissionMode", mode ) works now in portfolio
mode too (previously worked
in old backtest mode only)
- SetOption("CommissionAmount", amount ) works now in portfolio
mode too (previously worked
in old backtest mode only)
- $SEPARATOR command in ASCII importer definitions now allows to import
files that have fields separated by more than one separator characters
Separator string (array of characters) must be enclosed in quotation marks.
If there is only one separator character (as in old versions) then quotation
marks are needed.
For example files with joined date and time
$SEPARATOR ", "
$FORMAT DATE_YMD,TIME,OPEN,HIGH,LOW,CLOSE
will be able to import file like this:
2004-02-04 12:30,3.41,3.44,3.40,3.42
(note date and time field are separated by space not by comma)
- Import wizard now supports new separators 'comma or space', 'semicolon
or space' and 'tab or space'
- ASCII importer and Quote Editor properly
distinguish records with time specified as 00:00:00 from EOD records (without
time)
CHANGES FOR VERSION 4.51.1 (as compared to 4.51.0)
- OLE interface methods numbering adjusted to maintain backward compatibility
with previous versions and other programs referring to old OLE interface
CHANGES FOR VERSION 4.51.0 (as compared to 4.50.10)
- OLE automation interface changes:
Analysis.Backtest and Analysis.Optimize now support new "Type" parameter.
Type can be one of the following values:
0 : portfolio backtest/optimize
1 : individual backtest/optimize
2 : old backtest/optimize
For backward compatibility Type parameter is optional and defaults to 2
(old backtest/optimize)
Example code:
AB = new ActiveXObject("Broker.Application");
AB.Analysis.Backtest( 0 ); // perform portfolio backtest
AB.Analysis.Optimize( 0 ); // perform portfolio optimize
-
OLE automation interface new object: "Commentary"
This object has 5 methods:
- BOOL LoadFormula( STRING pszFileName ) - loads the formula
- BOOL SaveFormula( STRING pszFileName ) - saves the formula
- void Apply() - displays the commentary
- BOOL Save( STRING pszFileName ); - saves commentary output (result) to
the file (use after call to Apply())
- void Close() - closes the commentary window
Commentary object is accessible from Broker.Application object via
Commentary property:
Example code:
AB = new ActiveXObject("Broker.Application");
AB.Commentary.LoadFormula("C:\\Program Files\\AmiBroker\\AFL\\MACD_c.afl");
AB.Commentary.Apply();
AB.Commentary.Save("Test.txt");
AB.Commentary.SaveFormula("MACDTest.afl");
//AB.Commentary.Close();
-
AFL function Now( format = 0 ) accepts new parameter values
Returns current date / time in numerous of formats:
// formats supported by old versions
format = 0 - returns string containing current date/time formatted according
to system settings
format = 1 - returns string containing current date only formatted according
to system settings
format = 2 - returns string containing current time only formatted according
to system settings
format = 3 - returns DATENUM number with current date
format = 4 - returns TIMENUM number with current time
format = 5 - returns DATETIME number with current date/time
// new formats available from version 4.51
format = 6 - returns current DAY (1..31)
format = 7 - returns current MONTH (1..12)
format = 8 - returns current YEAR (four digit)
format = 9 - returns current DAY OF WEEK (1..7, where 1=Sunday, 2=Monday,
and so on)
format = 10 - returns current DAY OF YEAR (1..366)
-
Custom indicators:
If plot name is empty the value of such plot does not appear in the title
and does not appear in the data tool tip
Plot( C, "Price", colorWhite, styleCandle );
Plot( MA( C, 10 ), "", colorRed ); // NOTE that this plot name/value
will NOT appear in the title
Plot( MA( C, 20 ), "MA20", colorGreen );
-
SetOption( "field", value )
accepts new fields:
"CommissionMode" -
0 - use portfolio manager commission table
1 - percent of trade
2 - $ per trade
3 - $ per share/contract
"CommissionAmount" - amount of commission in modes 1..3
"MarginRequirement" - account margin requirement (as in settings),
100 = no margin
"ReverseSignalForcesExit" - reverse entry signal forces exit
of existing trade (default = True )
-
new AFL function: GetOption( "field" ) - retrieves the settings,
accepted fields the same as in SetOption.
Example:
PositionSize = -100 / GetOption("MaxOpenPositions");
-
new AFL function: GetRTData( "field" )
- retrieves the LAST (the most recent) value of the following fields
reported by streaming real time data source )
(Note 1: this function is available ONLY in PROFESSIONAL edition,
calling it using Standard edition will give you NULL values for all fields)
(Note 2: works only if data source uses real time data source (plugin)
)
(Note 3: availablity of data depends on underlying data source
- check the real-time quote window to see if given field is available )
(Note 4: function result represents the current value at the time of the
call
/formula execution/, and they will be refreshed depending on chart or commentary
refresh interval
/settable in preferences/. Built-in real time quote window is refreshed
way more often (at least 10 times per second) )
Supported fields:
"Ask" - current best ask price
"AskSize " - current ask size
"Bid" - current best bid price
"BidSize " - current bid size
"52WeekHigh" - 52 week high value
"52WeekHighDate" - 52 week high date (in datenum format)
"52WeekLow" - 52 week low value
"52WeekLowDate" - 52 week low date (in datenum format)
"Change" - change since yesterdays close
"Dividend" - last dividend value
"DivYield" - dividend yield
"EPS" - earnings per share
"High" - current day's high price
"Low" - current day's low price
"Open" - current day's open price
"Last" - last trade price
"OpenInt" - current open interest
"Prev" - previous day close
"TotalVolume" - total today's volume
"TradeVolume" - last trade volume
"ChangeDate" - datenum (YYYMMDD) of last data change
"ChangeTime" - timenum (HHMMSS) of last data change
"UpdateDate" - datenum (YYYMMDD) of last data update
"UpdateTime" - timenum (HHMMSS) of last data update
"Shares" - total number of shares
Example:
"Bid = "+GetRTData("Bid");
"Ask = "+GetRTData("Ask");
"Last = "+GetRTData("Last");
"Vol = "+GetRTData("TradeVolume");
"EPS = "+GetRTData("EPS");
"52week high = "+GetRTData("52weekhigh");
-
Custom indicators:
Default names and graph values appear in the title
when using old-style graph0, graph1, graph2 statements in the custom indicators
CHANGES FOR VERSION 4.50.5 (as compared to 4.50.4)
CHANGES FOR VERSION 4.50.4 (as compared to 4.50.3)
- portfolio report now shows "N/A" instead of -1#INF and similar
strange looking things that appeared when there were no trades (division
by zero)
- removed the extra 'z' letter in fprintf formatting sequence (that caused
crash on exit when saving params)
- correct column type (alpha) is set for the first column in individual
backtest
- 'show current trade arrows' works OK after portfolio backtest
- when timeshift is not equal zero in intraday databases then DateNum(),
Day(), Month(), Year(), DayOfWeek() and DayOfMonth() functions adjust date
(day) when bar time is 'shifted' outside 0..24 hour range.
- rotational mode: all OHLC fields in artificial future bar are filled
with close price of last bar for consistency with regular mode and to prevent
problems with stops hit on artificial future bar in rotational mode.
CHANGES FOR VERSION 4.50.3 (as compared to 4.50.2)
- the formula names with dash '-' character are now properly displayed
in the reports
- fixed problem with Equity/SetForeign (introduced in 4.50)
- MAE/MFE charts X-axis layout improved
- new report - trade list: profit, pos. size, cum. profit and profit/bar
columns use fixed format with 2 decimal places now (no scientific format)
- EnableTextOutput() works again (thx. Greg)
- fixed rounding in Stock.NominalValue
- other minor fixes:
+ better CRC calculation method for #include
+ sellprice/coverprice are written back with updated prices for stops in
case of Equity(1)
+ fixed menu-button owner draw painting code (thx. Herman)
+ progress window is displayed in single-stock optimization with new backtester
too
CHANGES FOR VERSION 4.50.2 (as compared to 4.50.0)
- fixed problem with 'exit date' showing in fact 'entry date' in trade
list (problem introduced in 4.50.0)
- fixed crash @0x482898
CHANGES FOR VERSION 4.50.0 (as compared to 4.49.0)
- old backtester uses now also "MinShares" Setting, so it will
not enter trade with share position size lower than 'min. shares'. Due
to this change. 'min. shares' setting has been moved from 'Portfolio' to
'General' setting page.
- changed handling of open positions in old backtester to match with portfolio
backtester and equity plot:
- exit commissions are taken from open position profit (previously they were
not taken)
- open positions are closed always at CLOSE price (previously were closed
at trade price)
- LineArray( x0, y0, x1, y1, extend = 0, usebarindex = False )
- has new parameter (usebarindex) - False by default that switches allows
to specify x parameters as bar Indexes (as returned by BarIndex() function).
- fixed problem with displaying exploration results having more than 100
columns
- portfolio backtests/optimizations should be 2x faster on average (* excluding
scanning phase)
- layout of AA window changed. Now (new) PORFOLIO backtest and PORTFOLIO
optimize modes are default and available from "Backtest" and "Optimize" buttons.
Other modes are available from drop down menus added to "Backtest" and "Optimize" buttons.
Portfolio report is no longer automatically displayed after portfolio backtest.
Please click "Report" button to display it. The same applies
to portfolio equity.
- layout of settings page changed. Old backtester settings moved to 'old'
page.
- new "individual backtest" mode: allows to run new backtester
separately on each symbol in the selected "apply to" group. (Replaces
old backtester functionality in testing multiple stocks and provides new
reports)
- settings and formula used are automatically saved after portfolio backtests
- new reports are now divided into separate pages: Statistics, Charts,
Trades, Formula, Settings, Symbols
- each backtest report is now automatically stored "Reports" subfolder
of AmiBroker directory. The results.rlst holds tab separated list of all
backtests results while corresponding subdirectories hold reports of backtest.
REMEMBER to delete old reports periodically (using Report Explorer), otherwise
your hard disk would fill up!
- New add-on program (free) included: Report Explorer that allows to browse
/ sort / view / delete results of backtests.
Available from AA window Report -> Report Explorer.
- new AFL function:
SetFormulaName( string )
allows to programatically change the name of the formula that is displayed
in the backtest result explorer
- fixed cases when GetChartID() used in AA did not return zero
- Window->Clone has been renamed to Window->New Linked to better
describe its function
- other minor fixes
CHANGES FOR VERSION 4.49.0 (as compared to 4.48.2)
- new Percentile function
Percentile( array, period, rank )
rank is 0..100 - defines percentile rank in the array
Example:
Volume > Percentile( Volume, 100, 70 );
means: current day volume ranks within TOP 30% of volumes of last 100 bars
(is above 70th percentile)
Volume < Percentile( Volume, 100, 30 );
means: current day volume ranks within BOTTOM 30% of volumes of last 100
bars (is below 30th percentile)
(performance note: the implementation of percentile function involves sorting
that is relatively slow process even though that quicksort algorithm is used)
- new function
LineArray( x0, y0, x1, y1, extend = 0 )
generates array equivalent to trend line drawn from point x0, y0 to point
x1, y1. x coordinates are in bars (zero based), y coordinates are in dollars
Note: x0 must be SMALLER than x1. Note 2: the function accepts only numbers
therefore
generates single line. To produce multiple lines you have to call it many
times with different co-ordinates.
if extend is 1 then line is right extended.
if extend is 2 then line is left extended
if extend is 3 then line is left and right extended
Example:
y0=LastValue(Trough(L,5,2));
y1=LastValue(Trough(L,5,1));
x0=BarCount - 1 - LastValue(TroughBars(L,5,2));
x1=BarCount - 1 - LastValue(TroughBars(L,5,1));
Line = LineArray( x0,
y0, x1, y1, 1 );
Plot(C, "C", colorWhite, styleCandle);
Plot( Line, "Trend
line", colorBlue );
- new function sign( x )
(x can be number or array).
Returns 1 if x is positive, returns -1 if x is negative, and returns 0 if
x is zero.
- ApplyStop : 'exitatstop' parameter extended:
ApplyStop( Type, Mode, Amount, ExitAtStop = 1, Volatile = False, ReentryDelay
= 0 )
ExitAtStop = 0 - means check stops using only trade price and exit at regular
trade price
(if you are trading on close it means that only close price will be checked
for exits and exit will be done at close price)
ExitAtStop = 1 - check High-Low prices and exit intraday on price equal to
stop level on the same bar when stop was triggered
ExitAtStop = 2 - check High-Low prices but exit NEXT BAR on regular trade
price.
( first two modes 0 and 1 are the same as in old versions )
Note on using stops:
Scenario 1:
you trade on next bar OPEN and want to exit intraday on stop price
Correct settings:
ActivateStopsImmediately turned ON
ExitAtStop = 1
Trade delays set to one
Trade price set to open
Scenario 2:
you trade on today's close and want to exit intraday on stop price
Correct settings:
ActivateStopsImmediately turned OFF
ExitAtStop = 1
Trade delays set to zero
Trade price set to close
Scenario 3:
you trade on next day OPEN and want to exit by stop on OPEN price when PREVIOUS
day H-L range hits stop
Correct settings:
- (if you want to have stops executed AFTER regular signals, so cash
from stopped out positions is NOT available to enter trades the same
day)
ActivateStopsImmediately turned ON
- b) (if you want to have stops executed BEFORE regular signals, so cash
from stopped out positions IS available to enter new trades the same
day)
ActivateStopsImmediately turned OFF
ExitAtStop = 2 (NEW)
Trade delays set to one
Trade price set to open
Scenario 4:
you trade on today's close and want to exit only when today's close price
hits the stop level
Correct settings:
ActivateStopsImmediately turned OFF
ExitAtStop = 0
Trade delays set to zero
Trade price set to close
- portfolio backtester: MAE/MFE are now updated with exit price in case
when profit has been hit intraday and activate stops immediatelly was turned
off.
- portfolio backtester: 'activate stops immediately'=TRUE and 'same bar
exit'=FALSE combination works OK now
- 'auto-tile windows' feature now tiles windows only it two cases:
- when new window is open
- when RT quote window is shown/hidden
- in versions 4.48.0-4.48.2 cloned windows were sometimes saved in two
or more copies, now it is fixed. This bug caused also crashes when switching
layouts. Fixed.
- portfolio backtester now allows custom exit labeling as old backtester
- fixed range unmarking by double click in cloned windows
- all listviews now use alternate background colors for odd/even rows
this feature can be turned off using Tools->Preferences->Miscellaneous "Use
alternate row colors"
CHANGES FOR VERSION 4.48.2 (as compared to 4.48.1)
- once more changed slightly HTML copy routine and turned it off by default
- added a switch to Tools->Preferences->Editor that allows to turn "Copy
as HTML" feature on, on those machines having no problems (like mine)
CHANGES FOR VERSION 4.48.1 (as compared to 4.48.0)
- Changed code that copies HTML format from AFL editor to clipboard. (this
hopefully will address problems with pasting on some machines)
- MFE/MAE distribution charts are now available in Professional Edition
only
- zooming is now independent in cloned windows
CHANGES FOR VERSION 4.48.0 (as compared to 4.47.0)
- 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.
- 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)
- portfolio backtester: added support for backtesting futures
- portfolio backtest report:
+ 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
- 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)
- 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)
- 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.
- Regular mode: "Max # of tracked signals" setting removed.
Now _all_ exit signals are tracked.
- fixed offset in day numbers returned by DayOfWeek() function for dates
prior to 1970
- added InterestEarning calculation to Portfolio backtest
- 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)
- other minor fixes
CHANGES FOR VERSION 4.46.3 (as compared to 4.46.2)
- thousand separator is removed automatically in StrToNum to prevent problems
with conversion of numbers > 1000 when thousand separator is enabled
- fixed issue with rotational mode, entering other symbols when trade
on top ranked symbol has been stopped and re-entry delay > 0
- 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.)
- still open trades are listed in HTML report too.
- 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)
- 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)
- new AFL function:
Median( array, period ) - finds median (middle element) value over period
elements
- now trade list in portfolio mode displays reason for exit (if trade has
been closed by stop)
- trade list is now included in the report
- rotational mode: profit target stop was broken, now it is fixed
CHANGES FOR VERSION 4.46.1 (as compared to 4.46.0)
- scoreNoRotate now works again
- small fix in regarding month boundary handling in "Use local time
for daily compression" mode.
- 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.
- 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)
- New AFL functions
- added NumToStr as synonum of WriteVal (as this
function did not 'write' anything, just returned string)
- added StrToNum( string ) - converts string to
numbe
- 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
- added StrFormat( formatstr, ... ) that performs
sprintf-like formatting and returns string
-
CategoryGetName( category, number) function -
returns name of category (market/group/sector/industry/watchlist)
- CategoryGetSymbols( category, number ) added
- synonym to GetCategorySymbols
-
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.
- 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.
- added new AFL functions for output/file handling (almost exactly like
in C run-time):
-
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)
-
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)
-
fclose( filehandle ); - closes file
-
fputs( string, filehandle ) - puts (writes) string
to file
-
fgets( filehandle ) - gets (reads) string from file
(returns string)
-
feof( filehandle ) - detects end-of-file marker (
gives True - if end of file reached )
- 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
- 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)
- ASCII importer: support for importing unadjusted Yahoo data performing
adjustment on the fly:
- 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.
- new command $ROUNDADJ decimaldigits -
causes split-adjusted prices (see above) to be rounded to 'decimaldigits'
precision. By default no rounding is done.
- 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.
- new command $RAWCLOSE2OI 1 - (off by default)
- causes that OpenInterest field gets assigned CLOSE (raw close)
field value multiplied by 100
- 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)
- score of 999999 is no longer recognized. Use constant scoreNoRotate
instead.
- 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 );
- 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)
- re-entry delay implemented for all kind of stops
- user interface added in the settings for n-bar stops
- ApplyStop function now takes 6 parameters:
ApplyStop( Type, Mode, Amount, ExitAtStop = True, Volatile = False, ReentryDelay
= 0 )
- rotational mode docs moved to this
page
CHANGES FOR VERSION 4.44.1 (as compared to 4.44.0)
- fixed problem with rotational mode, trading price: open
CHANGES FOR VERSION 4.44.0 (as compared to 4.43.2)
-
fixed crash with 'detail mode' and large number of open positions/ranks
used
-
max. in-memory cache size can be set now to 20000 (please note
that this large cache requires lots of RAM (more than 512MB))
-
listview copy to clipboard feature now copies also column header
names
-
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.
// your rules
buy = ...
sel = ...
SetForeign("MSFT", True, True );
e = Equity(); // backtest on MSFT
RestorePriceArrays( True ); // <- should match parameter used
in SetForeign
-
Name(), FullName(), GetExtraData() work well with SetForeign()
(i.e. give foreign name/data instead of currently selected)
-
SetOption("PriceBoundChecking", False ); - disables
checking and adjusting buyprice/sellprice/coverprice/shortprice
arrays to current symbol High-Low range.
-
% profit added to detailed log mode
-
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
-
Auto Analysis/Settings,setting modified "portfolio report
mode: trade list/detailed log" moved to "report" tab
-
Auto Analysis/Settings, rotational mode: added selection of
trade price and trade delay to portfolio settings page
-
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.
-
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)
-
backtester generates now error message when someone attempts
to use buy/sell/short/cover signals in rotational mode
- column headings fixed in AA porfolio backtest report
CHANGES FOR VERSION 4.43.0 (as compared to 4.42.0)
-
Portfolio Optimize mode added
-
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.
-
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"
-
"Allow same day exit (single bar trade)" now affects
Portfolio test too.
-
SetOption() calls affect Portfolio backtest now added:
SetOption("MaxOpenPositions")
SetOption("WorstRankHeld")
SetOption("MinShares")
-
fixed Avg Profit/Loss figures in "all trades" section
of portfolio report
-
added average PERCENT profit/loss figures
-
internal accuracy of calculations of LinearReg, LinRegSlope,
LinRegIntercept, StdErr, TSF raised from 32 bit floating point
to 64 bit floating point
-
fix: rotational trading mode does not enter position when score
is 999999
-
-
-
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)
-
first (incomplete) early beta version of the portfolio backtester
- fixed plot of Null arrays using styleArea
- fixed display problem with % progress in single-stock optimization
- other minor fixes
CHANGES FOR VERSION 4.41.2 (as compared to 4.41.1)
-
now Sum produces values for periods upto and including BarCount,
so Sum( array, BarCount ) gives the value instead of Null
-
fixed problem with saving parameters on exit when the user did
not specify default value for string parameter using ParamStr("name", "")
-
fixed 38-byte memory leak when returning values from user-defined
functions
-
real-time mode: after AFL syntax error commentary AFL editor
is not refreshed until error is fixed and user presses 'apply'
-
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)
-
fixed chart refresh locking that happened when user was drawing some
object and abandonend it by pressing ESC key.
-
View->Refresh and View->Refresh All menus now reset internal
chart refresh lock flag just in case.
-
plugin status is refreshed more often
-
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)
-
TimeFrameSet() now affects result of Interval() AFL function. TimeFrameRestore()
resets it back.
-
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()
-
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)
-
legacy 'stoch()' function removed. Use StochK and StochD instead.
-
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.
-
Pref: Misc: auto-hide timeout field: added check for allowed values
from 1...32
-
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.
-
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
-
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
-
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:
-
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.
graph0 = TimeFrameExpand( TimeFrameCompress( Close,
inWeekly, compressLast ), inWeekly, expandLast );
graph1 = TimeFrameExpand( TimeFrameCompress( Open, inWeekly, compressOpen
), inWeekly, expandFirst );
-
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.
-
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
-
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 );
-
RestorePriceArrays();
restores arrays overwritten by SetForeign/TimeFrameSet
CHANGES FOR VERSION
4.40.3 (as compared to 4.40.2)
-
Stochastic Slow has now separate settings for %K and %D slowing inTools->Preferences->Indicators
-
StochK and StochD AFL functions now provide new parameters for control
over smoothing
StochK( range = 14, Ksmooth = 3 );
StochD( range = 14, Ksmooth = 3, Dsmooth = 3 );
-
other minor fixes
(hangup when rescaling Y-axis in log mode)
(improved display of value labels for very low values)
(Tools->Preferences->Main chart VAP: "none" works again)
-
HTMLView.exe is launched with the file name parameter enclosed in double
quotation marks to ensure correct work even if Windows TEMP path contains
spaces
-
Database Setting dialog now displays approximate number of days refering
to given number of bars selected
-
AmiBroker now warns the user (once) about using non-certified 3rd party
plugins
-
AFL parser now notifies user about missing argument in statement like
Ref(,-4); (missing 1st argument)
-
when error occurs inside commentary formula then error message is displayed
in commentary output window instead of popup error dialog
-
study properties dialog now uses modern color picker
-
added "Troubleshoot" button to crash recovery window that
links to http://www.amibroker.com/troubleshoot.html
CHANGES FOR VERSION
4.40.2 (as compared to 4.40.1)
-
garbage collector improvement: memory allocated by single-argument
math functions
(ABS, ATAN, CEIL, COS, EXP, FLOOR, FRAC, INT, LOG, LOG10, ROUND, SIN, SQRT)
applied to arrays is freed as soon as possible. (Previously it was released
at the formula execution end)
-
added new settings to VAP (Tools->Preferences->Main chart), allow
you to change the style of histogram (line/area fill) and location (on
top of all plots or behind of all plots)
- PlotVAPOverlay now has ability to control style and location
PlotVAPOverlay( lines = 300, width = 5, color = colorGreen, vapstyle = 0
);
where
vapstyle = 0 - right side, area fill, on top of all plots
vapstyle = 1 - left side, area fill, on top of all plots
vapstyle = 2 - right side, lines only, on top of all plots
vapstyle = 3 - left side, lines only, on top of all plots
vapstyle = 4 - right side, area fill, behind all plots
vapstyle = 5 - left side, area fill, behind all plots
vapstyle = 6 - right side, lines only, behind all plots
vapstyle = 7 - left side, lines only, behind all plots
Demo formula (move 'style' slider to see all combinations):
Plot( Close, "Price", colorWhite, styleCandle );
PlotVAPOverlay( Param("lines",300,10,1000,1), Param("width",10,1,99,1),
ParamColor("color", colorDarkBlue), Param("style",0,0,7,1)
);
-
the AA formula is not copied to equity indicator when there is a syntax
error in it
-
added ability to stop parsing of AFL formula on first (syntax) error
(switchable via Tools->Preferences->AFL: Stop parsing on first error)
-
when AFL formula has syntax error, AA does not display warnings about
missing buy/sell variables, because anyway the error has to be corrected
first.
- added protection against overflowing maximum length of indicator title
(now 2048 characters)
-
CHANGES FOR VERSION
4.40.1 (as compared to 4.40.
- added ability to minimize progress window. If progress window is minized
then the window 'owning' it is HIDDEN. So for example if you minimize AA
scan progress window then Automatic analysis window will be HIDDEN. To re-show
simply maximize progress
-
added Volume-At-Price (VAP) histogram chart overlay to price chart added
new settings for VAP to Tools->Preferences->Main price (to turn it
off go to Tools->Preferences : Main chart,
and set "Volume At Price overlay" to "None"
-
added new AFL function
PlotVAPOverlay( lines = 300, width = 5, color = colorGreen, rightside =
False);
that plots Volume-At-Price (VAP) overlay chart.
Please note that there must be at least one regular Plot function in your
formula for this to work, and there can be only one PlotVAPOverlay in one
indicator
Example:
Plot( Close, "Price", colorBlack, styleCandle );
PlotVAPOverlay( 350, 4, colorYellow, True );
Example 2:
Plot( Close, "Price", colorBlack, styleCandle );
PlotVAPOverlay( Param("lines",300,10,1000,1), Param("width",10,1,99,1),
ParamColor("color", colorYellow), Param("mode",0,0,1,1)
);
-
fixed 'X' close button in Param window.
-
Parameters window now shows parameter list in alphabetical order
-
fixed problem with plotting zero values at log scale. Note that Log(
0 ) is minus inifinity and it really can not be plotted, however many people
attempted to plot zero data in log scale, so AMiBroker now adjusts zero
to 0.0001 when log scale is used to allow plotting.
Example faulty code that did not work in 4.40, but works now:
Plot(IIf(Month() != Ref(Month(),-1),1,0),"", color, styleHistogram
| styleOwnScale | styleNoLabel)
-
added new setting to Tools->Preferences : Charting "draw vertical
line between months"
CHANGES FOR VERSION
4.40.0 (as compared to 4.39.0)
- fixed crash when global or local keyword was used elsewhere than on top
of the function definition
- fixed crash that occurred when interpretation code part required more bars
than indicator code part
- fixed handling of 1st hour after midnight in Metastock plugin / intraday
data
- fixed problem with calling the same user-defined function multiple times
in single simple arithmetic expression.
- memory allocated by Equity(0) was freed at the end of the formula execution,
now it is freed immediatelly, making possible to create large loops with
Equity(0) without memory problems. Note that Equity(1) and Equity(2) released
memory immediatelly already.
- when Y-axis grid spacing is lower than or equal to 0.02 then Y axis is
displayed with 4 decimal digits (usefull for currencies)
- logarithmic scaling improved, Y-scale shifting and zooming in log scale
works better too.
- fixed date column formatting when SetOption("nodefaultcolumns",
flag) is switched off and back on
- Param()s in Indicator Builder are set back to defaults only when formula
is edited, setting grid line/scalling options do not reset params.
- time compression algorithm modified, now alignment is available in two
options:
1. align to midnight (00:00:00) 2. align to trading hours START time
and four time stamp display modes:
1. display time of first tick in bar, 2. display time of last tick in bar
3. display start time of interval bar, 4. display end time of interval bar
These settings are available in Tools->Preferences->Intraday
Fixed also problems with alignment occurred in some cases in previous versions.
CHANGES FOR VERSION
4.39.0 (as compared to 4.38.0)
- added Param dialog to AA window. Note that AA-defined parameters are reset
back to defaults only when you LOAD the formula from the file or when you
click on 'Reset' button in Parameter dialog.
- colorAqua now has correct value of 36
- when Printing charts (or using Print Preview ) in Real Time mode,
auto-refresh is temporarily disabled to avoid problems with printing
- fixed problem with non-updating last bar of trade arrays by Equity(1)
applied in exploration when built-in trade delays where greater than zero
- operands of arithmetic expressions are evaluated from left to right again
(as it was in 4.30) so statements like this
(y = 7)*1000 + y;
(note assignment within expression) do not cause error messages about uninitialized
variable
- new feature "Wait for Backfill" in Auto-Analysis window. Causes
scans/explorations/backtests
to wait for the plugin to finish data backfill.
The setting applies to real-time plugins only, and only to those that support
this feature.
- three new versions of plugins that support 'wait for backfill' feature
are included in the beta archive:
eSignal plugin 1.5.0
myTrack plugin 1.5.3
IQFeed plugin 1.3.1
'Wait for backfill' feature is not supported by QT plugin, and it won't be
supported because
QuoteTracker has no interface to allow forcing backfills from 3rd party applications.
- other minor fixes
CHANGES FOR VERSION
4.38.0 (as compared to 4.37.0)
- new setting for candlestick appearance:
Tools->Preferences->Charting
"Use distinct color for" : "None, up candle hollow" -
it plots entire candle with one color but leaves interior of UP candle body
hollow.
- added export chart image to PNG (portable network graphics) file
Edit->Image->Export to PNG file
(Please don't ask me to add GIF support. GIF is patented and requires $3500
license fee for Unisys. PNG is free, supported by all browsers, smaller and
better )
- added 'send chart by e-mail' feature
Edit->Image->Send by email
and
File->Send chart via e-mail
- fixed positioning of arrows in image copies (Edit->Image->Copy)
- fixed crash occurring when printer device context did not support bit
blit copies. added very simple arrow line drawing for that case (will be
improved in future releases)
- fixed bug in handling Null with new constructs: if, while and for.
In pre-4.38 versions Null used in if, while for was treated as True, which
was wrong
if( Null ) _TRACE("WRONG");
else _TRACE("CORRECT");
Now Null in if, while, for is treated as False.
- numbers (floats) are now automatically 'upsized' to arrays on first use
of l-value array subscript operator without causing error.
Also r-value subscript can be applied to numbers and return the number itself
without causing error, but the underlying variable remains just a single
number.
This allows to easily intialize arrays to any value without need to write
loops.
Example 1:
in previous versions you would need to write:
for( i = 0; i < BarCount; i++ ) myarray[ i ] = 0 ; // fill with
zeros
myarray[ 5 ] = 6; // write value to 5th element of the array
now you can write simply:
myarray = 3; // initialize, at this moment myarray is just a number
myarray[ 5 ] = 6; // write value to 5th element of the array, the variable
is automatically
// upsized to array and all elements are filled with a numeric value
// that was originally placed in myarray variable
/* myarray is holds now the array filled with values of 3 except element
5 that has value of 6 */
mynumber = 5;
test = mynumber[ 7 ]; // previous versions would give an error message here
// now subscript operator for r-value numeric variable
// is allowed and returns just the number
// and variable is not upsized to array unless appears on left side
// of assignment (l-value)
/* mynumber variable here is still a number */
WriteVal( test );
CHANGES FOR
VERSION 4.37.0 (as compared to 4.36.0)
- printing improved, now all open indicator panes are printed and resolution
is increased
- Edit->Copy As Image and Edit->Copy As Metafile now generate an
image consisting of all indicator panes (not just one)
- fixed problem with non-resetting sort arrows in AA window
- fixed sometimes occuring crash Signal() function
- increased size of error message text buffer to prevent overflow when
reporting syntax errors in formulas having long unwrapped lines.
- grid lines are drawn with fine dots instead of small dashes (screen
output only)
- new AFL functions:
GetCategorySymbols( category, index )
- retrieves comma-separated list of symbols belonging to given category
supported categories:
categoryMarket categoryGroup categorySector categoryIndustry categoryWatchlist
categoryFavorite categoryIndex
index = (market/group/industry/sector/watchlist number)
0..255 for categoryMarket, categoryGroup, categoryIndustry
0..63 for categorySector, categoryWatchlist
ignored for categoryFavorite, categoryIndex
StrExtract( list, item )
- extracts given item (zero-based) from comma-separated string.
Example:
StrExtract( "MSFT,AAPL,AMD,INTC", 2 )
will return AMD
StrExtract( "MSFT,AAPL,AMD,INTC", 0 )
will return MSFT
StrExtract( "MSFT,AAPL,AMD,INTC", 200 )
will return empty string ""
+ other minor fixes
Example code for GetCategorySymbols and StrExtract:
/* note: if given watch list contains lots of symbols
** performance may be poor
*/
function CreateAverageForWatchList( listnum )
{
// retrive comma-separated list of symbols in watch list
list = GetCategorySymbols( categoryWatchlist, listnum );
Average = 0; // just in case there are no watch list members
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
f = Foreign( sym, "C" );
if( i == 0 ) Average = f;
else Average = Average + f;
}
return Average / i; // divide by number of components
}
Plot( CreateAverageForWatchList( 1 ), "Avg of WL 1", colorGreen
);
CHANGES FOR VERSION
4.36.0 (as compared to 4.35.0)
-
fixed problem with affecting 2 or more identifiers referencing the
same array when using l-value subscript operator []. Thanks Herman
for pointing this out
- global and local keywords - for explicit visibility/scope declarations
Allow to override default scope rules that assume that variables defined
outside function are global, while those identifiers that appear for
the first time inside functions are local.
Syntax:
local var1 [, var2, ... ] ;
global var1 [, var2, ... ] ;
(as you can see you can declare more than one variable in one line.
Note: using these keywords outside function definition has no meaning
(global scope is used).
Example:
VariableA = 5; // implict global variable
function Test()
{
local VariableA; // explicit local variable with the same identifier
as global
global VariableB; // explicit global variable not defined earlier
//
may be used to return more than one value from the function
VariableA = 99;
VariableB = 333;
}
VariableB = 1; // global variable
"Before function call";
"VariableA = " + VariableA;
"VariableB = " + VariableB;
Test();
"After function call";
"VariableA = " + VariableA + " (not affected by function call
)";
"VariableB = " + VariableB + " (affected by the function call
)";
- syntax highligting modified so keywords: #include, if, else, while, do,
function, procedure, global, local, return are colorised differently than
built-in constants or functions. Corresponding color/style setting added
to Preferences->Editor
- #pragma nocache
pre-processor command added to switch off #include file caching mechanism.
Note: between '#pragma' and 'nocache' there must be exactly SINGLE space
Note 2: disabling caching may slow down execution of the formula (especially
in indicators)
Note 3: #pragma nocache must be placed before #includes
Example:
#pragma nocache
#include <myfile.afl>
- single line comments now work with #includes (and #pragma too) so you can
comment out include in regular way:
//#include <something> - will not include
- changed error message from "unknown identifier" to "Variable
'name' used without having been initialized." which better decribes
the problem.
For example:
function Test( )
{
global x;
x = 3;
}
WriteVal( x ); // variable used without having been initialized,
// although declared inside Test() function body
Test( ); // during function call the value of 3 is assigned to variable
x
WriteVal( x ); // and now no error is reported
- implemented shortcut evaluation of logical operators
The operands of logical-AND and logical-OR expressions are evaluated from
left to right. Now if the value of the first operand is sufficient to determine
the result of the operation, the second operand is not evaluated. This is
called short-circuit evaluation.
The left operand of the logical-AND operator is completely evaluated and
all side effects complete before continuing. If the left operand evaluates
to false (0), the other operand is not evaluated.
The left operand of the logical-OR operator is completely evaluated
and all side effects complete before continuing.
If the left operand evaluates to true (nonzero), the other operand is not
evaluated.
(The above description applies to operands that evaluate to single boolean
value,
it does not apply to arrays. Operands that evaluate to arrays are evaluated
always )
Example:
for( i = -3; i < BarCount; i++ )
{
// using old versions of AMiBroker you would get subscipt out of range
// but now
// the second operand (C[ i ] > C[ i - 1 ]) is evaluated
// ONLY if first operand ( i >= 1 ) evaluates to TRUE
if( i >= 1 && C[ i ] > C[ i - 1 ] )
{
_TRACE("TEST " + i);
}
}
CHANGES FOR VERSION
4.35.0 (as compared to 4.34.2)
- do-while loop implemented:
Syntax:
do statement while ( expression ) ;
The expression in a do-while statement is evaluated after the body of the
loop is executed.
Therefore, the body of the loop is always executed at least once.
Example:
i=0;
do
{
i++;
}
while( i < 100 );
WriteVal( i );
- it is now allowed to 'add' (or rather concatenate) string to a number /
array. This saves quite a bit of typing. This works as in JScript. The left-hand
operand of '+' has to be a string. The right-hand operand may be string,
number or array. Numbers are coerced to strings using %g sprintf formatting
(prints out decimal point only when necessary) and then concatenated. In
case of arrays SELECTED VALUE is coerced to string and then concatenated.
So now instead of
i = 100;
"Value is " + WriteVal( i );
"Close : " + WriteVal( Close ) + ", Open : " + WriteVal(
Open ) + ", High : " + WriteVal( High );
you can write:
i = 100;
"Value is " + i;
"Close : " + Close + ", Open : " + Open + ", High : " +
High;
Note that
"Test " + 100 + 1;
will give you "Test 1001" because statements are parsed from left
to right.
"Test " is added first to "100" giving "Test 100" and
then to "1" giving
"Test 1001". If you want to perform numeric adding first please use
braces:
"Test " + ( 100 + 1 );
- this will give you "Test 101"
- additional tweaks in AFL engine & garbage collection, futher speed
up of execution of very long loops
- more error checking in AFL engine - will report using uninitialized variables
that were accepted silently in 4.31.x - 4.34.x
- #include now accepts new way of specifying file names to include:
#include <filename.afl>
(note < > braces instead of " " ) if you specify the file
name this way AmiBroker will look for
the file in "standard include path" that is definable using new
prefs setting in Tools->Preferences->AFL
It makes much shorter to write includes and you can move include folder now
without changing all AFL codes using #includes.
For example if you have set standard include path to "C:\AFL\MyIncludes" and
write in your formula:
#include <common.afl>
AmiBroker will look for C:\AFL\MyIncludes\common.afl
file
Also now #include reports file(s) not found in regular error message box.
- IIf/Min/Max are now overloaded functions (have two variants each)
IIF( Condition_ARRAY, True_Array, False_Array ) (old one)
IIF( BoolValue, TrueValue, FalseValue )
Min( array1, array2 ) (old one)
Min( number1, number2 )
Max( array1, array2 ) (old one)
Max( number1, number2 )
The second one is choosen when all arguments are numbers and it is much much
faster and returns number so LastValue() call is not neccessary anymore.
Example:
// much faster and does not require LastValue()
period = IIF( name() == "MSFT", 5, 10 );
result = Min( 7, 3 );
// (result is still a number not array as in previous versions)
- added 'endless loop detection threshold' setting to Preferences "AFL" tab.
Recommended value 100000 or higher.
- fixed parameter counting in CallFunction plugin callback in case of overloaded
functions
- fixed problem with premature freeing of arrays passed in default parameters
fields (causing for example problem with color exploration output - introduced
in 4.32)
CHANGES FOR VERSION
4.34.2 (as compared to 4.34.0)
- improved crash recovery dialog to include AFL engine state information
and (in some cases) the source line of the formula that causes an exception
- added ability to catch all exceptions in indicators and commentaries (switchabel
via Tools->Preferences->AFL, "catch system exceptions...",
ON by default) - allows you to continue to work even in case of serious problem
- loop break by Shift+BREAK is now more sensitive
- now you can control how often Shift+BREAK key is checked during formula
execution (Tools->Preferences->AFL, "check SHIFT+Break every" (1..100,
default = 50) (note that specifying low values may degrade performance slightly)
- tweaked AFL memory allocator hash tables to get more speed for large looping
formulas
- although I never reproduced this problem I made some changes so 'TAB' key
should not wipe the contents of AFL editor anymore
CHANGES FOR VERSION
4.34.0 (as compared to 4.33.0)
- user-definable functions
and procedures with parameters and local variables
- 'A' is NO LONGER predefined
symbol. I decided to remove it because people tend to use A as user-variable
forgetting the fact that it was build-in array holding typical price (H+L+C)/3. Use
'Avg' instead.
- indicator list column width increased in Indicator Builder
- DayOfYear - returns the calendar day number counting from beginning of
the year January 1st is 1. Maximum number returned is 366
CHANGES FOR VERSION
4.33.0 (as compared to 4.32.2)
- Database purify tool implemented (available via Tools->Database Purify)
allows to detect missing/extra quotes, possible splits, invalid OHLC relationship
Apply to/range settings similar to AA window. You can also right click over
result list to add symbols to watch list and copy the list to the clipboard
(and paste it later to any other program for futher use)
- further improvements to AFL garbage collector, now looping regardless of
loop count requires the same amount of memory as just single pass of the
code (no growing allocated memory during loops).
This enormously lowered memory consumption for some formulas and increased
the speed of some loops 3..4 times.
- added variable period support to the following functions:
LinRegSlope,
LinearReg,
LinRegIntercept,
StdErr,
TSF
Sample code:
Plot( Close, "Test", colorBlack );
range = 15 * MA( ATR( 15 ), 50 ) / ATR( 15 );
//Plot( range, "range", colorBlue, styleOwnScale );
Plot( LinearReg( Close, range ), "Test", colorRed );
-
fixed sometimes incorrect output of variable-period version of LLV/HHV
-
fixed crash occuring when bad arguments were passed to the function (bug
introduced in 4.32.x).
CHANGES FOR VERSION
4.32.2 (as compared to 4.32.1)
- second bug in experimental garbage collector fixed.
CHANGES FOR VERSION
4.32.1 (as compared to 4.32.0)
- garbage collector was releasing memory too soon in some cases, now fixed.
CHANGES FOR VERSION
4.32.0 (as compared to 4.31.1)
- added type check in IF/ELSE statements
- added type check in array element assignment
- error messages now numbered and display changed slightly
- you can break running loop by pressing Shift+BREAK (Pause) key combination
- calling COM objects works again (was broken in 4.31.x)
- changed slightly the way TAB works in editor, if TAB is pressed any selection
is deselected to avoid accidential deletion of text
-
experimental: added 'agressive garbage collector' that extremely
decreases the amount
of memory required to run AFL formula by releasing the memory
used for temporary variables as soon as possible (previously
temporary memory was released at the end of formula execution).
A side-effect of new garbage collector is some speed up in formula execution.
- new tab in preferences for AFL engine settings
-
experimental feature, NOT for beginners, may be removed/modified in
future releases:
new _TRACE( "string" ) AFL function added
that allows to write debug messages from AFL code to system debug viewer.
(it calls internally OutputDebugString Win API function).
To view debug messages you have to run DebugView freeware program
from http://www.sysinternals.com/
CHANGES FOR VERSION
4.31.1 (as compared to 4.31.0)
- fixed bug introduced in 4.31.0 causing no text output in commentary/interpretation
CHANGES FOR VERSION
4.31.0 (as compared to 4.30.0)
- Workspace window uses "icon font" set in the Windows settings
instead of hard coded Tahoma 8
- for better readability and ClearType(tm) compatibility on WinXP, all dialog
windows use now 'MS Shell Dlg' face name that maps to standard MS Sans Serif
on Win 9x/Me/NT and Tahoma on Win 2K and XP.
- rewritten AFL parser, now formula is parsed and coverted to syntax tree
and then interpreted. This would allow further improvements including compilation.
This allowed also to add loops/if-else statements.
- implemented IF/ELSE statement, WHILE and FOR loops:
The same basic 'for' loop in AFL is 2..3 times faster than in JScript
Syntax follows C++/JScript style:
while( conditional_expression ) statement;
for( initializer_part; conditional_expression; iterator_part ) statement;
if( conditional_expression ) statement;
if( conditional_expression )
statement;
else
statement;
-
implemented compound statements: these are blocks of statements enclosed
in opening and closing curly brace
{
statement1;
statement2;
...
statementN;
}
compound statement can appear anywhere when simple statement can.
For example:
i = 10;
while( i < 20 )
{
Plot( MA( Close, i ), "MA" + WriteVal( i, 0 ), colorBlack + i
);
i = i + 1;
}
-
implemented C-style postfix and prefix increment/decrement operators
i = 10;
WriteIf( i++ );
WriteIf( ++i );
WriteIf( i );
-
implemented array element access (subscript) operator []:
WriteVal( Close[ 0 ] ); // prints the first bar of close array
/* a sample low-level implementation of exponential moving average
in AFL */
myema[ 0 ] = Close[ 0 ];
for( i = 1; i < BarCount; i++ )
{
myema[ i ] = 0.1 * Close[ i ] + 0.9 * myema[ i - 1 ];
}
-
added built-in constant 'BarCount' that returns number of bars available
in arrays (the number of elements of array)
When QuickAFL is turned on it may be less than true number of bars because
QuickAFL feature attempts to use only visible bars (and few before). You
can control how many bars the formula requires using SetBarsRequired()
function
-
implemented infinite-loop protection. Nice if you forgot to increment
counter variable in 'for' loop :-)
-
tab key now works without need to press ALT/CTRL in AFL editors
-
added C-like synonyms for logical ADD/OR/NOT: &&, ||, !
/* a sample low-level implementation of Profit-target stop in AFL:
*/
Buy = Cross( MACD(), Signal() );
priceatbuy=0;
for( i = 0; i < BarCount; i++ )
{
if( priceatbuy == 0 && Buy[ i ] )
priceatbuy = BuyPrice[ i ];
if( priceatbuy > 0 && SellPrice[
i ] > 1.1 * priceatbuy )
{
Sell[ i ] = 1;
SellPrice[ i ] = 1.1 * priceatbuy;
priceatbuy = 0;
}
else
Sell[ i ] = 0;
}
/* sample EMA rainbow */
Plot( Close, "Price", colorBlack, styleCandle );
for( Range = 15; Range < 100; Range++ )
Plot( EMA( Close, Range ), "MA"+WriteVal(Range,0),
colorRose + Range % 8, styleNoLabel );
CHANGES FOR VERSION 4.30.0 (as compared to 4.29.9)
- implemented workaround to Windows XP scroll bar bug.
(http://groups.yahoo.com/group/amibroker/message/35446)
(we disable scroll bar when chart is zoomed out to the max to prevent scroll
bar locking on WinXP)
- Chart: ScrollPageLeft (default assignment: PAGEUP key), ScrollPageRight
(default: PAGEDN), ScrollToBegin (default: HOME), ScrollToEnd (default: END)
available in Keyboard shortcut editor, Fixed ScrollLeft, ScrollRight
- fixed problem with not updating Param dialog when using 2 sheets with single
pane per sheet.
CHANGES FOR VERSION 4.29.9 (as compared to 4.29.8)
- added key shortcuts for range mark begin (F12), end (Shift+F12), hide (Ctrl+F12)
(they are also available in Keyboard editor so assignments can be changed)
- chart scroll left/right are now accessible from keyboard editor (ChartScrollLeft,
ChartScrollRight)
- if type-in is selected from the main menu then watch list selector dialog
is displayed.
- fixed sometimes wrong sort when many explorations were run one after another
with some non-numeric columns.
- Study() works correctly even when trendline is drawn past the last available
data bar.
CHANGES FOR VERSION
4.29.8 (as compared to 4.29.7)
- updated param info for LastValue, MarketID, GroupID, SectorID, IndustryID
to match the AFL reference
- decreased delay time for baloon tooltip (status bar area)
- fixed hang of Windows XP when AmiBroker tried to display the tooltip while
AB was minimized. (cause of crash of WinXP when QT was closed before AB)
- infinite numbers are printed now as {INF}, not-a-numbers are printed as
{NAN} by WriteVal.
For example:
" 1/0 =" + WriteVal((1/0));
" 0/0 =" + WriteVal(0/0);
" (1/0) / (1/0) =" + WriteVal((1/0)/(1/0));
" 1 / (1/0) =" + WriteVal( 1 / ( 1 / 0 ) );
" Null =" +WriteVal(Null);
- 3 new AFL functions:
a) IsNan( x ) - returns a nonzero value (1 or TRUE) if the argument x is
a NaN; otherwise it returns 0 (FALSE).
A NaN is generated when the result of a floating-point operation cannot be
represented in Institute of Electrical and Electronics Engineers (IEEE) format
Example:
IsNan( 0/0 );
b) IsFinite( x ) - IsFinite returns a nonzero value (1 or TRUE) if its argument
x is not infinite,
that is, if –INF < x < +INF. It returns 0 (FALSE) if the argument
is infinite or a NaN.
Example:
IsFinite( 1/0 );
c) Nz( x ) - Null (Null/Nan/Infinity) to zero
You can use the Nz function to return zero, or another specified value when
argument x is Null or Nan or Infinite.
For example, you can use this function to convert a Null (empty) value to
another value and prevent it from propagating through an expression. If the
optional valueifnull argument is included,
then the Nz function will return the value specified by that argument if
the x argument is Null (or Nan or Infinity).
You can use the Nz function as an alternative to the IIf function.
Instead of:
varTemp = IIf( IsFinite( (H-L)/(C-L) ), (H-L)/(C-L), 0 );
You can write:
varTemp = Nz( (H-L)/(C-L) );
- added IsNull() function - it is the synonym to IsEmpty()
CHANGES FOR VERSION 4.29.7 (as compared to 4.29.6)
- added "ask to save changed data" option to Prefs->Misc page
(if it is unchecked AmiBroker saves data without asking)
- Symbol -> WatchList ->Import now accepts all formats of .LST files
from Quotes Plus
- fixed crash when backward ref bar number was too high
- date axis drawing modified (should address 'missing oct 2001' problem)
- fixed crash when using extreme zoom in factors (via Zoom to range) and
scrolling max to the right so only blank area is visible.
- added check for neg. # of contracts
- Apply in Indicator Builder does not scroll to the top
- other minor fixes:
CHANGES FOR VERSION
4.29.6 (as compared to 4.29.5)
-
WriteVal has now new
parameter 'separator' that controls if the number
should be formatted with thousand separator or not:
WriteVal( ARRAY, format = 8.3, separator = True )
WriteVal( Volume, 8.3, True ); // with separators
WriteVal( Volume, 8.3, False ); // without separators
- thousand separator is not added to numbers in AA->Export
- thousand separator does not appear when using
AddColumn( DateTime(), formatDateTime );
- fixed inconsistency between AA result line (incorrect) and AA report (correct)
when formula was using
SetOption("InitialEquity", nn) to change the Init. equity set in
the AA settings
(thanks Herman)
- fix: % change is displayed again in RT quote window.
- fix: watch list dialog (watch list->remove) does not show lists above > 32
if given symbol does not belong to given watch list.
- new AFL function: GetChartID() allows to retrieve current indicator chart
ID. (returns 0 (zero) in AA window)
- other minor fixes
CHANGES FOR VERSION
4.29.5 (as compared to 4.29.1)
- fixed crash in AFL editor that occured when selecting all text and choosing
right mouse button -> copy
- auto-scaling changed slightly
- user-definable thousand separator (in Tools->Preferences->Misc) applied
automatically to all list views and indicators and WriteVal function
- definable number of decimal places in RT quote window (Tools->Prefs->Misc)
- watch-list related functions: (available from context menu in tree and
Symbol->Watch list menu)
- quick type-in symbols into watch list
- import/export watch list from/to .LST file and from/to plugin (ext. database
only for plugins that support this feature. The first one will be FT plugin)
- context menu is displayed over selected watch list (click with right mouse
button on the watch list name in the Workspace window)
- 'dirty' flag is set properly after moving/sizing the study
- Amibroker again displays message box asking to save changes. (this is useful
to undo some unwanted changes but it works only for most recent 'in-memory'
symbols (see Tools->Preferernces->Data))
- fixed the case when Preferences has log scale switched OFF but Indicator
Builder has "log scale" turned ON for Price chart.
CHANGES FOR VERSION
4.29.1 (as compared to 4.29.0)
- data tooltips now show study ID and coordinates and point/percent change
from start to end when you hover the mouse pointer over the trend line or
other study
- from-to range selector implemented just double click on chart to mark begin
and then double click in other place to mark end of the range. > and < markers
will appear above date axis. To delete the markers double click again in
the same place where vertical line is positioned.
- From-to selected range can be referred from the AFL level via new functions
BeginValue( ARRAY )
EndValue( ARRAY )
- these functions give the single value (number) of the ARRAY at the beginning
and end of the selected range. If no range is marked then they return the
value at the first bar and last bar respectively.
Example:
WriteVal( BeginValue( DateTime() ), formatDateTime );
WriteVal( EndValue( DateTime() ), formatDateTime );
"Precentage change of close is " +
WriteVal( 100 * (EndValue( Close ) - BeginValue( Close ))/BeginValue( Close
) ) + "%";
- WriteVal function now handles formatDateTime
WriteVal( DateTime(), formatDateTime );
- Zoom to range implemented (View->Zoom->Range) or hold down both SHIFT
and CTRL and click on green zoom in toolbar button (zooms to selected from-to
range)
CHANGES FOR VERSION
4.29.0 (as compared to 4.28.1)
- context help in AFL editor - just press F1 when cursor is over AFL reserved
function name and it will display full information about that function
- param info/fun reference available also from context menu
- fixed bug in Study function working improperly for trendlines with right
extend property
- tab order fixed in Study properties box
- usability: "Filter pre/after hours" is available now from View->Intraday
menu
- new AFL function:
Now( format = 0 ) returns current date / time in numerous of formats:
format = 0 - returns string containing current date/time formatted according
to system settings
format = 1 - returns string containing current date only formatted according
to system settings
format = 2 - returns string containing current time only formatted according
to system settings
format = 3 - returns DATENUM number with current date
format = 4 - returns TIMENUM number with current time
format = 5 - returns DATETIME number with current date/time
See: http://www.amibroker.com/guide/afl/afl_view.php?name=NOW
- new drawing tool: Triangle
- new drawing tool: Andrews' Pitchfork
- Gann Square tool does not draw controlling trenline during move/resize
- added check that prevents freeing memory by Equity(1) function when this
memory is referenced by other variables
- added Layer combo to the Text properties box
- added link to AFL on-line reference to the Help->AmiBroker on the Web
menu.
- switching layers does not cause unnecessary symbol tree refresh
- added switch to AA Settings->Report tab that allows to turn off optimization
warning (that is displayed if optimization requires more than 300 steps)
- other minor fixes.
CHANGES FOR VERSION
4.28.1 (as compared to 4.28.0)
- fixed problem with missing some short trades when new flag "Reverse
entry signal forces exit" was turned off
- Null is now highlighted and present in the auto-complete box.
- fixed numeric sorting of colorized columns
CHANGES FOR VERSION
4.28.0 (as compared to 4.27.1)
- ApplyStop has one more parameter
ApplyStop( Type, Mode, Amount, ExitAtStop, Volatile = False )
new Volatile parameters decides if amount (or distance) (3rd parameter) is
sampled at the trade entry and remains fixed during the trade (Volatile =
FALSE - old behaviour) or if can vary during the trade (Volatile = TRUE)
Allows single-line implementation of Chandeliers exit:
ApplyStop(stopTypeTrailing, stopModePoint, 3*ATR(14), True, True );
- ApplyStop handles new N-Bar stop - exits the trade after N bars.
Type = stopTypeNBar; /* = 3 */
Mode = stopModeBars; /* = 1 */
ApplyStop( stopTypeNBar, stopModeBars, 5 ); // exits trades on 5th
bar since entry
- added new "Reverse entry signal forces exit" check box to the
Backtester settings.
When it is ON (the default setting) - backtester works as in previous versions
and closes already open positon if new entry signal in reverse direction
is encountered. If this switch is OFF - even if reverse signal occurs backtester
maintains currently open trade and does not close positon until regular exit
(sell or cover) signal is generated.
In other words when this switch is OFF backtester ignores Short signals during
long trades and ignores Buy signals during short trades.
- added "Allow same bar exit (single bar trade)" option to the
Settings
When it is ON (the default settings) - entry and exit at the very same bar
is allowed (as in previous versions)
if it is OFF - exit can happen starting from next bar only (this applies
to regular signals,there is a separate setting for ApplyStop-generated exits).
Switching it to OFF allows to reproduce the behaviour of MS backtester that
is not able to handle same day exits.
- long trades now take precedence over short trades so if signals happen
on the same bar in both directions only long trade is taken.
- new AFL functions:
DateTime() - returns array of encoded date/time values suitable for using
with
AddColumn and formatDateTime constant
to produce date time formated according to your system settings
AddColumn( DateTime(), "Date / Time", formatDateTime );
new formatChar constant allows outputting single ASCII character codes:
Example (produces signal file accepted by various other programs):
Buy=Cross(MACD(),Signal());
Sell=Cross(Signal(), MACD());
Filter=Buy OR Sell;
SetOption("NoDefaultColumns", True );
AddColumn( DateTime(), "Date", formatDateTime );
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
- new AFL functions continued:
BarIndex() - returns zero-based bar number -
the same as Cum(1)-1 but it is much faster than Cum(1) when used in Indicators
SetOption( "name", value )
- sets various options in automatic analysis settings currently available
options are
"NoDefaultColumns" - if set to True - exploration does not have default
Ticker and Date/Time columns
"InitialEquity"
"AllowSameBarExit"
"ActivateStopsImmediately"
"AllowPositionShrinking"
"FuturesMode"
"InterestRate"
- if you overwrite AA settings via SetTradeDelays/SetOption
backtest report gives these actual values instead of originaly set in the
settings
- new Null constant is equal to -1e10 (empty value) so you can use it instead
enigmatic -1e10
obsolete styleLog removed (logarithmic scale setting is not per-line but
per-pane and it is selectable from Indicator Builder)
- added PlotGrid( level, color = colorDefault ) function that plots grid
line using built-in dotted style.
- fixed problem with QuoteEditor that was introduced with adding color support
to the list view
- added support for Win XP common controls 6, which results in enhanced XP-look
(on WinXP only of course)
- fixed zero-size problem with floating control bars on Windows XP
- fixed some compatibility issues with common controls 6.
- added sound when plugin status changes
- fixed problems with Review window sometimes not showing the results
- value label drawing changed slightly
- status bar adjusted so plugin state is visible on smaller displays
- improved windows version checking for bug reports
CHANGES FOR VERSION
4.27.1 (as compared to 4.27.0)
- fixed problems with
auto-complete and param info features appearing on certain Windows versions
CHANGES FOR VERSION
4.27.0 (as compared to 4.26.0)
Intellisense-like functionality in AFL editor
- auto-completion feature in AFL editor type a few letters and press Ctrl+SPACE
and the number of matching functions / reserved words will be displayed
- parameters-info tip, type function name and opening brace ( and you will
see the tip that shows information about required parameters
- two new checkboxes Preferences->Editor control Auto-completion / parameter-info
features
- fixed exception occuring when optimizing systems that generate zero trades
(very rare case)
- AlertIF called from the custom indicators sometimes displayed wrong date/time
- now it is fixed
- when fixup = 1 Foreign() is able to align array past the last foreign bar.
For example when using intraday data you can refer to imported EOD data and
it will fill intraday data with last value from previous day.
CHANGES FOR VERSION
4.26.0 (as compared to 4.25.0)
- List view sorting speed increased significantly:
- sorting of text columns is 2 times faster (on average)
- sorting of numeric column is 5-10 times faster ( sort 660'000 items
within 2-3 seconds on 1GHz machine)
- Explorations now support definable color of cell text and background
AddColumn and AddTextColumn functions extended to support this feature:
AddColumn( Array, "Title", format = 1.2, textColor = colorDefault,
bkgndColor = colorDefault );
AddTextColumn( "Text", "Title", format = 1.2, textColor
= colorDefault, bkgndColor = colorDefault );
New colorDefault constant (-1) defines default windows color for grid cell.
Sample code:
Filter =1;
AddColumn( Close, "Close", 1.2 );
AddColumn( MACD(), "MACD", 1.4 , IIf( MACD() > 0, colorGreen,
colorRed ) );
AddTextColumn( FullName(), "Full name", 77 , colorDefault, IIf(
Close < 10, colorLightBlue, colorDefault ) );
-
custom indicators - anchors are not offset vertically from the ends of
the trend line when Draw dates is selected
-
custom indicators with auto-scaling can be now dragged in Y-direction
like regular charts
-
Foreign and RelStrength algorithm improved to allow more complex alignment
cases
- PlotShapes works even without any Plot statement (although it is intended
to use in conjunction with Plot)
- fixed line disappearing bug that occured when using text tool right after
trend line tool
- Dec is displayed again on date axis
CHANGES FOR VERSION
4.25.0 (as compared to 4.24.0)
- support user-definable parameters:
new AFL functions
Param( "name", default, min, max, step )
ParamStr( "name", "default" );
ParamColor( "name", defaultcolor );
new Parameters dialog : right click over chart pane and select "Parameters" or
press Ctrl+R
allows to change chart parameters - changes are reflected immediatelly
Sample code 1:
ticker = ParamStr( "Ticker", "MSFT" );
sp = Param( "MA Period", 12, 2, 100 );
PlotForeign( ticker, "Chart of "+ticker, ParamColor( "Price
Color", colorLightYellow ), styleCandle );
Plot( MA( Foreign( ticker, "C" ), sp ), "MA(" + WriteVal(
sp, 1.0 ) + ")", ParamColor( "MA Color", colorRed )
);
Sample code 2:
sp = Param( "RSI Period", 12, 2, 100 );
r = RSI( sp );
Plot( r, "RSI("+WriteVal(sp,1.0)+")", ParamColor("RSI
Color", colorRed ) );
Buy = Cross( r, 30 );
Sell = Cross( 70, r );
PlotShapes( shapeUpArrow * Buy + shapeDownArrow * Sell, IIf( Buy,
colorGreen, colorRed ) );
- added missing ':' and '"' characters to the forbidden characters set
in file names generated from ticker names. All file-system reserved characters
are converted to underscore.
- ticker symbol maximum length increased to 25 characters (from previous
15).
(these two fixes above solve problem with using very long symbols like
- default keyboard accelerators changed Ctrl+R is now for Parameters dialog
F5 is for Refresh
- fixed calculation bug occuring when drawing objects in the blank chart
area ("jumping" effect)
- new method in Quotations collection for faster retrieval of quotes
long Retrieve( long Count, Variant *Date, Variant *Open, Variant *High, Variant
*Low, Variant *Close, Variant *Volume, Variant *OpenInt );
- on Windows Me, 2000 and XP all file dialogs now feature "Places" bar
and allows to select few recent file names from the combo
- date axis display modified slightly (3 letter month abbrev. used more often
- changed resizing algorithm so if "no min size for resizing dialog" option
is selected the scroll bar of list / edit is always visible. Also the option
is active from the start without need to go to Preferences.
- other minor improvements
CHANGES FOR VERSION
4.24.0 (as compared to 4.23.0)
- saving/loading Automatic Analysis settings to/from the file
- Axis font now can be made bold/italic/underline
- Text drawing tool uses axis font now
- full control over AA window via new OLE/COM interface:
Analysis object (accessible via Broker.Application.Analysis)
Methods:
- Backtest(); - runs backtest
- Explore(); - runs exploration
- Scan(); - runs scan
- Optimize(); - runs optimization
- bool Report( FileName: String ) - saves report to the file or displays
it if FileName = ""
- bool Export( FileName: String ) - exports result list to CSV file
- bool LoadFormula( FileName: String ) - loads AFL formula
- bool SaveFormula( FileName: String ) - saves AFL formula
- bool LoadSettings( FileName: String ) - loads backtest settings
- bool SaveSettings( FileName: String ) - saves backtest settings
- ClearFilters() - removes all filters
Properties:
- long ApplyTo - defines apply to mode: 0 - all stocks, 1 - current stock,
2 - use filter
- long RangeMode - defines range mode: 0 - all quotes, 1 - n last quotes,
2 - n last days, 3 - from-to date
- long RangeN - defines N (number of bars/days to backtest)
- DATE RangeFromDate - defines "From" date
- DATE RangeToDate - defines "To" date
- Filter( nType: short, Category : String ) - sets/retrieves filter setting
nType argument defines type of filter 0 - include, 1 - exclude
Category argument defines filter category:
"index", "favorite", "market", "group", "sector", "index", "watchlist"
Examples
ClearFilters(); // clear all filters first
Filter( 0, "index" ) = 1; // include only indices
Filter( 1, "market" ) = 2; // exclude 2nd market
Full Example for Windows Scripting Host:
========================================
/* create AB object */
AB = new ActiveXObject("Broker.Application");
/* retrieve automatic analysis object */
AA = AB.Analysis;
/* load formula from external file */
AA.LoadFormula("afl\\macd_c.afl");
/* optional: load settings */
// AA.LoadSettings("the_path_to_the_settings_file.abs");
/* setup filters */
/* backtest over symbols present in market 0 only (zero-based number) */
AA.ClearFilters();
AA.Filter( 0, "market" ) = 0;
/* set apply to and range */
AA.ApplyTo = 2; // use filters
AA.RangeMode = 0; // use all available quotes
/* run backtest and display report */
AA.Backtest();
AA.Report(""); // empty file name means display report
CHANGES FOR VERSION
4.23.0 (as compared to 4.22.1)
- chart axis font can be defined by the user. The default is now Arial,
9pt.
(Tools->Preferences->Miscellaneous: "Axis font")
- Undo feature added to AFL editor.
- PlotShapes now supports offset (or distance) parameter (by default -12
), Offset is expressed in SCREEN pixels.
Negative offsets shift symbols down, positive offsets shift symbol up. To
place the shape exactly at ypostion, specify 0 as offset.
PlotShapes( shape, color, layer = 0, yposition = graph0, offset = -12 );
- yet another bug fixed that caused problems with drawing lines when multiple
windows were showing same symbol but different intervals.
- if Y-value is less than 1000 the status bar displays four decimal places
, also bar number is displayed in the status bar (next to date/time)
- Insert Indicator window (Ctrl+I) does not show empty indicator slots anymore.
CHANGES FOR VERSION
4.22.1 (as compared to 4.22.0)
- fixed overwrite problem occuring when deleting first indicator in the
list in Indicator Builder
- fixed shortcut conflict &File and &Format. Now Format menu has
Alt+o shortcut
- other minor fixes
- added constants for shapes
"shapeNone", 0
"shapeUpArrow", 1
"shapeDownArrow", 2
"shapeHollowUpArrow", 3
"shapeHollowDownArrow", 4
"shapeSmallUpTriangle", 5
"shapeSmallDownTriangle", 6
"shapeHollowSmallUpTriangle", 7
"shapeHollowSmallDownTriangle", 8
"shapeUpTriangle", 9
"shapeDownTriangle", 10
"shapeHollowUpTriangle", 11
"shapeHollowDownTriangle", 12
"shapeSmallSquare", 13
"shapeHollowSmallSquare", 15
"shapeSquare", 17
"shapeHollowSquare", 19
"shapeSmallCircle", 21
"shapeHollowSmallCircle", 23
"shapeCircle", 25
"shapeHollowCircle", 27
"shapeStar", 29
"shapeHollowStar", 31
"shapeDigit0", 33
"shapeDigit1", 35
"shapeDigit2", 37
"shapeDigit3", 39
"shapeDigit4", 41
"shapeDigit5", 43
"shapeDigit6", 45
"shapeDigit7", 47
"shapeDigit8", 49
"shapeDigit9", 51
"shapePositionAbove", 1
Example:
PlotShapes( IIF( buy, shapeDigit9 + shapePositonAbove, shapeNone ), colorGreen
);
CHANGES FOR VERSION
4.22.0 (as compared to 4.21.1)
- changes made in Indicator Builder are not lost if formula is incorrect
- instead error message is displayed and formula is saved even if it has
a syntax error
- if currently displayed indicator formula has an error - the error message
does not pop up in a separate window but is displayed in the indicator pane.
- empty indicators are not displayed in the Indicator Builder and new buttons "Add", "Delete" are
provided to add new indicator and remove existing
- when drawing or moving drawing objects the auto-refresh of the chart is
temporarily held to solve problems with drawing on RT charts.
- Symbol->Information window is not reset every 3 sec when working with
RT data.
- interval between chart updates is now configurable (Preferences->Intraday)
- Random( seed = none ); function takes new parameter seed.
If seed is defined it initializes the seed of random number generator this
allows to produce repetitive series of pseudo-random series. If seed is
not specified - random number generator continues generation.
To reinitialize the generator, use 1 as the seed argument. Any other value
for seed sets the generator to a random starting point.
Example 1:
Graph0 = Random(); // generates different sequence with each refresh
Example 2:
Graph0 = Random(1); // generates the same sequence with each refresh
- new AFL function
PlotShapes( shape, color, layer = 0, yposition = graph0 );
that allows to plot arrows and other shapes on any chart.
Parameters:
-
shape defines type of the symbol. when shape is zero nothing
is plotted
values other than zero cause plotting various pre-defined shapes.
Odd values plot shape BELOW indicator, even values plot shape ABOVE indicator.
-
color defines color of shape
-
layer defines layer number on which shapes are plotted
-
yposition defines Y-position where shapes are plotted (by default
they are plotted 'around' graph0 (first indicator) line)
Currently defined shapes are
UP ARROW = 1, (below indicator)
DOWN ARROW = 2, (above indicator)
HOLLOW UP ARROW = 3, (below)
HOLLOW DOWN ARROW = 4, (above)
SMALL UP TRIANGLE = 5, (below)
SMALL DOWN TRIANGLE = 6, (above)
HOLLOW SMALL UP TRIANGLE = 7, (below)
HOLLOW SMALL DOWN TRIANGLE = 8 , (above)
UP TRIANGLE = 9, (below)
DOWN TRIANGLE = 10, (above)
HOLLOW UP TRIANGLE = 11, (below)
HOLLOW DOWN TRIANGLE = 12, (above)
SMALL SQUARE = 13, (below)
SMALL SQUARE = 14, (above)
HOLLOW SMALL SQUARE = 15, (below)
HOLLOW SMALL SQUARE = 16,
SQUARE = 17, (below)
SQUARE = 18, (above)
HOLLOW SQUARE = 19, (below)
HOLLOW SQUARE = 20, (above)
SMALL CIRCLE = 21, (below)
SMALL CIRCLE = 22, (above)
HOLLOW SMALL CIRCLE = 23, (below)
HOLLOW SMALL CIRCLE = 24,(above)
CIRCLE = 25, (below)
CIRCLE = 26, (above)
HOLLOW CIRCLE = 27, (below)
HOLLOW CIRCLE = 28, (above)
STAR = 29, (below)
STAR = 30, (above)
HOLLOW STAR = 31, (below)
HOLLOW STAR = 32, (above)
NUMBER 0 = 33, (below)
NUMBER 0 = 34, (above)
NUMBER 1 = 35, (below)
NUMBER 1 = 36, (above)
NUMBER 2 = 37, (below)
NUMBER 2 = 38, (above)
NUMBER 3 = 39, (below)
NUMBER 3 = 40, (above)
NUMBER 4 = 41, (below)
NUMBER 4 = 42, (above)
NUMBER 5 = 43, (below)
NUMBER 5 = 44, (above)
NUMBER 6 = 45, (below)
NUMBER 6 = 46, (above)
NUMBER 7 = 47, (below)
NUMBER 7 = 48, (above)
NUMBER 8 = 49, (below)
NUMBER 8 = 50, (above)
NUMBER 9 = 51, (below)
NUMBER 9 = 52, (above)
Demo formula:
Graph0=MACD();
Graph1=Signal();
Buy=Cross(Graph0, Graph1);
Sell=Cross(Graph1, Graph0);
PlotShapes( ( Buy OR Sell ) * ( 1 + Cum( Buy OR Sell ) % 52 ), IIf( Buy,
colorGreen, colorRed ), 5 );
GraphXSpace = 5;
CHANGES FOR VERSION
4.21.1 (as compared to 4.21.0)
- AddToComposite marks symbol as dirty so timestamp added in the full name
is stored properly.
- "Align custom minute bars to regular market hours" works OK now
even if filtering is OFF
- new methods added to COM interface in 4.21.0 caused incompatibility with
AmiQuote because of changed numbering of methods. Now it is fixed so AmiQuote
auto-import works again with 4.21.1
- fixed display of watch list >32 in the workspace tree
- fixed possible hangup when attempting to draw objects when currently selected
layer is hidden
CHANGES FOR VERSION
4.21.0 (as compared to 4.20.8)
- layers implemented (layers is a well-know concept in every decent painting/drawing/CAD
package now it is available to traders for (AFAIK) the first time in technical
analysis program)
- increased number of watch lists (to 64 watch lists) and sectors (to 64
sectors) (note that broker.workspace file once saved with new version can
not be read back with previous versions)
- max. number of bars in File->Database Settings increased to 500'000.
- ASCII importer: added $STRICT 1 mode it checks if Open, High, Low prices
are greater than zero
- COM/OLE interface:
new property Broker.Application.DatabasePath
new method: Broker.Application.LoadDatabase( Path )
new method: Broker.Application.SaveDatabase()
Example VBScript code (Windows Scripting Host):
Set oAB = CreateObject("Broker.Application")
WScript.Echo( "Current path to database is " + oAB.DatabasePath
)
if oAB.LoadDatabase("c:\program files\amibroker\data")
= True then
WScript.Echo( "succesfully loaded new database" )
end if
WScript.Echo( "Current path to database is " + oAB.DatabasePath
)
oAB.SaveDatabase()
CHANGES FOR VERSION
4.20.8 (as compared to 4.20.7)
- fixed #include command (CR/LF pair handling)
- #include now displays error message in the status bar ifincluded file can
not be found
- when calling function defined in script AFL does not convert the method
name to lowercase
- filtering after hours works also for EndTime < StartTime case (usefull
for users from Far East tracking US exchanges)
- fixed bug causing crash on custom indicators using Study() with QuickAFL
enabled
- protection against crash when the user tries to plot negative values on
semi-log scale
- new AFL function: GetDatabaseName - gives the name of the database - the
last part (folder) of the database path
- other minor fixes
- new myTrack plugin
- removed (c) text (4.20.8.3431)
CHANGES FOR VERSION
4.20.7 (as compared to 4.20.6)
- fixed crash occuring on exit on Windows XP (CRegistry class - free() )
- fixed problem with saving keyboard editor settings on Win2k
- fixed problem with different ordering of tickers when case sensitivity
is turned on (symbol array is re-sorted on change and re-sorted after loading
master file)
- added one more safety check for non-existing directory when saving layout
CHANGES FOR VERSION
4.20.6 (as compared to 4.20.5)
- possible bug with AFL editor fixed (streamin)
- "space" problem in AFL editor fixed
- fixed bug with switching databases
- fixed crash occuring when user specified non-existing pen
- fixed bug in monthly view display (29.02.2000)
- fixed bug in File->Save database As (into blank directory)
- fixed title of built-in volume pane
- ROC function accepts additional parameter that defines how negative
values are handled. ROC( array, periods = 12, absmode = False )
if absmode = False the value returned is array - ref( array, -periods )/ref(
array, -periods )
if absmode = True the value returned is array - ref( array, -periods )/abs(
ref( array, -periods ) )
- QuoteTracker plugin now accepts also . (dot) as a date separator
- myTrack plugin startup routine improved
CHANGES FOR VERSION
4.20.5 (as compared to 4.19.0)
- Regression channels calculate percent distances (instead of point) when
drawn on log-scale chart
- plugin receives now Workspace information via Plugin notification function
- Zoom All - includes now blank bars
- zoom factor and date selection are now independent for each window in multiple-window
setup
- moving of vertical lines is now easier (4 pixel "hot" area instead
of 1 pixel)
- styleBar gives normal bars instead of thick
- new menus Help->Search (invokes help in search mode) and Help->Read
Me - displays read me.
- custom n-tick intervals appear also in chart context menu
- deleted databases are removed from MRU list
- fixed handling of case sensitive tickers when working with local database
(4.20.2)
- AddToComposite resets OHLCVI values correctly (when flag=1) even if using
"dynamic" symbols
for composites. (4.20.3)
- composite symbol is reset properly even if flused out of in-memory cache
(4.20.5)
- when $ALLOWNEG is NOT specified in the ASCII importer definition AmiBroker
performs the following range checking and fixup on open, low and high prices
if( open == 0 ) open = close;
if( high < max( open, close ) ) high = max( open, close );
if( low == 0 ) low = min( open, close ); (4.20.5)
- other minor fixes
CHANGES FOR VERSION
4.19.0 (as compared to 4.18.0)
- minor other fixes
fixed bug with date/time axis
tree is refreshed after AddtoComposite used in Backtest/Exploration
- right-hand axis zone is now mouse moveable/sizable:
hover the mouse over right axis and you will see that cursor changes to up/down
arrow.
now you can click and drag up/down Y axis,
when you press down SHIFT you can scale Y axis by moving your mouse
when you double click in the right axis area Y axis zoom and position will
be reset
- as mouse operation is superior toolbar buttons taller/shorter buttons are
removed (moved to View->Zoom menu)
- View->Profile is back in the "View" toolbar
- implemented new drawing tools:
- Raff regression channel
- Standard error channel
- Standard deviation channel
(all available from Insert->Regression Channel and new toolbar button)
CHANGES FOR VERSION
4.18.0 (as compared to 4.17.0)
- fixed too long chart title text bug
- fixed scroll bar thumb sizing
- RMB->Copy in AA result list works again
- better keyboard operation in AA window (window does not loose focus after
Check/Load AFL rules)
- minor fixes / changes
changed date axis min skip step from 4 to 5
added case sensitive check in few more places when Pref.CaseSensitiveTickers
is ON
intraday interval saved in layouts is properly restored
- Real time quote window: DEL works now again
- can now display different N-tick bars for the same symbol
- fixed bug in Status('firstbarinrange') that occured if range exceeded number
of quotes
- tooltips are protected against displaying more than 25 lines of text (prevents
flashing)
- OLE automation application.RefreshAll is asynchronous now
- charts are always refreshed after scan using AddToComposite (even if composite
ticker already exists)
- 'From' date in AA now works as expected in intraday mode
- Profile view is refreshed when View->Profile is choosen
- new profile template fields {s} - gives ticker symbol in lowercase
{S} - gives ticker symbol in UPPERCASE (the old {t} - gives ticker symbol
in the orignal case
(as typed in Information window)
- Categories window saves edits in Profile URL without any extra clicks
- AddToComposite has 2 new flags that allow running AddToComposite in backtest/optimization
mode and exploration mode
atcFlagEnableInBacktest = 8
atcFlagEnableInExplore = 16
- the following constants were added for readability of formulas using AddToComposite:
atcFlagResetValues = 1
atcFlagCompositeGroup = 2
atcFlagTimeStamp = 4
atcFlagEnableInBacktest = 8
atcFlagEnableInExplore = 16
atcFlagDefaults = atcFlagResetValues | atcFlagCompositeGroup | atcFlagTimeStamp;
- shorter/taller bars (compress/expand Y axis) option added on numerous requests
(note that this is temporary solution - better one will come, so please don't
ask me to change this because it will be changed anyway)
CHANGES FOR VERSION
4.17.0 (as compared to 4.16.0)
- added Gann Square and Gann Fan drawing tools with customisation dialogs
(angle of line is displayed in the status bar)
- added parallel trend line tool
- studies can be dragged without "shrinking" effect beyond upper
and lower chart border and beyond left and right border (but within available
quotation range plus right margin)
- New toolbar buttons for ray (right-extend line) and extend (left and right)
lines
- Format toolbar controls (color, thick, dotted) change selected drawing style
& color
- snap to price was not accurate in v4.15-4.16 now it is accurate again
- snap to price now works in "magnet" mode - so it snaps only if
cursor is within 5% distance to high/low price. Snap % threshold is definable
in Preferences/Charting
- usability improvement: even when "return to select mode after drawing"
is ON, you can draw mutliple studies one after another quickly if you hold
down CTRL key while releasing the button.
- usability improvement: you can now draw objects with OR without holding
left mouse button pressed while drawing.
- drawing object is now automatically selected when "return to select
mode after drawing" is ON and "auto-select last drawn object"
is also ON. This makes it easier to delete/copy/cut or see its properties
(Alt+Enter) immediatelly.
- #include can now be written also in upper case
- some UI clean-up:
- added "Format" menu just to conform with MS recommendations
for user interface,
- moved "snap to price" to Format menu and moved "Erase
watch lists" to "Symbol" menu.
- "Snap to price" now available from toolbar. Right and left
extend available from Format menu.
- Added "Properties" and "Delete all" to "Edit"
for consistency
- "Quotations..." has been renamed to "Quote Editor"
and toolbar icon has been changed
- certain rarely used toolbar icons from "main toolbar" were
removed to save space (Add/Delete/Split Symbol - regular menu is more
appropriate for that operations)
- X-coordinate display pane in status bar enlarged to accommodate time also
- added "Copy Image as Metafile" option to Edit menu. Metafile is
a vector format so you can resize copied picture without distortion. (useful
for creating documents that are printed later)
- Quote Editor (QE) improvements:
- you can now delete quotes in QE - select one or more quotes from the
list (SHIFT/CTRL to multi-select) and press "Delete" button
- QE made several times faster displaying 20'000 bars in "current"
symbol mode takes about 2 seconds now.
- now tickers can be case-sensitive. This is useful if you want to treat.
ABC and ABc as different symbols. Tools->Preferences "Miscellaneous"
: "Case sensitive ticker symbols"
USE WITH CARE AS CERTAIN PLUGINS (eSignal plugin for example) DO NOT HANDLE
CASE SENSITIVITY
CHANGES FOR VERSION
4.16.0 (as compared to 4.15.1)
- completely re-designed Fibonacci retracement tool allowing full customization
and more flexibility. Just draw a Fib retracement and double click on it (or
choose Edit->Properties). Customization dialog is available on "Fibonacci"
tab.
- new setting in Tools->Preferences->Charting "Select quote only
by CTRL+LMB" -
if marked quote selection is accessible only via double click or single click
WITH CTRL key depressed (v4.15 style).
if unmarked quote selection is possible via single click (old style)
- trend line properties dialog moved to property sheet for consistency.
CHANGES FOR VERSION
4.15.1 (as compared to 4.15.0)
- fixed bug with date axis display that appeared in 4.15.0
- fixed problem with moving/sizing objects when multiple windows were open
- removed "Move/Size" toolbar button:
now editing/moving/sizing is enabled by default in regular "Select"
mode (arrow cursor) the old functionality (pick quotation) is available if
you hold down CTRL key while clicking once on the chart or by double click
on a chart while not being over an object. Double click over object - shows
properties.
- added "Return to select mode after drawing" option in Tools->Preferences->Charting
- when it is switched ON (by default) - right after drawing any object it
is available for moving/sizing/deletion.
CHANGES FOR VERSION
4.15.0 (as compared to 4.14.0)
- moving and sizing of drawing objects (see new "Move/Size" button
in draw tool bar)
- cut/copy/paste/delete of drawing objects (Edit menu and standard shortcuts,
need to mark object first in Move/Size mode)
- blank space in the right-hand side of the chart for drawing future trend
line projections
- moved charting related preferences setting to new tab "Charting"
- new setting for number of blank bars in right margin (Charting tab)
CHANGES FOR VERSION
4.14.0 (as compared to 4.13.1)
- fixed problem with creating new databases that occurred on certain MSVCRT
versions
- styleOwnScale adjusts Base level for histogram and area style back to minvalue
or zero whichever is less
- Plot, PlotOHLC and PlotForeign have 2 additional parameters for specifying
fixed minimum and maximum values for Y-axis
Note that new parameters work only when styleOwnScale is used:
Plot( array, title, color, style = styleLine, min = {empty}, max = {empty}
)
PlotOHLC( open, high, low, close, title, color, style = styleLine, min= {empty},
max = {empty} )
PlotForeign( ticker, title, color, style = styleLine, min= {empty}, max =
{empty} )
New parameters make it easy to plot ribbons, for example:
Plot( Close, "Price", colorBlue, styleCandle );
Plot( 2, /* defines the height of the ribbon in percent of pane width */
"Ribbon",
IIf( up, colorGreen, IIf( down, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
It also makes it easy to plot 2 or more "own scale" plots with
the same scaling:
minimum = LastValue( Lowest( Volume ) );
maximum = LastValue( Highest( Volume ) );
Plot( Close, "Price", colorBlue, styleCandle );
/* two plots below use OwnScale but the scale is common because
we set min and max values of Y axis */
Plot( Volume, "Volume", colorGreen, styleHistogram | styleThick
| styleOwnScale, minimum, maximum );
Plot( MA( Volume, 15 ), "MA volume", colorRed, styleLine | styleOwnScale,
minimum, maximum );
- fixed date axis display for custom intraday intervals longer than 60 minutes
- "dirty" flag is set properly now during ASCII import in $OVERWRITE
1 mode (solves import watch list problem)
- when switching layouts ticker bar selection is now synchronized with active
window
- after AA->Scan Foreign symbol cache is flushed
- now styleLeftAxisScale really allows modification of built-in price chart
to feature moving average of volume
// Now plot volume and its moving average using left-hand axis scaling
Plot( Volume , "Volume", colorBlue, styleLeftAxisScale | styleHistogram
| styleThick | styleNoLabel );
Plot( MA( Volume,15), "MAV", colorLightBlue, styleLeftAxisScale
| styleNoLabel );
- ASCII importer and Import Wizard now allows to import negative prices (useful
for spreads). New command is $ALLOWNEG 1 and new check box in Import Wizard
is "allow negative prices". Please note that logarithmic scale can
NOT be used to display negative prices because log() function is undefined
for negative values.
- four new AFL functions:
- LinRegIntercept( ARRAY, periods )- calculates intercept of linear regression
line the "a" coefficient
in a + b*x (LinRegSlope calculates b)
- LinearReg( ARRAY, periods )- calculates linear regression line ending
value according to
a + b * x (where a and b are intercept and slope of linear regression
line)
- StdErr( ARRAY, periods )- calculates standard error function (standard
error of linear regression estimate) - the same as MS' STE function
- TSF( ARRAY, periods ) - calculates time series forecast indicator (similar
to LinearReg but differs by
the value of lin reg slope)
CHANGES FOR VERSION
4.13.1 (as compared to 4.13.0)
- F4 key for Edit | GoToSymbol works again and can be redefined in the shortcut
editor
- new style: styleLeftAxisScale = 65536 - allows to plot more than one graph
using common scaling but different from regular (right axis) scale.
Example: price plot plus volume and moving average plot:
// Plot price plot and its moving average
Plot( Close, "Price", colorWhite, styleCandle );
Plot( MA( Close, 20 ), "MAC", colorRed );
// Now plot volume and its moving average using left-hand axis scaling
Plot( Volume , "Volume", colorBlue, styleLeftAxisScale | styleHistogram
| styleThick );
Plot( MA( Volume,15), "MAV", colorLightBlue, styleLeftAxisScale
);
(in one of the future betas you will be able to display ruler for
left-hand axis)
CHANGES FOR VERSION
4.13.0 (as compared to 4.12.0)
- fixed bug with loading layouts for stocks that have spaces in the ticker
symbol
- new pre-defined shortcut keys: Alt+Left = Next symbol, Alt+Right = Prev
symbol,
Ctrl+NumPadPLUS = Zoom In, Ctrl+NumPadMINUS = Zoom Out,
Ctrl+PageUp = Prev Sheet, Ctrl+PageDown = Next Sheet
- new keyboard shortcut editor in Tools->Preferences->Keyboard allow
user-definable keyboard shortcuts
- fixed display bug in Preferences->Intraday that caused rounding to full
hours custom bar intervals of more than 60 minutes
- Layouts->Save As does not generate duplicate entries in the tree when
already existing name is typed in (it was harmless but still not nice)
- A confirmation box is displayed when choosing Edit->Delete session
- fixed problem with incorrect interval shown in the settings section of the
report when hourly periodicity was selected
- new style: styleOwnScale = 32768 allows plotting graphs with independent
scalling (like volume graph on price plot)
- implemented PlotForeign("ticker", "title", color, style
= styleCandle | styleOwnScale )
- implemented PlotOHLC( open, high, low, close, "title", color,
style = styleCandle | styleOwnScale ) that allows plotting candlesticks/bars
from other arrays without need to overwrite existing OHL arrays.
CHANGES FOR VERSION
4.12.0 (as compared to 4.10.3)
- color coded and multi-line caption bars in indicators
colors are selected automatically when using Plot() function or graphNcolor
variable.
If you use Title variable you have to specify colors in the string.
Colors can be specified using \\cXX sequence where XX is 2 digit number specifying
color index \\c38 - defines violet, there is a special sequence \\c-1 that
resets to default axis color.
For example
Title = "This is written in \\c38violet color \\c27and this in green";
You can also use new AFL function that makes it easier. Function is called
EncodeColor( colornumber ).
And you can write the above example like this:
Title = "This is written in " + EncodeColor( colorViolet ) + "violet
color " + EncodeColor( colorGreen ) + "and this in green";
Multi-line caption is possible by simply embedding line break \n, for example:
Title = "This is 1st line\nThis is second line";
- new layout handling code:
- you can now have unlimited number of
custom, multiple-window templates that can be switched between with just
double click on layout name in the "Layouts" tab of the Workspace
window
- you can open/save/delete layout by clicking on the Layout tree with
right mouse button and choosing appropriate function. "Save As"
option saves current layout under new name.
- Local layouts are per-database while Global layouts are visible from
all databases.
- information saved in layouts include: window sizes and postions, maximized/minimized
state chart panes available on each sheet (independent for each window),
selected bar interval, selected symbol, selected chart sheet
- Most recently used layout can be saved on exit and database switch automatically
(see: Tools->Prefs->Miscellaneous "Save on exit: Layouts")
- old single-window layouts are now renamed to "templates"
- CCIa( array, period ) function added - works like CCI but accepts input
array instead of working on (C+H+L)/3
- implemented a *very* basic pre-processor with single command #include that
allows to include external AFL files into your formula. Syntax:
#include "path\to my file\name path.afl"
Note 1: include statement need SINGLE backslashes in the path (this is quite
the opposite to normal AFL sting
parsing)
Note 2: using #include command may slow down formula execution even
considering the fact that AmiBroker tries to include only once and cache pre-processed
text
Note 3: that currently no error message is given if #include fails and this
code
is experimental.
Note 4: nesting #include commands is not supported
- balloon tooltips for status bar
- color-coded plugin status pane in the status bar, plus pop-up balloon notifications
when connection state changes
- ability to link custom menu to the plugin status pane - new QT plugin (beta)
provides Connect/Shutdown options thru such menu.
- data plugins receive UNLOAD notification correctly
- you can sort columns in Quotation Editor by click on column header
- layout of Quick Review window changed to allow smaller window size.
- Intraday settings dialog allows wider time shift -23..+23 hours
CHANGES FOR VERSION
4.10.2 (as compared to 4.10.1)
CHANGES FOR VERSION
4.10.1 (as compared to 4.10.0)
- Equity() function now accepts range type = -2
Equity( 0, -1 ) - calculates Equity using current date range settings while
Equity( 0, -2 ) - calculates Equity using the most recent backtest settings
(this mode is now used by built-in equity chart to avoid affecting Equity
chart
by scans/explorations done after backtesting using different range)
- -10000000000.00 in chart caption is replaced by {EMPTY}
- fixed problem selection bar sometimes disapearing
- fixed ALIAS field handling by ASCII importer
- other minor fixes
CHANGES FOR VERSION
4.10.0 (as compared to 4.09.0)
- fixed small COM memory leak when calling methods in COM objects
- column widths and ordering in Real time quote window is saved between sessions
- other minor fixes
CHANGES FOR VERSION
4.09.0 (as compared to 4.08.2)
- enhanced backtester:
+ support "Futures" mode that use contract PointValue and Margin
for calculations
+ support for Round Lot Size allows you to tell backtester to use user-defined
round lots
+ support for TickSize - now built-in stops exit trades only at "allowed"
price levels
+ new commission type "$ per share/contract"
+ improved commission/position size calculation
- added following fields to trade list: number of shares/contracts, position
value, entry, exit prices, % price change, cum. profit, # bars in trade, profit
per bar
- report now includes new settings (margin req, futures mode, def. round lots,
tick size)
- Symbol->Information window allows to specify PointValue, Margin, Round
Lot Size and Tick Size on symbol-by-symbol basis
- OLE automation interface: added four new properties to Stock object: PointValue,
MarginDeposit, RoundLotSize, TickSize
- ASCII Importer handles now the following additional fields in $FORMAT command:
ALIAS, MARGIN, POINTVALUE, ROUNDLOTSIZE, TICKSIZE
- double click on entry in the Alert output window displays the chart.
- Buy&hold formula in built-in equity chart modified (positionsize=-100)
to allocate 100% of funds in B&H
(if you modified your formula you may need to add positionsize=-100 to get
correct buy-and-hold equity (100% funds invested))
CHANGES FOR VERSION
4.08.2 (as compared to 4.08.0)
CHANGES FOR VERSION
4.08.0 (as compared to 4.07.4)
- Metastock importer: group/watch lists assignments and full name is overwritten
even if symbols are already present in the database ASCII and Metastock importers
now allow to import "foreign" data to databases using external data
sources (via plugin). This is done by marking newly added symbols as using
local database only. (Note that this does NOT affect symbols already present
in the database - otherwise you would break symbols that are provided by the
plugin) (Note 2: in case of ASCII importer this does NOT work if NOQUOTES
mode is selected - this is because people sometimes use importer to import
just symbols (watch lists))
- new chart style styleArea - draws filled area chart
- Equity chart draws also buy-and-hold equity.
- Equity chart is user-definable, you can even add interpretation code to
equity chart (use Indicator Builder to modify equity formula. Please note
that equity chart code contains of your AA formula actual Equity line plotting
code. To modify equity chart you should edit code below //--equity-plot line.
Code above that line is replaced by AmiBroker after backtest.
- Status function supports six new fields:
"firstbarinrange" and "lastbarinrange". They return 1
(or True) on the first/last bar of analysis range.
"buydelay", "selldelay", "shortdelay", "coverdelay"
return delays set in the Settings window
- GraphZOrder variable allows to change the order of plotting indicator lines.
When GraphZOrder is not defined or is zero (false) - old ordering (last to
first) is used, when GraphZOrder is 1 (true) - reverse ordering is applied.
- point commissions are not taken when positionsize is set to zero.
- new SetTradeDelays( buydelay, selldelay, shortdelay, coverdelay ) function
allows to overwrite delays set in the Settings from the AFL code.
- fixed problem that occurred when using cover=buy; short=sell; statement
AND multiple Equity(1) statements AND ApplyStop()s in one AA formula.
CHANGES FOR VERSION
4.07.4 (as compared to 4.07.3)
- fixed bug causing sometimes crash when Interpretation window was open,
QuickAFL was enabled
- fixed problem occuring when Nth greater than 1 was used with PeakBars, TroughBars
- 'Check' feature in AA window does not consider Equity() function as referencing
future
CHANGES FOR VERSION
4.07.3 (as compared to 4.07.2)
- fixed bug causing crash when LastValue() was used and QuickAFL enabled
- reduced memory usage of AFL when evaluating expressions like expr1 (operator)
expr2 when one of expr is a number (scalar) and another variable is an array
- reduced memory usage of Equity() function
CHANGES FOR VERSION
4.07.2 (as compared to 4.07.1)
- fixed bug causing crash when using formula with Equity() function and QuickAFL
enabled
- fixed bug causing crash when using variable-period HHV,LLV functions and
QuickAFL enabled
- fixed invisible short/cover arrows problem (arrows are shifted into visible
area now if there is not enough space)
- overlaid indicators re-evaluate number of bars required to calculate formula
so for example longer averages added to main chart via custom AFL formula
are plotted correctly for all bars
- new Status() fields "range...." now work also in Scan and Exploration
modes
- text columns in Explorations are sorted correctly by click on the header
CHANGES FOR VERSION
4.07.1 (as compared to 4.07.0)
- Equity plot does not generate alerts anymore
- SOUND command works now (previously only PLAY was working). Additionally
an error message is displayed in the status bar when something goes wrong
with playing the audio alert. Please note that you should use \\ (double slashes)
in the paths in AlertIF function
- small bug fix in displaying Data tooltips and QuickAFL enabled
CHANGES FOR VERSION
4.07.0 (as compared to 4.06.1)
- help window is detached from application window
- arrows generated by commentary window are refreshed properly when new rt
bars arrive (arrows are shown for active symbol only)
- e-mail alerts: support for servers requiring SMTP authentication. Supported
methods:
AUTH LOGIN (most popular), POP3-before-SMPT (popular), CRAM-MD5, LOGIN PLAIN
- sound alerts: ability to test sound output in Tools->Preferences->Alerts
- AFL error box popping up in AA when RT data are flowing does not cause a
crash
- custom minute bar compression improved - now you can have >60 minute
bars and also bars not evenly dividing the hour. So you can have 39 or 73
minute bars for example
- drawing date/time axis improved
- drawing built-in charts optimized for very long histories
- new AFL functions:
+ Interval() returns bar interval in seconds
+ RMI( periods = 20, momentum = 5 ) - Altman's Relative Momentum Index (S&C
Feb 1993)
+ Status() function features new fields:
"rangefromdate", "rangetodate" - return current auto-analysis
From-To range as DateNums
"rangefromtime", "rangetotime" - return current auto-analysis
From-To range as DateNums
"barinrange" - returns 1 when current bar is within current auto-analysis
From-To range
"barvisible" - (custom indicators only) returns 1 when current bar
is visible in current view
note: this should be used only if you really have to, indicator should be
written without need to know how it is displayed
+ LastValue has new optional parameter
LastValue( array, forcelastbar = 0 );
forcelastbar - changes the behaviour of LastValue when used in Commentary
or Interpretation windows. By default it uses selected value, but if you
use LastValue( array, True ) then it always use last bar instead of selected
one.
+ SelectedValue( array )
- selection bar updates caption in all chart panes (displaying current values
of all indicators). you can move selection-bar with <- and -> cursor
arrows on keyboard as before but now when you reach left most or right most
bar- the chart starts to scroll automatically
- quote selection and caption display works different now: if selection-bar
is NOT visible
then the last VISIBLE bar data are displayed (not the LAST available), if
selection-bar visible then selected bar data are displayed
- new graph style = 8192
- plots point-and-figure-style O and X symbols instead of candlesticks
High and Low table are used to determine the height of bar,
Close-Open distance determines box size. If Close > Open - X's are drawn
if Close < Open - O's are drawn.
- added bitwise-and '&' and bitwise-or '|' operators to AFL language (note
that floating point number are converted (truncated) to integers before applying
bitwise operators)
- new pre-defined constants for more descriptive code
CHANGES FOR VERSION
4.06.1 (as compared to 4.06.0)
- fixed tab order in Analysis window (Range radio buttons) (appeared in 4.06beta)
- fixed problem with using AFL.Var with uppercase letters (appeared in 4.06beta)
- fixed problem with using gSite.SetVariable / gSite.GetVariable with uppercase
letters (appeared in 4.06beta)
- fixed problem with exploration (appeared in 4.06beta)
- fixed small display issue in the data tooltips (-1e10 displayed instead
of {EMPTY})
- disabled QuickAFL until all issues are resolved
CHANGES FOR VERSION
4.06.0 (as compared to 4.02.1)
- New Interpretation window (View->Interpretation) displays chart-sensitive
commentaries
- new AlertIF function allows to generate visual, sound, e-mail alerts. It
also allows to launch any external program on signal generated by AFL formula.
- Automatic Analysis window now allows periodical scans (Scan every n minutes)
- new Check feature in Automatic Analysis window allowing you to find out
if your formula references future quotes or not.
- Data tips show indicator values now and can show also interpretations of
indicators
- n QuickAFL technology implemented (Tools->Preferences->Miscellaneous
-> Enable QuickAFL for indicators) - provides >10x speed-up in custom
indicator charting with long histories (>1000 bars)
- ability to modify / overlay additional graphs over built-in charts (Indicator
Builder->Built-in tab)
- ability to create your own interpretation commentaries in Indicator Builder
- new AFL functions:
- AlertIf( BOOLEAN_EXPRESSION, command, text, type = 0, flags = 1+2+4+8,
lookback = 1 );
- SetBarsRequired( backward, forward= -1) - overwrites heuristic guessing
algotithm used by QuickAFL technology. Allows to specify the number of
previous (backward), and future (forward) quotes required by the formula
to properly calculate - for advanced users only
- GetBaseIndex() - retrieves symbol of base index as defined in Symbol->Categories.
To plot base security chart just use graph0 = Foreign( GetBaseIndex(),
"C" );
- EnableTextOutput( flag ) - enables output of strings into commentary
/ interpretation window. When flag = 0 no string is printed into commentary
window, 1 - strings are printed
- _N( text ) - the function that prohibits writing the values of assignment
of string variables: _N( text = "this is a text" ); this does
not print out the text being assigned into commentary window.
- filtering weekends (File->Database Settings->Intraday settings->Filter
weekends)
- Commentary and Interpretation window are automatically refreshed when charts
are refreshed
- OLE automation Quotation.Date (GetDate) includes time also
- AFL engine symbol lookup optimized so AFL engine initializes 2x faster and
symbol lookup is also faster
- when scrolling zoomed-out chart (that displays more than 2048 data bars)
the refresh is delayed a little. This makes scroll bar more responsive and
it takes much less to scroll to desired position when working with >100000
bars.
CHANGES FOR VERSION
4.02.1 (as compared to 4.02.0)
- added automatic ruin stop that closes all trades loosing more than 99.96%
CHANGES FOR VERSION
4.02.0 (as compared to 4.01.0)
- added ability to filter after-hours trading (File->Database Settings->Intraday
settings : Filter after-hours box plus definable session start/end (per-workspace
settings)
- added ability to shift time displayed on charts/dialogs File->Database
Settings->Intraday settings : Time Shift (AmiBroker uses computer local
time, so it displays realtime quotes using the time of the timezone you are
in. For example if you live in Warsaw - NYSE-quotes stocks will start 15:30
local (Warsaw) time. If you want however to display time as it is in New York
(-6 hours -> 9:30) you have to set Time Shift to -6.
- fixed problem with importing very long intraday histories > 300000 bars
(if you want to import that long histories you have to go to File->Database
Settings and change "Default number of bars" to at least 3000)
- fixed a bug in intraday -> daily time compression
- fixed "no trade list" display of Exposure and RAR
- when writing the formula to HTML report < and > characters are encoded
to < and > to ensure that formula is not truncated.
- "Apply" button in Indicator Builder inserts/modifies the custom
indicator only if the formula is correct. This avoids continuously displayed
error messages when working with real time streaming data.
- fixed bug in list view sorting of numeric columns containing small values
- fixed crash occuring when Equity() function was called from Commentary window
- fixed display of huge numbers in the chart grid
- added option to color up/down (traditional) bars : Preferences -> Main
chart
- other minor fixes
CHANGES FOR VERSION
4.01.0 (as compared to 4.00.0)
- Customisable N-tick
charts in Real Time version (see Preferences -> Intraday tab) and new View->Intraday
menu
- Ability to backtest custom N-tick bars
- Backtester now makes better decisions on desired order of execution of signals
that occur the same day. (if both buy and sell (or short and cover) signals
occur on the very same bar and there is already open trade from the any of
the previous bars this open trade is closed first, and a new trade is opened
next. Otherwise the usual order (buy first then sell) is used.
CHANGES FOR VERSION
4.00.0 (as compared to 3.99.2)
- ASCII importer now handles also HMM time format (in addition to HHMM)
- file dialogs store its most recently used directory properly again (not
one level higher)
- other minor changes
CHANGES FOR VERSION
3.99.2 (as compared to 3.99.0)
- fixed bug occuring on exit when no document window was open
- double click on ticker tree displays a chart window if no window was open
- Foreign() function does not show error message box if referenced symbol
does not exits in the database - instead it returns {EMPTY_VAL}
- user text holds on chart again (fix to the bug induced by 3.97)
- caption of weekly bar shows friday as end date in "show bar begin time"
mode
- focus switches back to AFL editor on AFL error in AA/Indicator Builder windows
- backtester checks if high and low prices are different than zero
- before trying to adjust buy/sell/short/coverprice arrays to high-low range.
In normal case this was not the case but if you were backtesting composite
equity (you should not but...) which has only close array != 0 you got Profit
N/A and other strange numbers in previous version (this was really user-error,
you should not include composite equity tickers in the backtest because it
makes no sense)
- by default AddToComposite function adds new tickers to market 253 (instead
of 0) now
- fixed bug in handling points-only mode by Equity function
- fixed predefining of BuyPrice/SellPrice/ShortPrice/CoverPrice arrays in
Ind. Builder
- obsolete controls removed from Preferences/Data tab
- some RT improvements (3.99.1)
CHANGES FOR VERSION
3.99.0 (as compared to 3.98.1)
- Equity function has new syntax
SYNTAX:
Equity( Flags = 0, RangeType = -1, From = 0, To = 0 );
where
NEW PARAMETER
Flags - defines the behaviour of Equity function
0 : (default) Equity works as in 3.98 - just calculates the equity array
1 : works as 0 but additionally updates buy/sell/short/cover arrays so
all redundant signals are removed exactly as it is done internally by the
backtester
plus all exits by stops are applied so it is now possible to
visualise ApplyStop() stops.
2 : (advanced) works as 1 but updated signals are not moved back to their
original positions
if buy/sell/short/cover delays set in preferences are non-zero
Note: this flag is documented but in 99% of cases should not be used in your
formula.
Other values are reserved for the future.
RangeType, From, To - arguments as described in v3.98
Example:
Buy = High > Ref( HHV( High, 20 ), -1 );
Sell = 0;
ApplyStop( 1, 1, 5, 1 );
Equity( 1 );
exit is made only by apply stop, thanks to new equity(1)
you can see sell arrow generated by ApplyStop
- in Automatic analysis window you are now able to display buy/sell/short/cover
arrows for ALL actual trades (a new option is available from right mouse button
menu over the result list,
and via double click + ALT key)
- Backtester now reports the type of stop that exited the trade (max loss),
(profit), (trail) - are added to mark trades that were closed by max. loss
stop, profit target stop and trailing stop respectively.
You can also mark your own reasons for exit by assigning numerical value
to sell, cover arrays:
1 - means normal exit, 2 - max loss, 3- profit target, 4-trailing stop,
5 - 9 reserved for future use (other types of built-in stops.
10 and above - custom exits labelled by Long (n) or Short(n) where n is a
number > 10
Example:
cond1 = Cross( EMA( Close, 20 ), Close );
cond2 = Cross( Signal(), MACD() );
Buy = Cross( MACD(), 0 );
Sell = IIf( cond1, 10, IIf( cond2, 11, 0 ) );
- new AFL function:
ExRemSpan( Array, NumBars )
FUNCTION:
Removes excessive signals that span NumBars bars since initial signal.
(In other words first non-zero bar passes through, then all subsequent non-zero
bars are ignored (zero is returned) until NumBars bars have passed since initial
signal. From then on a new signal may pass through)
This function makes easy writing exits after a fixed number of bars, for example
if you want to sell always 5 bars after the buy you should now use combination
of ExRemSpan and Ref(). It will work even if initial buy array has lots of
redundant signals:
Buy = 1;
Buy = ExRemSpan( Buy, 5 );
Sell = Ref( Buy, -5 );
- some minor bug fixes
CHANGES FOR VERSION
3.98.1 (as compared to 3.98.0)
- fixed "freezing" problem when AmiBroker was re-launched with
an empty Equity chart
- equity graph is plotted correctly even if your system uses graph/Plot statements
- previously saved AA settings are restored at the application startup so,
Equity plots use correct settings without the need to re-open AA window.
CHANGES FOR VERSION
3.98.0 (as compared to 3.97.1)
-
Equity() function implemented
SYNTAX:
Equity( RangeType = -1, From = 0, To = 0 );
where
RangeType - defines quotations range being used:
-1 : (default) use range set in the Automatic analysis window
0 : all quotes
1 : n last quotes (n defined by 'From' parameter)
2 : n last days (n defined by 'From' parameter)
3 : From/To dates
From : defines start date (datenum) (when RangeType == 3) or "n"
parameter (when RangeType == 1 or 2)
To: defines end date (datenum) (when RangeType == 3) otherwise ignored
datenum defines date the same way as DateNum() function as YYYMMDD
where YYY is (year - 1900)
MM is month
DD is day
December 31st, 1999 has a datenum of 991231
May 21st, 2001 has a datenum of 1010521
FUNCTION:
returns Equity line based on buy/sell/short/cover, **price, all apply stops,
and all other backtester settings.
NOTES:
All these parameters are evaluated at the time of the call of Equity function.
Complete equity array is generated at once. Changes to buy/sell/short/cover
rules made after the call have no effect. Equity function can be called multiple
times in single formula.
EXAMPLE USAGE:
buy = your buy rule;
sell = your sell rule;
graph0 = Equity();
- automatic Equity plot (Automatic Analysis window -> click on Equity button
(after backtesting))
- BuyPrice, SellPrice, ShortPrice, CoverPrice, PositionSize variables are
predefined also in the Indicator Builder (no "undefined identifier"
error in IB)
- AA scan mode displays also short/cover signals now
- Value Label is not displayed when graph has {EMPTY} value
- new graphNstyle value = 4096 - don't draw value label for this graph line
- immediate refresh after bars are received from eSignal plugin
- eSignal plugin now works with afterhours data (FormT)
- new docking windows (supporting multiple windows in one row) + renamed window
titles
- an option to automatically tile mutliple chart windows
- zoom out toolbar button added
- hourly/intraday periodicity toolbar buttons added
- fixed positionsize handling for short trades it is now checked at short
signal (not cover as before)
- other fixes
CHANGES FOR VERSION
3.97.1 (as compared to 3.97.0)
- value labels do not overlap (greetings to AmiBroker group:-)
- value labels text is written in white or black depending on the brightness
of the label
- vertical line should be visible much better
- fixed problem with overwriting OHLC price arrays in AFL formula
CHANGES FOR VERSION
3.97.0 (as compared to 3.95.0)
- Realtime Market watch (RT only) window implemented (disabled when data plugin
is not RT-enabled) + internal improvements for RT handling
- UNDO for Drawing tools implemented (Ctrl+Z, or Edit->Undo)
- StrLeft( string, count ), StrRight( string, count ), StrMid( string, start,
count ) AFL functions implemented
- improvements to AddToComposite function:
- AddToComposite( array, "artif_ticker", "X", flags
= 7 )
accepts "X" field definition (in addition to regular OHLCVI)
"X" means update O, H, L, C fields simultaneously
- flags parameter is the sum of the following
1 - reset values at the beginning of scan (recommended)
2 - put composite ticker into group 253 and EXCLUDE all other tickers
from group 253
(avoids adding composite to composite)
NEW: 4 - put last scan date/time stamp into FullName field
- when a AddToComposite() adds a new ticker stock tree is automatically
refreshed
- when "continuous quotations" box is unchecked - intraday and daily
charts default to line chart
- candlesticks can be now drawn in 4 different styles - seePreferences - Miscellaneous
tab "Use distinct color for candlestick...."- the default settings
gives you "classic" AmiBroker look but I suggest to check all 4
possibilities because color bars look much better in "Shadows only"
mode for example
- vertical line separating days in intraday and years in EOD charts is now
optional
- added labels showing the end value of each graph line (to switch off go
to Preferences - Miscellaneous - "Show value labels")
- new style for graphNstyle variable: 2048 - do not rescale Y axis.
- new database dialog suggests a following path for a new database
<current working directory>\MyNewDatabase
- time out for slow external COM objects is increased to 10sec (should help
slow responding TC2000 server)
CHANGES FOR VERSION
3.95.0 (as compared to 3.93.1)
- new functions in AFL:
Weighted Moving Average - WMA( array, periods ) - accepts variable periods
(array)
Double Exponential Moving Average - DEMA( array, periods ) - accepts variable
periods (array)
Triple Exponential Moving Average - TEMA( array, periods ) - accepts variable
periods (array)
TimeNum() - returns bar time HHMMSS: 15 hours 23 minutes and 30 seconds is
represented by 152330
Hour(), Minute(), Second() - return bar hour, minute and second
- AFL Open/Save As file dialogs remember also file name of the most recently
saved formula
- Printing directly from AFL editors implemented - right mouse button over
the formula window then choose "Print"
- no overlaping texts on date axis anymore
- selected quotation (vertical line) does not disapear when chart is scrolled
or refreshed
- price chart now display vertical line dividing days (in intraday modes)
and years (in daily/weekly/monthly modes)
- Refresh feature fixed (once again) + simultaneous refresh of mutliple symbol
charts implemented
- Auto-refresh driven by plugin implemented (now only eSignal plugin utilises
this feature)
- if only it is possible, scroll bar is NOT moved to the last bar after chart
refresh (but new bars arriving from RT plugin show up :-))
- Edit->Delete quotation and Edit->Delete session force chart refresh
- AmiBroker now notifies previously used data plugin when user chooses a different
one or loads the database that uses a different plugin (this allows closing
internet connections for example)
- when ExitAtStop is switched OFF - max. loss and profit target stops are
triggered
by examining SellPrice/CoverPrice tables instead of High/Low
(trailing stop worked that way since the beginning)
- trendline properties dialog works correctly also for intraday charts now
(additional edit boxes for start/end time)
- OLE automation: new method added to Stocks collection:
string GetTickerList( long type ) (type = -1 - all tickers)
- returns comma separated ticker list
- fixed problem tha occured with "show current trade arrows" applied
to intraday charts
- fixed crash that occured when one tried to import empty tickers using $NOQUOTES
mode
- fixed hangup when displaying charts of values greater than 10^15
- fixed crash when importing ASCII files with time given in format HH:MM (without
seconds)
- minor bug fixes
- HTMLView.exe program: only Save As... option is now left and it works OK.
Also reduced program size from 36KB to 19KB :-)
- TC2000 plugin now provides the access to Wordens proprietary indicators
Balance Of Power and Money Stream via GetExtraData call:
GetExtraData("BOP") and GetExtraData("MoneyStream")
CHANGES FOR VERSION
3.93.1 (as compared to 3.93.0)
- AddToComposite works ONLY in scan mode now
- fixed "Delete" feature in Symbol->Organize assignments
- fixed "Edit formula" feature
- cosmetic fix in charting: when only flat line = X is plotted scale is set
from X to 1.1*X
CHANGES FOR VERSION
3.93.0 (as compared to 3.92.0)
- Custom intervals for
intraday bars implemented (new Preferences->Intraday page)
-
new AFL function AddToComposite(
array, "ticker", "field", flags = 3 )
single function replacement of JScript/VBScript composite formula described
in newsletter 12/2001. Allows you to create composite indicators with ease.
Parameters:
array - the array of values to be added to "field" in "ticker"
composite symbol
"ticker" - the ticker of composite symbol. It is advised to use
~comp (tilde at the beginning)
newly added composites are assigned to group 253 by default and
have "use only local database" feature switched on for proper operation
with external sources
flags - contains the sum of following values
1 - reset values at the beginning of scan (recommended)
2 - put composite ticker into group 253 and EXCLUDE all other tickers from
group 253
(avoids adding composite to composite)
AddToComposite function also detects the context in which it is run
and does NOT affect composite ticker when run in Indicator or Commentary mode,
so it is now allowed to join scan and indicator into single formula.
Simple usage example:
AddToComposite( MACD() > 0, "~BullMACD", "V");
graph0 = Foreign("~BullMACD", "V");
(now you can use the same formula in scan and indicator)
- Ultimate() indicator
now uses H/L prices instead of just close
- Status() function supports
new argument:
Status("action") - gives information in what context given formula
is run
1 - INDICATOR, 2 - COMMENTARY, 3 - SCAN, 4 - EXPLORATION, 5 - BACKTEST / OPTIMIZE
- Quotations editor now allows easy adding new quotes in Single symbol mode
(note (new) entry at the beginning of the quote list - select it and edit
new quote)
- Stock menu renamed to "Symbol"
- Market, Group, Sector and Industry information is shown in the status bar
- Fixed synchronization between tree and ticker bar
- Deleting stock selects next symbol (not 2nd next)
- View->Refresh fixed
- Metastock importer and plug-in now support also intraday MS databases
- Double click on the result list in Auto-Analysis window switches correctly
the periodicity also for intraday charts
- buy arrows are green and sell arrows are red regardless of custom palette
settings
- removed warning for running backtest over 1000 issues in no-trade mode
- when new database is loaded charts are switched automatically to DB's base
interval.
CHANGES FOR VERSION 3.92.0 (as compared to 3.90.6)
- intra-day support implemented in charting engine
- ASCII importer & wizard now feature new field definition: TIME (allowable
formats: HHMM, HH:MM, HHMMSS, HH:MM:SS )
- intra-day support added to the backtester/optimizer
- Database settings window features time base setting
- sorting by ticker after backtest in no-trades mode works OK now
- number of rows in the result list is reported in exploration/scan modes
- AA export to CSV file does not include formula when you unmark "formula"
check box in the settings
- Find feature implemented in all AFL editors - press Ctrl+F to find text
- specifying graphNstyle 64 or 128 causes scaling based on H/L array in custom
indicators
- added "Edit formula" option in the chart context menu that allows
instant editing of custom indicator formula.
- other minor fixes
CHANGES FOR VERSION
3.90.5 (as compared to 3.90.4)
- Assignment organizer: Delete option asks for confirmation and allows you
to cancel
- Assignment organizer: Tooltip texts updated: more appropriate "Move"
is used instead of "Copy"
CHANGES FOR VERSION
3.90.4 (as compared to 3.90.3)
- the fixup file name procedure checks also for CON, AUX, NUL reserved words,
also it matches only full strings not substrings so tickers like LPTH, WBPRN
are no longer translated to LP_H and WBPR_
- Foreign and RelStrength functions now have one additional argument
Foreign( "ticker", "field", fixup = 1 )
RelStrength( "ticker", fixup = 1 )
the default value of fixup is 1 and causes filling the holes in data with
previous values (behaviour introduced in 3.90.3), if fixup is 0 - the holes
are not fixed (the old, pre-3.90.3 behaviour)
Note: you can still use Foreign/RelStrength in the old way:
Foreign( "ticker", "field" ), RelStrength( "ticker"
) - then the holes will be fixed.
- Plugins: QP2 and TC2000 plugins always refresh the most recent bar data
(useful for performing intra-day updates of the last daily bar)
- other minor fixes and checks
CHANGES FOR VERSION
3.90.3 (as compared to 3.90.2)
- safety check added to AA/Scan to prevent occasional access violation exceptions
while running scans that add quotes to the current symbol
- added safety check for too long graph title strings specified in Plot()
function
- stock tree is properly refreshed after Edit->Erase watch list(s)
- now View->Refresh updates just charts and 'in-memory' cache so after
updating your external source it is enough just to click View->Refresh.
"View->Refresh ALL" additionally refills symbol tree and ticker
list
- Database settings dialog does "Flush cache" automatically if "number
of bars" or "data source" have changed
- a new setting in the Preferences->Misc allowing you to switch off the
display of data plugin activity (this provides a little speed-up)
- a confirmation box added to "Delete all studies"
- Tab order fixed in quotations editor
- a new checkbox "Load this database at startup" added to the "File->New
Database" dialog - this allows to automatically set newly created database
as a default one.
- if there are data holes / misalignment in the foreign security Foreign()
function returns a previous quotation value instead of {EMPTY}
- bug report window now provides memory status and cache stats.
- new button "copy to clip" added to the bug report window to make
copying the text of the report easier.
CHANGES FOR VERSION
3.90.2 (as compared to 3.90.1)
- fixed random crashes occuring when list view column was clicked for sorting
- 2 digit year window changed to cover 1920-2019 instead of 1950-2049 so ASCII
importer treats YY as 19YY when YY >= 20 and 20YY when YY < 20
- fixed sorting of very large numbers (bug was present only in 3.90.x)
- AmiBroker now protects the user from saving the database into the folder
that contains other applications' data files - this avoids problems when user
does not recognize the fact that AmiBroker database is different than MS,
QP2 or TC2000 databases and should be stored in a separate folder.
- AmiBroker estimates the optimal size of "in memory" cache at start-up
when the user hasn't changed the default 10. (here is how it works: AmiBroker
checks your Preferences->Data "in memory cache" setting at startup
(only) - if it is equal to "10" (the old default) - it calculates
the estimate according to the following formula:
25% * (total RAM memory in your computer)/( (size of single quotation) * (default
number of bars loaded) ). So the goal is to utilise 25% of physical RAM for
the cache.)
- Optimizer uses more accurate calculations for fractional step, min, max
values
- Bug report button handling modified: spaces in mailto: string are replaced
with %20 sequences - this should address the problems with Outlook
- a nice "N/A" is shown instead of ugly "1.#R" in the
backtester
- a "system % drawdown" figure in optimization result list matches
the correct value shown in the backtest report (multiple security test/optimize).
CHANGES FOR VERSION
3.90.1 (as compared to 3.90.0)
- OLE automation Quotations.Add method initializes the fields to zeroas pre-3.84
versions did, so VB/JScript composite formulas work OK again.
- adding a new symbol in the formula (via Stocks.Add) sometimes caused reallocation
of the symbol table and misplaced pointers - a check and fixup after parsingis
added
- risk/yield map now shows progress window during calculation
- workaround over the limitation of Windows progress bar (65536 items max.)
implemented to display bar properly for more than 65K steps of optimization
- review window layout changed, introduced a "Show" button and a
new 'entertaining' mode: "Show immediately"
- other minor fixes
CHANGES FOR VERSION
3.90.0 (as compared to 3.88.0)
- Automatic Analysis result list works now in virtual mode which is much faster:
- Now "Removing items" time is virtually eliminated :-) (>100
times faster)
- scans/backtests/explorations run 20%-70% faster
- sorting by columns is approx. 2 times faster
- copying contents to the clipboard is >20 times faster (200'000 rows
(1MB) below 1 sec.)
- stock tree works faster and better (actually I could write a book on this
point :-))
- "Use only local database" box in the Stock->Information window
allows to store certain symbols in local database while the others are retrieved
from external database (as set in File->Database Settings)
- OLE Automation interface: 2 new properties of Stock object:
DataSource ( 0 - default, 1 - local only )
DataLocalMode ( 0 - default, 1 - store locally, 2 - don't store locally)
- new AFL function Version( minrequired = 0 ) that returns the AmiBroker version
number as float ( 3.88 for example ). Additionally when you specify Version(
4.0 ) AmiBroker will issue an error message when running the formula on AB
earlier than 4.0 :)
- new AFL function: Random() returns an array of random values in 0..1 range
(to get single random value use LastValue( Random() ) )
- info tip added to list view controls (to see truncated cell items...)
- fixed bug causing double delay when using short = sell; cover = buy; in
your formula and setting non-zero delays for all buy/short/sell/cover
- Clicking "OK" in File->Database Settings dialog marks database
as "changed" so it gets saved automatically.
- ASCII importer now supports retrieving date from filename use $DATE_YMD,
$DATE_DMY, $DATE_MDY in .format file to specify the date format
- every module uses its separate progress bar so potential conflicts are eliminated
- progress bar shows only changes greater or equal to 1% - this provides a
little speed up
- a progress window is shown also for single-symbol optimization
- an estimated time left for multiple symbol optimization shown in the progress
window is a time needed to complete the whole process (not just the single
step)
- data field names in Foreign() function are no longer case sensitive
- AFL editor preferences now allow to switch on/off word wrap (requires re-run)
- Automatic analysis window now contains Ln/Col indicator
- AFL errors are now reported with a line and column numbers and the place
where error occurred is automatically selected in the editor
- JScript/VBScript errors are now reported with the absolute line number (not
relative to the beginning of the script block) and automatically selected
in the editor (caveat: due to the way how JScript/VBScript engines work the
line number is correct when lines are not wrapped in the editor (line numbers
in AFL-only are always OK) )
- optimizer displays error message "missing buy/sell variables"
only once
- other minor fixes
CHANGES FOR VERSION
3.88.0 (as compared to 3.87.2)
- position sizing in backtester implemented: new reserved variable
PositionSize = <size array>
- new checkbox in the AA settings window:
"Allow position size shrinking" - this controls how backtester handles
the situation when requested position size (via PositionSize variable) exceeds
available cash:
- when this flag is checked the position is entered with size shinked
to available cash
- if it is unchecked the position is not entered
- new report mode in AA settings window: "Trade list with prices and
pos. size"
CHANGES FOR VERSION
3.87.2 (as compared to 3.87.1)
- the most recently used AFL path is now saved separately for Systems, Indicators
and Commentaries
- caption bar's maximize button works now also in Indicator builder and Commentary
windows
- "Flush cache" button added in the File->Database settings window
to clear in memory cache without exiting AmiBroker
- a safety check added for GetQuotationAt() function
- fixed the problem with running AmiBroker on Windows 2000 as a restricted
user causing harmless but annoying message "Failed to update the system
registry. Please try using REGEDIT" (This is a bug of Windows 2000 described
in MSDN: Q254957 )
- fixed problem with handling C++ like comment (//) at the end of the formula
- fixed bug with converting empty AmiVar to array (at @42ecc7/3.87.1)
- fixed problem with "Save database AS" (into a new directory)
- QP2 plugin: GetExtraData("HasOptions") returns true (1) when stock
is optionable false (0) otherwise
CHANGES FOR VERSION
3.87.1 (as compared to 3.87.0)
- fixed bug occuring when there was a syntax error at the end of a very long
single-line statement (>256 characters in single line) and AFL tried to
display the error message.
- fixed bug causing infinite loop when running auto-analysis in weekly/monthly
mode (bug appeared in 3.84 beta)
- fixed small bug in Metastock plugin causing duplication of last bar quote
CHANGES FOR VERSION
3.87.0 (as compared to 3.86.0)
- in "report no trades" mode backtester generates a summary result
list instead of listing every trade - this consumes less memory and makes
backtesting 2-3 times faster and it is recommended for backtesting more than
1000 symbols at one time it also allows to export performance statistics to
CSV file
- status bar now shows DB changed state as yellow icon - also it displays
additional information - number of symbols loaded and the path to the database
when you hover the mouse over the status bar icon.
- fixed bug when recalculating composites
- fixed bug sometimes causing access violation when accessing weekly/monthly
data
- fixed potential bug in progress bar causing FLT INVALID OPERATION at address
10007dd9
- fixed problem with weekly data compression of pre-1970 dates
- About box shows more links
- fixed problem with interference between buy/sell/short/coverprice tables
and built-in trailing stops (ApplyStop) when testing both short & long
- Quotations editor now displays a progress bar in All Stocks/Single quote
mode
- COM message filter implemented allowing proper operation of slow, out-proc
data plugins like TC2000
- QuotesPlus plugin (QP2.DLL) exposes 2 new extra data:
GetExtraData("briefing") - gives briefing text (STRING)
GetExtraData("QRS") - gives Quotes Plus relative strength (ARRAY)
- QuotesPlus plugin (QP2.DLL) checks for qp_ticker_invalid to exclude invalid
tickers
- TC2000 data plugin implemented featuring direct quote read, sector/industry
retrieving, exchange/index grouping
- Metastock data plugin implemented featuring support for unlimited MS data
directories (so you can setup AmiBroker to use multiple MS directories to
overcome MS 4096 symbols per folder limit)
- Tools->Plugins dialog does not load DLLs multiple times when "Load"
button is hit more than once.
- Tools->Plugins dialog now shows if given DLL is certified. ("certified
plugin" means it was tested by AmiBroker.com for stability and compatibility
with AmiBroker)
CHANGES FOR VERSION
3.86.0 (as compared to 3.85.0)
- num of winners / num of loosers figures in the backtesting reports take
commissions into acount (previously only gross profit (without subtracting
commission) decided if given trade was considered winner or looser)
- optimization results now include point gain (in addtion to % gain) so "point
only" optimization results are sorted correctly
- optimization results now list "N/A" instead of ugly "-1.$"
or "-1.#" when the figure is not available
- after "optimization" mode is run "Report" button is
disabled because it always gives last optimize step result which in most cases
is not the best one - and thus may be confusing
- Metastock importer handles correctly dates before 1950
- names like PRN, LPT, AUX are converted to PR_, LP_, and AU_ to avoid problems
with Windows file system reserved words
CHANGES FOR VERSION
3.85.0 (as compared to 3.84.0)
- new AFL function GetExtraData()
- allows retrieving vendor-specific data (QP2 plugin demonstrates accessing
fundamental data)
- fixed bug causing crash
when saving database after copying AA result list to watch list
- adding full name in
tree and ticker bar works again
- "In memory cache"
setting in Preferences/Data had no effect on real cache size - this is fixed
now
- Quotes Plus plugin (QP2.DLL)
retrieves now also mutual funds, futures, in addition to sectors/industries
it sets up also markets and groups
- Quotes Plus plugin allows
access (via AFL function GetExtraData( <fieldname> ) ) to the following
fundamental figures:
"AnnDividend" ,"Shares", "SharesFloat", "SharesOut",
"SharesShort", "TTMsales", "Beta", "TTMEps",
"HiPERange", "LoPERange" , "PEG", "InstHolds",
"LTDebtToEq", "CashFlowPerShare", "ROE","TTMSales",
"Yr1EPSGrowth", "Yr5EPSGrowth", "Yr1ProjEPSGrowth",
"Yr2ProjEPSGrowth", "Yr3to5ProjEPSGrowth" , "BookValuePerShare"
CHANGES FOR VERSION 3.84.0 (as compared to 3.80.4)
- internal database handling
rewritten for more speed and external data link capability
- data plug-ins interface
implemented
- Open Interest displayed
in the data tip
- a new settings in Preferences
window for Data feed selection
- local caching (both
in-memory and file-based) implemented
- tree filling optimized
for large number of stocks >1000
- ticker bar rewritten
- now allows direct typing of ticker name (F4 - hot key)
- trailing stops work
correct when testing both long & short trades
VERSION 3.80 RELEASE NOTES
Version 3.80.2 (November 18th, 2001) includes following new features and bug-fixes
(as compared to 3.70.0)
- text box uses the color set in the toolbar color picker
- "Exclude" variable works correctly also with arrays
- ASCII Importer accepts also comma (,) as a decimal part separator if fields
are delimited by different separator
- Import wizard generates correct $SEPARATOR \t command when Tab separator
is selected
- the color indexes in graphNcolor, graphNbarcolor, Plot() are now consistently
encoded
- a default argument mode = 0 added to the following functions: GroupID( mode
= 0 ), MarketID( mode = 0 ), SectorID( mode = 0 ), IndustryID( mode = 0 )
when
mode = 0 (or no argument is given)- these functions return numerical ID (as
in 3.79)
mode = 1 - these functions return name of the category (text)
- added predefined symbols True = 1 and False = 0
- Avg and A are highlighted by the AFL editor now
- The number of chart sheet tabs is now definable by the user (from 1 upto
20 tabs)
The default was increased to 8. A pager control added to scroll the tabs if
there is not enough space to fit all tabs and the horizontal scroll bar
- New AFL functions:
AddColumn( array, name, format = 1.2 );
AddTextColumn( text, name );
Plot( array, name, color/barcolor, style = 1 )
- New reserved variable
GraphNname = "string";
- "show current trade arrows" in AA window works correct also for
"open long" and "open short"
- AND, OR, NOT are highlighted in AFL editor
- BuyPrice, SellPrice, ShortPrice, CoverPrice arrays are checked against High/Low
range for every bar and adjusted if they are outside of the allowed range
due to the wrong formula. Also these arrays are checked for {empty} values
and fixed to back to the default set in Settings if an {empty} is encountered.
- data tooltip is less sensitive to the mouse movement when a chart is zoomed
in
- sharing violation exception is now caught when trying to save AFL/CSV over
the file that is opened exclusively by another application.
- The on/off status of format toolbar buttons (thick line, dotted, right extend)
is preserved between sessions
- points only test for futures (prelim.) - commission handling adjusted to
this kind of test
- snap to price mode is active only in main price chart
- show current trade arrows scrolls chart correctly also for short trades
- bug report window lists also cooltool and mfc versions
- if broker.prefs file is missing charts are not black anymore (bug occurred
in 3.78)
- additional safety check when loading layout files implemented
- ability to sort custom indicators by name (ascending/descending) in Indicator
Builder and Insert Indicator dialogs ( just click on the caption bar)
- indicators are alpha-sorted now in all Insert menus and Indicator Builder
- "Display in quick insert menu" option added in the Indicator Builder
allowing to control which custom indicators appear in the menu.
- when no data is available "N/A" is displayed in the backtesting
reports instead of ugly 1.#J or 1.$
- plugin interface has GetVariable( name ), SetVariable( name, value ) functions
this in fact was present in 3.78 - but not mentioned :-)
- ability to add entry/exit prices to the back test report, precision selectable
2 or 4 decimal digits
- Buy/sell arrows are not shown for out-positions
- 5 new AFL functions: GroupID(), MarketID(), SectorID(), IndustryID(), InWatchList(
listno )
- a new option in Automatic Analysis window menu to add only *selected* items
from the results list to the watch list(s) - multiple selection as usual Click+SHIFT,
+CTRL
- snap to price does not affect horizontal line and text tools anymore
- fixed bug with handling unterminated C-like comments
- progress dialog does not flicker during optimization
- dynamic (time-variable) stops implemented (ApplyStop() function accepts
now array as a third parameter)
- trailing stops implemented
- syntax highlighting editor: fixed bug causing deletion of the last character
in the editor after delete (and other) command choosen from right mouse button
menu.
- palette size increased to 56 colours - 40 pre-defined + 16 custom (from
only 16 custom colours)
- Preferences now use new-style colour pickers
- a new toolbar to select study colour, dot/thick style and right-extend mode
- fixed problem with reporting a short trade followed immediately by single
day long trade
- fixed problem with changing font face/size during paste via Ctrl-V
- fixed problem with uninitialized **price arrays in optimization mode
- log scale in custom indicator works now correctly:
- a new check box in the Indicator Builder added (Grid: Logarithmic)
- graphNstyle = 32 is not needed anymore (has no effect now) (this is
to avoid confusion having different styles (log/lin) in multiple graphs)
- zooming does not scroll the chart to the end anymore
- wheel zoom/scroll is two times more sensitive (allows faster zooming/scrolling)
- Right-mouse-button menu came back in AFL editor
- Snap-to-price is 100% exact now
- AFL editor colorizes graphX*** and columnX*** variables also for X>2
(upto 29)
- AFL editor supports drag-and-drop operation
- AFL: GetScriptObject() function allows calling functions in the script part
- New AFL Syntax Highlighting editor (highlights AFL code only)
- New preferences settings for AFL editor font/colors/highlighting features
- New color picker implemented (currently used only in AFL editor settings)
- Edit->Snap to price - enables "snap to high/low" mode when
drawing trend lines
- Edit->Copy (as bitmap) implemented
- Copy to clipboard list of results in AA and Quick Review implemented (press
Ctrl-C to copy)
- AFL engine - DLL Plug-in interface implemented (separate specification available)
- Plugin dialog implemented: (Tools->Plugins menu) allows loading/unloading
plugins without closing AmiBroker (useful in development work, when you need
to replace the DLL)
- AFL engine - COM support added:
- CreateObject( "server.class" )
- CreateStaticObject( "server.class" )
- ability to call methods in COM objects directly from AFL: ob.MethodName(
param1, .... );
this allows writing/debugging your trading system in Visual Basic/Delphi
and similar COM-enabled languages
- AFL: scripting host - added 2 new methods to AFL host object:
- AFL.CreateObject( "server.class" ) - mainly for completeness
(duplicates new ActiveXObject functionality)
- AFL.CreateStaticObject( "server.class" ) - this one is very
useful for COM objects that are slow to initialize (like QP2 objects).
Thanks to this function initialization is done only once per AmiBroker
session
- AFL: parser stops after first error
- AFL: RelStrength() and Foreign() functions now two times faster
VERSION 3.70 RELEASE NOTES
Version 3.70.1 (September 3rd, 2001) includes following new features and bug-fixes
(as compared to 3.65.1)
- Optimization engine implemented
- added simple crosshair display (View->Crosshair)
- added refresh all views feature (View->Refresh)
- added Rectangle and Ellipse drawing tools
- added Arc tool
- added Fibonacci Fan tool
- added Fibonacci Arc tool
- Activation of child dialog makes also main frame active (currently works
only for non-modal dialogs)
- AmiBroker MS importer now attempts to read Metastock's MASTER file first
(before EMASTER) - this is changed because there is a bug in QuotesPlus MS
export functionality - it does not update EMASTER properly so the dates in
UI are displayed wrong even if they are imported correctly.
- Mouse wheel zooms the chart when CTRL key is depressed
- Variable-period simple moving average (MA function) does not crash if periods
array has {empty} entries at the beginning
- a new button added to automatic analysis window allowing you to enlarge
result list
- changing selected date automatically refreshes Guru chart commentary
- commentary output window background is now white by default
- reorganized toolbars and Insert menu
- double click on a study (in select mode) brings properties dialog
- Exploration does not crash anymore when a columnX has string value assigned
to
- Exploration handles text columns (limitation: only the value of string at
the ending point of analysis range is reported)
- new property of OLE Automation Stock object:
WatchListBits (long) - each bit 0..31 represents assignment to one of 32 watch
lists to add a stock to nth watch list write (JScript example):
Stock.WatchListBits |= 1 << nth;
- AFL: modulo operator (%) added. Example 10 % 7 gives 3.
- fixed bug in reading filter settings in AA window causing (rarely) crash
on Windows NT/2000 (3.69.0 only)
- added $WATCHLIST <n> command and WATCHLIST field type to ASCII importer
- Import Wizard now allows to select destination group and watch list
- Metastock(TM) importer now allows to select destination group and watch
list
- Crosshairs are hidden when mouse is outside of chart windows
- A Ctrl-H hot key is added for switching Crosshairs on/off
- Chart context menu works OK when mouse is set to left-handed mode
- Commentary buy/sell arrows are refreshed when switching from one stock to
another (as in pre-3.68 versions)
- AFL: ApplyStop( type, mode, amount, exitatstop ) function added that allows
controlling stops from the formula level (overrides settings). This enables
optimization of stops.
Parameters:
type = 0 - maximum loss stop, 1 - profit target stop, (more to be added)
mode = 0 - disable stop, 1 - amount in percent, 2 - amount in points
amount = percent/point loss/profit trigger amount
exitatstop = 0 - exits at defined price field, 1 - exits at stop level
- ability to change the number of custom indicators (Tools->Preferences->Other
indicators : "Custom indicators" )
- Automatic analysis Range, Type, Date From/to and Filters are saved between
sessions
- AFL now recognizes "\t" escape sequence and converts it to the
tab character (this allows easier columnized output in commentary window)
- Recently used commentary formula is preserved between sessions
- Editing study properties marks stock as "dirty" therefore causes
proper saving
- ASCII importer now allows space as year/month/day separators in date fields
so dates like "20 Jan 2001" are accepted
- variable-period version of Sum() is immune to {empty} values in periods
table
- variable-period versions of High/LowestSinceBars functions are more robust
- other minor fixes
VERSION 3.65 RELEASE NOTES
Version 3.65.1 (August 6th, 2001) includes following new features and bug-fixes
(as compared to 3.64.1)
- AFL: Highest/LowestSinceBars accessed one array element too much when working
with very short histories this is fixed now.
- AFL scripting host: fixed passing string variables from AFL to the script
- added a switch in Automatic Analysis Settings window to include/exclude
listing out-of-market positions
- Preferences "cancel" behaviour fixed
- An underscore ('_') character can be now used in AFL identifiers
- new look of "About" window
- application code is optimized so it is both smaller and at least 10% faster
- AFL: a new function status( "what" ) added for now only one propery
is available "stocknum" which reports the ordinal number of the
stock being currently scanned/explored/back tested in the future more run-time
properties will be available
- support for mouse wheel (scrolling charts)
- back-testing reports now can include formula listing and settings
- assignment organizer has ability to delete multiple stocks
- stocks could be moved between watch lists using assignment organizer
- eliminated memory leaks in AFL scripting host
- AFL scripting host is at least 20% faster
- AFL scripting host gives meaningful error messages
- comments after script block are handled correctly
VERSION 3.64.1 RELEASE NOTES
Version 3.64.1 (July 24th, 2001) includes following new features and bug-fixes
(compared to 3.64.0)
- Intraday drawdowns calculated through all timespan of the system added
- Switching periodicity to monthly/weekly works correctly now (previous version
required switching to another stock first)
- Compound annual returns are calculated correctly now
- Fixed hang happening when backtesting very short date ranges
VERSION 3.64 RELEASE NOTES
Version 3.64 (July 22th, 2001) includes following new features and bug-fixes
(compared to 3.61):
- Backtester: Interest rate could be earned when out of the market
- Out of the market positions are shown in the result list
- Open trades are shown in the trade list
- New backtest statistics: annual % profit for system and B&H, days in
test, bars out of market, interest earned
- Exposure and risk adjusted return stats added
- Minor fixes in report statistics
- Setting 1 day/quote range in AA gives really one day/quote in the results
(instead of 2)
- Metastock importer saves recently used selection list in import.tls file
inside metastock data dir, so when you choose this directory again, your previous
selection will be applied automatically.
- Max. point and percent intraday drawdown calculation for system and buy&hold
added
- Backtesting report output uses separate CSS styles for <TH> and <TD>
tags to avoid ALIGN=RIGHT in every cell that needs right alignment
- Buy&hold profit and open positions reporting do not depend on at least
one trade generated anymore - they are now reported regardless of any trades
- a new reserved variable "exclude" added to handle cases when you
want to exclude completely certain tickers from back testing AND buy&hold
calculation
- Metastock importer supports now more than 256 securities per folder
- Metastock importer dialog features new mark all/none/add selection functions
and allows sorting ticker list by symbol, full name, dates and type
- Histogram custom indicator charts look better now (no lines below minimum
drawn)
- Date axis in the main chart looks better now (no overlapping month names
when chart is zoomed out)
- Backtest, scan and exploration support now also weekly and monthly mode
- Auto-analyser settings allow you to choose different periodicity and show
buy/sell arrows swith the chart to the current test mode automatically
- Weekly/monthly mode time-compression now sets the date to the last day of
each week/month for which quotes are available- this matches reality better
(weekly mode is "end-of-week" and monthly is "end-of-month")
- Small fix in weekly date handling
VERSION 3.61 RELEASE NOTES
Version 3.61 (July 8th, 2001) includes following new features and bug-fixes
(compared to 3.60):
- Fixed garbling text when storing the most recently used formula to registry
after saving the AFL to file
- AFL formula in automatic analysis is saved to registry BEFORE running any
scan/explore/backtest so in case of crash the edited formula is preserved.
- Fixed Stock->Split date handling (was broken since AmiBroker is handling
date display according to system settings)
- Second parameter (data field) in Foreign() function is not case sensitive
anymore
- Indicator Builder: when custom scaling Min/Max levels are equal AmiBroker
switches to automatic scaling
- Comparative Relative Strength chart, relstrength() and foreign() AFL functions
work properly now also in Weekly and Monthly modes.
VERSION 3.60 RELEASE NOTES
Version 3.60 (June 5th/11th, 2001) includes following new features and bug-fixes
(compared to 3.55):
- SAR overlay in the main price pane uses accel. step/max defined in preferences
- SAR preferences edit boxes now accept typing dot . (ES_NUMBER style removed)
- Back testing settings are preserved between sessions
- buyprice, sellprice, coverprice, shortprice arrays are now available in
scan/exploration (to avoid "undefined variable" errors)
- More detailed version info in About box.
- Analyser now supports displaying arrows in two modes -
- all (dbl. click on result list) - shows all signals/trades
- current trade/signal (dbl. click with SHIFT key pressed)
- When showing current trade arrows the chart is automatically scrolled to
ensure that they are visible
- Stochastic %K and %D as well as stochk stochd use the most common formulation
with simple moving average smoothing instead of Wilder's smoothing.
- AFL scripting host now implements IActiveScriptSiteWindow interface (this
enables MsgBox and InputBox functions in VBScript)
- Fixed bug in analysis settings - sell price field combo now works OK again
- Improvement: buyprice, sellprice, shortprice, coverprice arrays available
in AFL formula for reading (pre-initialized properly by the engine)
- Tickers are not truncated to 3 letters in Risk/Yield map anymore.
- Short/Cover arrows have the same color as sell/buy but they are hollow
- Show dates setting in Indicator builder allows to add date axis to any custom
indicator pane
- AFL formula entry fields accept now upto 65535 characters on Win95,98,Me
and 1 million characters on Win NT/2000
- Lexical analyser in AFL handles scripting begin/end (<% and %>) tags
better
- Stops are now working more precisely
- Buy/sell arrows after backtesting show only currently selected trade entry
and exit points.
- Built-in stochastics use High and Low prices (not only close)
- Trades closed out by stops are marked in the result list accordingly
- Implemented AFL Active Scripting Host that enable mixing AFL with JScript/VBScript
- (EXPERIMENTAL)
- Prefs/Misc setting - No minimum size for resizing dialogs
- Buy and sell at the same bar possible
- Added separate variables for Short trades short/cover
- Ability to control trade price : buyprice, sellprice, shortprice, coverprice
(simulation of stop orders possible)
- Added missing Broker.Application.Markets read-only property
- Watch lists implemented: Add/Remove to/from watch list from stock tree context
menu
- Add/Remove favourites, info, delete and split from context menu
- Erase watch list(s) (Edit menu)
- Analysis results can be now added to a watch list automatically (context
menu over result list)
- Filters now include watch list selection
- Fixed Bug in BAck-tester - stops do not generate false buys when testing
long only
- Implemented Profit Target stops
- Fixed LLVBars, HHVBars problem appearing with very short histories (6 quotes)
- "Exit at stop" option in Automatic Analysis allows to close the
position at exact stop price (no slippage)
- Automatic analysis window now support "Exploration" - for generating
user-defined reports from database screens.
Short instructions:
You need to:
- define filter variable that equals "1" for stock accepted
- define numcolumns variable that defines the number of columns in the
report
- define column0, column1, column2, ...., columnX variables that get the
values displayed in the report
- optionally: define column0name, column1name, ... to name column headers
accordingly
- optionally: define column0format, column1format, ... to change the default
2 decimal digits output (1.5 gives 5 decimal digits, 1.0 gives no decimal
digits)
After running Exploration you can export the report to the CSV file using
"Export" button.
- Variable period MA()
- Small fix to variable period Sum()
- Layouts can be now saved to a file, enabling unlimited user-definable layouts
possible - accessible by Right Mouse button menu over the chart "Layout"
submenu options: Load, Save, Load default, Save as default
- Switchable Excel-like chart sheets
- Variable-period HHV, HHVBars, LLV, LLVBars, Sum(), Ref() functions (EXPERIMENTAL)
- Polymorphic AFL function dispatcher choosing optimized version of the function
depending if parameters are time-variant or not
- Fixed problem with saving corrupted layout (happened when closing main frame
when document frame was already closed by the user)
- fixed "return from portfolio" figures shown in Automatic Analysis
bottom line (reports worked well all the time) (v3.60.3)
- showing buy/sell arrows works OK now if routines use *price fields (v3.60.3)
- fixed yet another issue with chart sheets causing crash with very narrow
panes (v3.60.3)
VERSION 3.55 RELEASE NOTES
Version 3.55 (April 22nd, 2001) includes following new features and bug-fixes
(compared to 3.50):
- Export Auto-Analysis trade list to a CSV file
- Fibonacci retracement tool enhanced
- now works in 4 different modes depending on the direction of trend line
drawn:
NE - gives (old-style) retracement in up trend
SE - gives retracement in down trend
NW - gives extension in up trend
SW - gives extension in down trend
- Added also 261.8% and 423.6% levels
- Added very simple ASCII export of portfolio contents
- AmiBroker now automatically saves preferences and current chart layout on
exit - this can be changed back however (to the old behaviour) using new settings
in Preferences->Miscellanous
- "Current" button in Prefs/Miscellaneous sets the default database
path to currently loaded database path
- Merge Quotes feature (with overwrite/delete switchable and optional merged
Ticker->Alias)
- Double-click in Indicator builder list inserts chart pane when not already
present
- Open Interest field type available in ASCII Import wizard
- Minor bug fixes
- Metastock importer now handles correctly also 6-field binary Metastock format
(in addition to 5- and 7-field formats)
- 100 custom indicators + more indicators dialog
- Apply in Indicator builder inserts chart pane when not already present
- Study ID field added to study properties window
- StrLen( String ) implemented
- AMA( Array, SmoothingFactor ) implemented
- AMA2( Array, ForwardFactor, FeedbackFactor ) implemented
- Study( StudyID, ChartID = 1 ); implemented
- ExRem( Array1, Array2 ) implemented
- Flip( Array1, Array2 ) implemented
- IsEmpty( Array ) implemented
- IsTrue( Array ) implemented
- Foreign( Ticker, DataField ) implemented
- sorting by date works correctly in all list views
- additional check for existing workspace directory is made during save
- fixed bug occuring when blank pane was inserted and the user tried to read
X,Y coords from it
- auto-colouring bar trends possible from AFL (i.e. up in green, down in
red, )
- date formatting works according to system settings
- show currently selected "Guru Commentary" and "Auto-Analyser"
in menu bar.
- fixed display problem when using "Large fonts" Windows setting
- Logical AFL operators cast {EMPTY} to FALSE automatically
VERSION 3.50 RELEASE NOTES
Version 3.50 (February 25th, 2001) includes following new features and bug-fixes
(compared to 3.45):
- fixed calculation of percentage profits for short trades in Automatic Analysis
window
- graphxspace parameter for custom indicators (defines % extra space added
at the top and the bottom of the chart)
- live display of X (date) and Y (value) co-ordinates in the status bar
- charting engine now supports styles 512 (staircase) and 1024 (swing dots)
needed for Gann Swing chart
- ASCII importer capable of importing non-quotation data ($NOQUOTES 1 command)
- fixed ASCII import wizard (user settings are accepted now without the need
to switch back and forward again)
- ASCII import wizard handles non quotation data formats
- Automatic analysis and commentary windows display now currently loaded file
name (in the title bar)
- buy/sell arrows generated from Automatic Analysis are now cleared when switching
to another stock
- Sizable Find window
- Sizable Assignments organizer
- Sizable Categories window
- Sizable Quotations editor
- Automatically generated bug-report now features history of commands
- fixed DateNum() function: due to the limited resolution of single precision
floating point number (7 significant digits) it was imposible to represent
numbers like 20011231 accuratelly - the result was rounding to the nearest
even number -> 20011232 which was wrong.
Therefore I decided that datenum() function will return numbers calculated
as follows:
10000 * (year - 1900) + 100 * month + day
So 20011231 becomes 1011231 and 19951231 becomes 991231
- fixed handling of both c-like comments and c++ like comments (consecutive
comments are handled correctly)
- ValueWhen() accepts negative (and zero) occurence index allowing referencing
future (needed for true Gann swing chart)
- charting engine now support individually coloured bars (graphNbarcolor variable
in AFL)
- Buy/sell arrows after screening/system test (When the result list in Auto
Analysis window is clicked AmiBroker draws now buy/sell arrows on the chart
(like Commentary does))
- Fixed lots of potential access violation holes when using empty database
and/or stocks with no quotes
- New setting for Volume/Turnover chart in Preferences
- Turnover chart caption display fixed
- Crash recovery system implemented
- Fixed bugs in ASCII importer
a) Full Name as a last field does not need quotation marks anymore
b) Data conversion is more fault tolerant
- Sectors and Industries in the tree
- Find window remebers last search type (name/ticker)
- Fixed bug in Automatic analysis "Load all when selected" feature
causing partial data loss when saving data
- Tree does not always start with "All" node open - instead "Favourite"
node is preferred
VERSION 3.45 RELEASE NOTES
Version 3.45 (January 6th, 2001) includes following new features and bug-fixes
(compared to 3.42):
I User interface / usability enhancements
- ASCII Import Wizard
- improved Stock Finder window (single click select, sorting columns, remebers
last search, asynchronous (non-modal) window)
- sizing Quick Review
- sorting columns in Quick Review
- sorting columns in Automatic Analysis
- sorting columns in Portfolio manager
- full row select in Indicator builder
II AFL - 17 new built-in functions
- HighestSince( expr, array, nth )
- HighestSinceBars( expr, array, nth )
- LowestSince( expr, array, nth )
- LowestSinceBars( expr, array, nth )
- Wilders() averaging
- LinRegSlope( array, periods )
- RWILo( minperiods, maxperiods)
- RWIHi( minperiods, maxperiods)
- RWI( minperiods, maxperiods )
- StDev( array, periods )
- DateNum()
- Year()
- Month()
- Day()
- DayOfWeek()
- Correlation( array1, array2, periods )
- Prefs( index )
III Fixes and other enhancements
VERSION 3.42 RELEASE NOTES
Version 3.42 (December 16th, 2000) includes following new features and bug-fixes
(compared to 3.41):
- A bug with OLE Automation fixed: in all pre 3.42 versions when you assigned
(from the script) a different ticker to a stock using Ticker property of Stock
object AmiBroker updated the ticker but didn't sort the ticker list. Because
many internal functions assume that stock list is sorted correctly this caused:
duplicate entries, crashes, wrong update of quotes, etc. Also when given ticker
already exists it is overwritten with a new one correctly (no duplicate entries).
All these problems should be gone now.
- A new method of Broker.Application object: Log( Action). Where possible
values for Action are: 0 - delete import log, 1 - display import.log, 2- ask
the user and display import.log.
- Sharenet importer now handles all possible locations of Sharenet downloader
and data folder. The location of Sharenet downloader is defined by "Initial
directory" parameter in Tools->Customize dialog, and location of data
folder is now defined by "Arguments" parameter in Tools->Customize.
The defaults for these parameters are: C:\Program Files\Sharenet\Sharenet
Download Service and C:\snet. If you installed Sharenet downloader to other
than default locations you may change these parameters accordingly and importer
script will work correctly
- Sharenet importer now uses new Log() method so it displays warning messages
if there were any erroneous lines in the data file(s).
- Risk yield map now handles high standard deviation (risk) better (this was
included in 3.41 just forgot to mention)
VERSION 3.41 RELEASE NOTES
Version 3.41 (December 10th, 2000) includes following new features and bug-fixes
(compared to 3.40):
- Automatic analysis, Indicator Builder and Commentary windows are now resizable
(see the sizing gripper in the bottom right corner of these dialogs) and could
be also minimized;
- ASCII importer now warns that errors occurred during import process and
displays the log on your request;
- "Rename" button added to Indicator Builder window for easier change
of custom indicator names;
- A brand new installer (using InnoSetup technology) with modern look and
much better functionality:
- now setup includes new script for Sharenet Downloader
- additional tools (Export and Cleanup) are added to the custom Tools
menu
- upgrade procedure is much easier (no need to manually replace files)
- All import format definition files (*.format) and import.types
file are moved to \Formats subdirectory. Additional import formats
added.
VERSION 3.40 RELEASE NOTES
Version 3.40 (November 1st, 2000) includes following new features and bug-fixes
(compared to 3.32):
I AFL
1.1 New built-in functions in AFL:
- sar( accel = 0.02, max = 0.2 ) - Parabolic Stop-And-Reverse
- pdi( period = 14) - Plus Directional Movement +DI
- mdi( period = 14 ) - Minus Directional Movement -DI
- adx( period = 14) - Average Directional Movement
- atr( period ) - Average True Range
- relstrength( tickername ) - comparative Relative Strength
1.2 Detailed statistics after back-testing your system
1.3 New report viewer allows PRINTING reports (and saving in HTML format)
1.4 Definable back testing parameters:
- initial equity
- buy/sell price fields
- buy/sell delay
- commissions
- max. loss stop
- reporting options
1.5 Automatic analysis window:
- now allows scanning for only buy or only sell signals
- saves recently used formula automatically instead of macd() crossover
- allows scanning and back testing in user-defined from/to date range
- allows to analyse/back test all quotes even if partial loading is switched
on
1.6 Indicator builder:
- new graphXstyle and graphXcolor allow more control over custom chart
appearance
- now custom indicators can include even candlestick charts
1.7 AFL engine now supports overwriting built-in O, H, L, C, V arrays so
you can calculate all built-in functions from different data.
For example you can calculate macd() from rsi():
II USER INTERFACE & GRAPHICS TOOLS
2.1 More graphical analysis tools, enhanced existing ones:
- definable colors and styles for trend lines
- auto left- and right- extending trend lines
- vertical and horizontal line tools
- Fibonacci retracement tool
- Fibonacci time zones tool
- Text box tool
2.2 Study properties can be modified using special "Properties" dialog
2.3 Main chart:
- moving averages calculation could be simple or exponential
- Parabolic SAR can be added to a main price chart
- Price chart can be now displayed using Traditional bars
2.4 Candlestick fill colors definable and much more color settings
2.5 New built-in indicators: ADX/DMI, SAR
2.6 The ability to search for a stock by name, for when the ticker is unknown
( Stock Finder window (F3) )
2.7 The OPEN price in the grab bar of the main chart
2.8 Full name can be added to ticker in both tree/ticker windows
2.9 Ticker window is now resizeable
2.10 WebID field in Stock Information window works correctly now
III IMPORT / DATABASE ENGINE
3.1 $PRICEFACTOR command allowing multiplying prices by definable factor
3.2 Reorganized database file layout and enhanced database engine
Using separate sub-directories for tickers beginning with each letter and
digit improves database loading/saving times dramatically (up to 3 times
when partial loading is on)
3.3 Import of long histories (for example AmiQuote .AQH files) speeded up
to 10 times
3.4 Database and program is enabled for storing OpenInterest data. Support
for OpenInterest is added to:
- ASCII importer
- Metastock(R) importer
- OLE Automation interface
- Quotation editor
- AFL (openint predefined array)
3.6 OLE Automation interface:
- Added IndustryID property in Stock object
- Added IsDirty property - this property marks "changed" state
of the stock and it is automatically updated when setting other Stock object
properties
IV OTHER
4.1 Fixed directory structure creation (bug occurred in 3.40 beta)
4.2 A directory does not get appended to the recently used list if it does
not contain valid AmiBroker database
4.3 For SHARENET users:
Sharenet DN format definition added (sharenet.format file) and six.js script
file modified in order to use new file - this should solve the problems with
upgrading. Now you can import .DN files from directly from ASCII importer
file dialog choosing appropriate type from "Files of type" combo
VERSION 3.32 RELEASE NOTES
Version 3.32 (August 9th, 2000) includes following new features and bug-fixes
(compared to 3.31):
- Any changes made using Assignments Organizer are now correctly
saved
- New options in View/Toolbars allowing to re-show hidden toolbars without
tweaking the registry
- OLE automation method Stocks.Remove() and Stock.Ticker property (setting
the value) are working correctly now changing the file name accordingly
- A new option "New workspace" added allowing you to create a
directory for a new workspace
- File/New removed (previous versions opened new chart window). This functionality
is now provided by Window/New menu, that creates new window for simultaneous
viewing charts of two or more stocks. Also new option Window/Clone allows
you to open a new window for the same stock giving you the chance to see
charts of the stock from different time ranges.
- The update archive contains fixed aqd.format and import.types files for
using with AmiQuote 1.1
VERSION 3.31 RELEASE NOTES
Version 3.31 (July 4th, 2000) includes following bug-fixes (compared to 3.30):
- Metastock importer now handles prices lower than 2.00 correctly (there
was a bug in floating point conversion routine - Metastock uses very old
Microsoft basic floating point format in the data file instead of standard
IEEE format)
- Metastock importer removes trailing spaces in ticker symbol and full name
strings
VERSION 3.30 RELEASE NOTES
Version 3.30 (Jun 29th, 2000) includes following new features and fixes(compared
to 3.25):
- the ability to save the location of a custom indicator's window ("Save
layout" option in the right mouse button menu)
- the current price to the Portfolio manager's details
- upto 8 recent database locations are available in File menu for quick
open
- the ability to skip what AmiBroker thinks are splits, then find the next
- individual RS settings for group/industry/market (evaluated in this order)
- the ability to have custom indicators display upon booting ("Save
layout" option(
- a visible indicator of when the database is changed
- Enhanced database engine: ability to load database partially at start
and load the rest on demand. This feature speeds up both loading and savind
and allows to use AmiBroker on machines equipped with less memory (Preferences/Miscellanous)
- Enhanced analysis support: Stop conditions and short-positions available
during auto-analysis.
- Enhanced quick-review and analysis windows support now filtering by market,
group, sector, industry. Also double-click on the quick-review list will
display its chart immediatelly
- indicate the price under the pointer's hot spot (Price data tooltips -
Prefs/Miscellanous)
- Assignments to sectors/industries.
- Position and state of toolbars is remembered between runs
- Fixed out-of-bound array access when using AFL with very short quotation
histories
- Fixed minor memory leak when using Review/Analysis tools
- Handling $DATE_*** format definition commands fixed Bug fix Import & export
tools
- Built-in company Profile view using embedded web-browser (Win32) or multiview(Amiga)
- Built-in assignment organizer
- Handling composites: automatic recalculation of number of advancing/declining/unchanged
issues
- Adjusting trendlines after split
- Removed excessive line-feeds added when saving AFL formulas to a file
- Market/Group/Sector/Industry information is now workspace-related (not
global anymore)
- Fixed handling quotation marks in ASCII importer
- Better handling of sizing of the splitter window
- TRIN indicator added (with two simple moving averages 15 + 45day) + settings
in preferences
- A number of new AFL functions added: AdvIssues(), DecIssues(), UncIssues(),
AdvVolume(), DecVolume(), UncVolume(), Trin()
- Fixed right-mouse-button + SHIFT (chart reselection) menu handling
- Added $APPENDTICKER, $OVERWRITE, $FULLNAME, $INDUSTRY, $RECALCVOL, $RECALCAD
commands and APPENDTICKER, ADVISSUES, ADVVOLUME, DECISSUES, DECVOLUME, UNCISSUES,
UNCVOLUME field identifiers to the ASCII importer definitions
- Fixed memory handling bug sometimes causing crashes of Automatic analysis
window
- "Save Results" option in Automatic analysis window now works
(worked in Amiga version but it didn't in Win32)
- Ticker symbols now can contain file-system reserved characters such as
*, ?, #, <, >, |, /, \. These characters are replaced by underscore
_ in appropriate file name (ticker however remains unchanged).
- Added full support for composite data handling (advances, declines, unchanged)
to the OLE automation interface: new objects Markets (collection), Market,
ADQuotations (collection), ADQuotation
- AFL interpreter now displays meaningful error messages in AFL error window
(already implemented on Amiga)
- AD-Line indicator added
- Preferences dialog now handles "Apply now" button correctly
- AFL file dialog now "remebers" its last directory (Win32)
- ADLine() function in AFL added
- WebID property to the Stock automation class added
- Custom tool menu items are displayed now correctly after adding items
to the empty list in Customize Tools dialog
- "Toggle" button in Metastock importer added to simplify selection/deselection
of multiple items
- Found workaround for extremely slow DeleteAllItems() method in Windows
list control: now removing all items from list-view control is about 5 times
faster (especially noticeable in Auto-Analysis window)
- More toolbar and menu icons, added "AmiBroker on the Web" menu
with quick web links, a couple of cosmetic changes
- Double clicking on the analysis results and in the portfolio shares list
automatically selects given stock chart
- P/E and P/BV comparisons in Quick review dialog shows values even if they
are negative
VERSION 3.25 RELEASE NOTES
Version 3.25 (Apr 26th, 2000) includes following fixes & new features(compared
to 3.24):
- Progress indicator is displayed now on the status bar during ASCII import
- Quotation database handling is now optimized for fast access to the most
recent data. The most often operation: adding new/updating recent quotations
is 2-3 times faster. This is noticeable when working with large databases
(>40MB)
- "About" dialog closes automatically after loading the database
(registered version only).
- Fixed crash when deleting trend lines in weekly/monthly mode.
- Refreshing stock tree & combo is now optimized (2-3 times faster)
VERSION 3.24 RELEASE NOTES
Version 3.24 (Mar 23rd, 2000) includes following fixes (compared to 3.23):
- Fixed bug in Metastock importer which appeared in v3.23
- Deleting vertical trend lines now works without problems
- File open dialogs for Import ASCII, Teletext and Metastock "remember"
recently used directories
VERSION 3.23 RELEASE NOTES
Version 3.23 (Mar 21st, 2000) includes following new features and fixes (compared
to 3.22):
- New format definition commands in ASCII import:
Added $CONT, $MARKET, $GROUP, $HYBRID commands and MARKET, GROUP, INFO,
REDUCTION fields descriptions
- Added user-definable file types and formats
- Ticker aliases added (recognizable by ASCII, Metastock and Teletext importers)
- Stock information enhancements: address field in enlarged to 128 characters,
country and currency fields added (now informative only, but in future currency
information will be used in portfolio for calculations)
- Bug fix: Stock list is now refreshed after ASCII import
- Fixed some stability issues
New format definition commands in ASCII import
The following new commands are available:
- $CONT <0 or 1> - continuous quotations flag
this affects $AUTOADD 1 mode - if this is set, newly added stocks are switched
to continuous quotation mode (this means enabling candlestick charts for
example)
- $MARKET <number>
this affects $AUTOADD 1 mode - if this is specified, newly added stocks
are assigned to market with given number.
- $GROUP <number>
this affects $AUTOADD 1 mode - if this is specified, newly added stocks
are assigned to group with given number
- $HYBRID <0 or 1> - combine data in hybrid mode switch
when this flag is set, you can combine quotations from multiple files -
for example one file can contain only open prices and volume and the other
file can contain high/low/close data. Useful especially for Warsaw Stock
Exchange for combining the data from fixing and later continuous quotations.
Moreover followin new field definitions are accepted now by $FORMAT command:
- MARKET
specify a field that contains market ID (affects $AUTOADD mode only)
- GROUP
specify a field that contains group ID (affects $AUTOADD mode only)
- INFO
specify a field with additional information (WSE specific: nk, ns, rk, rs,
ok, os, zd, bd )
- REDUCTION
specify a field with reduction rate in percents (WSE specific)
User-definable file types and formats
Now AmiBroker can use not only default.format definition file but also other
user-specified files. File types, filters and format definition files are
specified in import.types file (example is included in the
update package). Now user can prepare/modify import.types
file with the description of supported ASCII formats and filters to use. The
format of import.types file is:
<Descriptive name>|<File filter>|<definition file
name>
Note vertical line characters between these three fields. Example import.types
file looks as follows:
Default ASCII (*.*)|*.*|default.format
Yahoo's CSV (*.csv)|*.csv|yahoo.format
Metastock ASCII (*.mst)|*.mst|metastock.format
Omega SC ASCII (*.txt)|*.txt|omega.format
S-Files (s*.*)|s*.*|sfile.format
C-Files (c*.*)|c*.*|cfile.format
Sharenet DAT (*.dat)|*.dat|dat.format
If such file exists you will see your types in the "Files of type"
combo-box and when you select one - appropriate filter will be used and after
selecting some files and clicking OK - importer will use specified ".format"
file.
In that way you can define as many text-based data formats as you like and
AmiBroker will be able to "understand" them all.
Ticker aliases
Now each ticker can have an alias assigned, so the AmiBroker's built-in importers
can recognize that stock by both ticker and alias names. This is useful when
you are using two data sources that are using slighty different stock naming
convention or if you want to give the stocks more intuitive name while retaining
the ability to use importers without problems.
VERSION 3.22 RELEASE NOTES
Version 3.22 (Mar 5th, 2000) includes following new features and fixes (compared
to 3.21):
- ASCII import is fixed now. Moreover the ASCII importer offers now much
more flexibility thru format definition files (see Data management
chapter of AmiBroker User's Guide for details). Example *.format files are
included in the AmiBroker main directory.
- AFL analysis tools have been moved to a new "Analysis" menu
- Tools menu has been redesigned. Now it is customizable, so user can assign
his new command/tools to the menu. You can lanuch executables (*.exe), Scripts
(*.js, *vbs), HTML web pages (*.html) and any other type of file thru this
custom tools mechanism.
- Save workspace now saves only those stocks that have changed. Save Workspace
As.. now works and saves all stocks to a new directory.
- Stock information window works better now
VERSION 3.21 RELEASE NOTES
Version 3.21 (Feb 16th, 2000) includes following fixes (compared to 3.20):
- manual quotation editor works fine now
- commentary buy/sell arrows are drawn below/above candlesticks instead
overwriting them
- deleting stock fixed
- when renaming the ticker AmiBroker checks now for already existing name
- commentary works correctly also on weekly/monthly charts now