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

Re: AmiBroker 4.07.4 beta released



PureBytes Links

Trading Reference Links

Bravo !!
Stable and great .

Stephane

> Hello,
> 
> A new beta version of AmiBroker has just been released.
> 
> You can download it from the following locations:
> http://www.amibroker.com/bin/ab4074beta.exe
> http://www.amibroker.net/bin/ab4074beta.exe
> ftp://ftp.amibroker.com/pub/ab4074beta.exe
> ftp://ftp.amibroker.net/pub/ab4074beta.exe
> 
> (390KB self-extracting archive)
> 
> Please read the following read-me document for the list of new 
features and changes.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> 
> AmiBroker 4.07.4 Beta
> July 28, 2002 23:10 
> 
> THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS. 
> 
> Backup your data files and entire AmiBroker folder first!
> 
> INSTALLATION INSTRUCTIONS
> 
> IMPORTANT: This archive is update-only. You have to install full 
version 4.00 first. 
> 
> Just run the installer and follow the instructions. 
> 
> Then run AmiBroker. You should see "AmiBroker 4.07 beta" written in 
the About box.
> 
> IMPORTANT NOTE for users who modifed built-in indicators or 
interpretations: please backup broker.bcharts file BEFORE installing 
this update and restore this file in order to save your modifications 
from being overwritten by the file that comes with this package.
> 
> Click here for COMMENTS and USAGE HINTS
> 
> 
> CHANGES FOR VERSION 4.07.4 (as compared to 4.07.3)
> 
> a.. fixed bug causing sometimes crash when Interpretation window 
was open, QuickAFL was enabled 
> b.. fixed problem occuring when Nth greater than 1 was used with 
PeakBars, TroughBars 
> c.. '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)
> 
> a.. fixed bug causing crash when LastValue() was used and 
QuickAFL enabled 
> b.. 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 
> c.. reduced memory usage of Equity() function
> 
> CHANGES FOR VERSION 4.07.2 (as compared to 4.07.1)
> 
> a.. fixed bug causing crash when using formula with Equity() 
function and QuickAFL enabled 
> b.. fixed bug causing crash when using variable-period HHV,LLV 
functions and QuickAFL enabled 
> c.. fixed invisible short/cover arrows problem (arrows are 
shifted into visible area now if there is not enough space) 
> d.. 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 
> e.. new Status() fields "range...." now work also in Scan and 
Exploration modes 
> f.. text columns in Explorations are sorted correctly by click on 
the header 
> 
> CHANGES FOR VERSION 4.07.1 (as compared to 4.07.0)
> 
> a.. Equity plot does not generate alerts anymore 
> b.. 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 
> c.. small bug fix in displaying Data tooltips and QuickAFL enabled
> 
> CHANGES FOR VERSION 4.07.0 (as compared to 4.06.1)
> 
> a.. help window is detached from application window 
> b.. arrows generated by commentary window are refreshed properly 
when new rt bars arrive (arrows are shown for active symbol only) 
> c.. e-mail alerts: support for servers requiring SMTP 
authentication. Supported methods:
> AUTH LOGIN (most popular), POP3-before-SMPT (popular), CRAM-MD5, 
LOGIN PLAIN 
> d.. sound alerts: ability to test sound output in Tools-
>Preferences->Alerts 
> e.. AFL error box popping up in AA when RT data are flowing does 
not cause a crash 
> f.. 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 
> g.. drawing date/time axis improved 
> h.. drawing built-in charts optimized for very long histories 
> i.. 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 )
> 
> 
> j.. 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 
> k.. 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 
> l.. 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. 
> m.. added bitwise-and '&' and bitwise-or '|' operators to AFL 
language (note that floating point number are converted (truncated) 
to integers before applying bitwise operators) 
> n.. new pre-defined constants for more descriptive code
> 
> 
> CHANGES FOR VERSION 4.06.1 (as compared to 4.06.0)
> 
> a.. fixed tab order in Analysis window (Range radio buttons) 
(appeared in 4.06beta) 
> b.. fixed problem with using AFL.Var with uppercase letters 
(appeared in 4.06beta) 
> c.. fixed problem with using gSite.SetVariable / 
gSite.GetVariable with uppercase letters (appeared in 4.06beta) 
> d.. fixed problem with exploration (appeared in 4.06beta) 
> e.. fixed small display issue in the data tooltips (-1e10 
displayed instead of {EMPTY}) 
> f.. disabled QuickAFL until all issues are resolved
> 
> 
> CHANGES FOR VERSION 4.06.0 (as compared to 4.02.1)
> 
> a.. New Interpretation window (View->Interpretation) displays 
chart-sensitive commentaries 
> b.. 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. 
> c.. Automatic Analysis window now allows periodical scans (Scan 
every n minutes) 
> d.. new Check feature in Automatic Analysis window allowing you 
to find out if your formula references future quotes or not. 
> e.. Data tips show indicator values now and can show also 
interpretations of indicators 
> f.. n QuickAFL technology implemented (Tools->Preferences-
>Miscellaneous -> Enable QuickAFL for indicators) - provides >10x 
speed-up in custom indicator charting with long histories (>1000 
bars) 
> g.. ability to modify / overlay additional graphs over built-in 
charts (Indicator Builder->Built-in tab) 
> h.. ability to create your own interpretation commentaries in 
Indicator Builder 
> i.. new AFL functions: 
> a.. AlertIf( BOOLEAN_EXPRESSION, command, text, type = 0, flags 
= 1+2+4+8, lookback = 1 ); 
> b.. 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 
> c.. GetBaseIndex() - retrieves symbol of base index as defined 
in Symbol->Categories. To plot base security chart just use graph0 = 
Foreign( GetBaseIndex(), "C" ); 
> d.. EnableTextOutput( flag ) - enables output of strings into 
commentary / interpretation window. When flag = 0 no string is 
printed into commentary window, 1 - strings are printed 
> e.. _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.
> 
> 
> j.. filtering weekends (File->Database Settings->Intraday 
settings->Filter weekends) 
> k.. Commentary and Interpretation window are automatically 
refreshed when charts are refreshed 
> l.. OLE automation Quotation.Date (GetDate) includes time also 
> m.. AFL engine symbol lookup optimized so AFL engine initializes 
2x faster and symbol lookup is also faster 
> n.. 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)
> 
> a.. 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)
> 
> a.. added ability to filter after-hours trading (File->Database 
Settings->Intraday settings : Filter after-hours box plus definable 
session start/end (per-workspace settings) 
> b.. 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. 
> c.. 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) 
> d.. fixed a bug in intraday -> daily time compression 
> e.. fixed "no trade list" display of Exposure and RAR 
> f.. when writing the formula to HTML report < and > characters 
are encoded to &lt; and &gt; to ensure that formula is not truncated. 
> g.. "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. 
> h.. fixed bug in list view sorting of numeric columns containing 
small values 
> i.. fixed crash occuring when Equity() function was called from 
Commentary window 
> j.. fixed display of huge numbers in the chart grid 
> k.. added option to color up/down (traditional) bars : 
Preferences -> Main chart 
> l.. other minor fixes
> 
> CHANGES FOR VERSION 4.01.0 (as compared to 4.00.0)
> 
> a.. Customisable N-tick charts in Real Time version (see 
Preferences -> Intraday tab) and new View->Intraday menu 
> b.. Ability to backtest custom N-tick bars 
> c.. 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. 
> COMMENTS and USAGE HINTS:
> 
> 
> Charting engine improvements
> 
> Now built-in charts are drawn using even more optimized routines 
that results in significant speed up of chart drawing when you 
display charts for symbols with more than 30000 quotes. Also QuickAFL 
is enabled again (and hopefully bug-free) that gives similar speed up 
for custom indicators. In addition to that 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
> 
> 
> Drawing date/time axis works also better now.
> 
> New constants and bitwise operators
> 
> AmiBroker now includes many pre-defined constants that can make 
your AFL code easier to read. For example you can use the following 
statements using constants instead of just numbers:
> 
> Plot( MACD()-Signal(), "Histogram", colorRed, styleThick | 
styleHistogram );
> 
> ApplyStop( stopTypeTrailing, stopModePercent, 10, True ); 
> 
> 
> Using for example colorRed constant will give red color always 
(regardless of what palette settings are). Also note that now you can 
combine chart styles with a bitwise-or operator |. Although you can 
also combine styles with just + (addition) it is better to use | 
operator because when you combine the same style twice by mistake 
(styleHistogram | styleHistogram) it still works correctly showing 
histogram chart ( 2 | 2 = 2 ). Using + in that case will give 2 + 2 = 
4 and this is the code for thick style. Complete list of constants is 
included later in this document.
> 
> In addition to bitwise-or operator | AmiBroker has now also bitwise-
and operator: &. These operators work on binary representation of 
numbers. Note that floating point number are converted (truncated) to 
integers before applying bitwise operators. Each bit is and-ed or or-
ed accordingly. For example 9 is represented by 1001 binary code and 
5 is represented by 0101. Bitwise-or is 1101 (13 in decimal) and 
bitwise-and is 0001 (1 in decimal). Here come a few samples showing 
how it works:
> 
> 255 & 64 gives 64
> 255 | 64 gives 255
> 1 | 2 | 4 | 8 gives 15
> 15 | 7 gives 15
> 
> 
> New P&F-like graph style
> 
> AmiBroker now features new graph style - 8192 (stylePointAndFigure) 
that enables to write formulas that "emulate" point and figure 
charts. A sample code is included later in this document. Now just a 
few comments. New style uses all open, high, low and close arrays. 
(OHL indirectly). High array should be set to bar's highest point, 
Low array should be set to bar's lowest point. The Close-Open 
distance defines box size. If Close > Open then X symbols are drawn, 
otherwise O symbols are drawn. Both Close and Open arrays should be 
inside H-L range but only the difference between Open and Close 
really matters for drawing P&F bars. Please note also that for proper 
looking P&F charts the H-L distance should be divisible by box size 
(C-O distance) without remainder.
> 
> AFL new functions and improvements
> 
> 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
> 
> 
> For example the system that buys today and sells tommorrow can now 
be universally coded as follows:
> 
> buy = Status("barinrange");
> sell = Ref( buy, -1 );
> 
> (previously one needed to modify such formula depending on range 
settings)
> 
> LastValue( array, forcelastbar = 0 ) function has one additional 
(optional) parameter: 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. A new 
function called SelectedValue( array ) gives selected bar value in 
Commentary, Interpretation and custom Indicators.
> 
> A new RMI( periods = 20, momentum = 5 ) function implements 
Altman's Relative Momentum Index (S&C Feb 1993)
> 
> A new Interval() function returns bar interval in seconds
> tick bars = 0
> 5 sec bars = 5
> 1 min bars = 60
> hourly bars = 3600
> daily bars = 86400
> weekly bars = 430000 (43e4)
> monthly bars = 2160000 (216e4)
> 
> 
> 
> Alerts enhanced
> 
> Now "E-mail" page in Tools->Preferences has been renamed 
to "Alerts" and allows to define e-mail account settings, test sound 
output and define which parts of AmiBroker can generate alerts via 
AlertIF function. 
> 
> E-mail setting page now allows to choose among most popular 
authorization schemes like: AUTH LOGIN (most popular), POP3-before-
SMPT (popular), CRAM-MD5, LOGIN PLAIN.
> 
> "Enable alerts from" checkboxes allow you to selectively 
enable/disable alerts generated by Automatic analysis, 
Commentary/Interpretation and custom indicators. 
> 
> Alert output window now has an additional column that shows the 
source of alert - if this is Automatic Analysis, Commentary or one of 
your custom indicators. This makes it easier to find out which part 
of AmiBroker generates alerts.
> 
> 
> AlertIF function
> 
> AlertIF function is similar to WriteIF. But instead of just writing 
the text to the output window (commentary/interpretation) it allows 
to:
> 
> a.. direct the customized text to "alert output" window, 
> b.. make a sound (just by computer beeper or from .WAV file) 
> c.. send an e-mail 
> d.. launch any external application 
> The syntax is as follows:
> 
> AlertIf( BOOLEAN_EXPRESSION, command, text, type = 0, flags = 
1+2+4+8, lookback = 1 );
> 
> 1. BOOLEAN_EXPRESSION is the expression that if evaluates to True 
(non zero value) triggers the alert. If it evaluates to False (zero 
value) no alert is triggered. Please note that only lookback most 
recent bars are considered.
> 
> 2. The command string defines the action taken when alert is 
triggered. If it is empty the alert text is simply displayed in the 
Alert output window (View->Alert Output). Other supported values of 
command string are:
> 
> SOUND the-path-to-the-WAV-file
> EMAIL
> EXEC the-path-to-the-file-or-URL <optional args>
> 
> SOUND command plays the WAV file once. 
> 
> EMAIL command sends the e-mail to the account defined in the 
settings (Tools->Preferences->E-mail). The format of the e-mail is as 
follows:
> 
> Subject: Alert type_name (type) Ticker on Date/Time
> Body: text
> 
> EXEC command launches external application or file or URL specified 
after EXEC command. <optional args> are attached after file name and 
text is attached at the end
> 
> 3. Text defines the text that will be printed in the output window 
or sent via e-mail or added as argument to the application specified 
by EXEC command
> 
> 4. Type defines type of the alert. Pre-defined types are 0 - 
default, 1 - buy, 2 - sell, 3 - short, 4- cover. YOu may specify 
higher values and they will get name "other"
> 
> 5. Flags control behaviour of AlertIF function. This field is a 
combination (sum) of the following values:
> ( 1 - display text in the output window, 2 - make a beep (via 
computer speaker), 4 - don't display repeated alerts having the same 
type, 8 - don't display repeated alerts having the same date/time) By 
default all these options are turned ON.
> 
> 6. lookback parameter controls how many recent bars are checked
> 
> Examples:
> 
> Buy = Cross( MACD(), Signal() );
> Sell = Cross( Signal(), MACD() );
> Short = Sell;
> Cover = Buy;
> 
> AlertIF( Buy, "EMAIL", "A sample alert on "+FullName(), 1 );
> 
> AlertIF( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 
2 );
> 
> AlertIF( Short, "EXEC Calc.exe", "Launching external application", 
3 );
> 
> AlertIF( Cover, "", "Simple text alert", 4 );
> 
> Note EXEC command uses ShellExecute function and allows not only 
EXE files but URLs too.
> 
> Interpretation window
> 
> Interpretation window (View->Interpretation) shows chart-sensitive 
commentaries. To add a interpretation just use Indicator builder and 
add commentary code after the code for the indicator. Please note 
that to get the best performance you should use the following 
optimization hint: after your indicator code and before commentary 
code you should add the following line:
> 
> //--Indicator-End-- 
> ( two slashes (comment start), two dashes, Indicator-End and two 
dashes ). When the parser is evaluating the formula in 
the "indicator" mode it stops there, so commentary code is not 
executed and it saves time. When parser is in other modes - entire 
formula is parsed/executed.
> 
> Example:
> 
> Plot( Close, "Price", -1, 64 ); Plot( SAR( Prefs( 50 ), Prefs( 
51 ) ), "SAR",-17, 8+16 ); //--Indicator-End--"The Parabolic SAR 
provides excellent exit points. ";
> "You should Close long positions when the price falls below 
> the SAR AND Close Short positions when the price rises above the 
SAR.";
> WriteIF( graph1 > Close, "SAR is above close", "SAR is below 
close" );
> 
> Data tips
> 
> Data tips now show the values of indicators. Just hover your mouse 
over the chart wait a while and data tip will show indicator values 
at point beneath the mouse.
> 
> QuickAFL
> 
> The QuickAFL technology can give 10x or more speed up when plotting 
custom indicators for symbols with more than 1000 bars of data. The 
exact speed-up depends on various factors. When evaluating the 
formula AmiBroker performs a heuristic guess how many bars of past 
and future data are required to evaluate the formula. Then only this 
required amount is used so when you have a lot of data (say >50000 
data bars) and view only recent 500 bars AFL (if it is possible) 
evaluates your formula only for the last few hundreds of bars which 
is much faster. Please note that if you are using the following 
functions: Cum(), AccDist(), OBV(), Chaikin(), NVI(), Highest(), 
Lowest(), PVI(), ADLine(), AddToComposite(), Equity() AmiBroker can 
not use this optimization technique because these function perform 
calculations that require all previous bars. Please note that AFL can 
not currently guess the number of bars required by JScript/VBScript 
parts of your code nor code included in plugin DLLs. If you are using 
any you should take a look at SetBarsRequired function that allows to 
instruct AmiBroker how many bars are really needed. Use 
SetBarsRequired( 1000000, 1000000 ) - if you want all previous and 
all future bars (old behaviour).
> 
> Please also note that this techniques is currently enabled ONLY for 
custom indicators and new Interpretation window. All other AFL tools 
(Automatic Analysis, Commentary) are NOT affected.
> 
> "Check" feature in Automatic Analysis
> 
> As a side effect of the technique of finding out the number of bars 
required to calculate given formula, I have added a "Check" feature 
that parses the formula in AA window and displays the message telling 
you what is AmiBroker guess. It warns you if your formula references 
future quotes. Note that for performance reasons the number of 
past/future quotes required to calculate given formula is very 
approximate. The algorithm is actually quite simple. Every built-in 
function in AmiBroker "knows" how many past and/or future bars it 
requires to calculate properly.
> 
> For example Ref( Close, -4 ) "knows" that it requires 4 past bars, 
and MA( Close, 15 ) "knows" that it requires 15 past bars. When 
checking the formula AmiBroker sums up this individual numbers, so 
for the following formula:
> 
> Ref( Cross( MA( Close, 15 ), MA( Close, 25 ) ), -4 );
> AmiBroker will tell that you need 44 past quotes (15+25+4). This is 
more than it is really needed, but this is a "safe" guess.
> 
> Other features
> 
> See the changes list
> 
> Sample P&F code showing how to use new graph styles
> 
> //// P&F sample code
> // Originally written by Mirat Dave
> // Modified and adopted for AmiBroker 4.07 by Tomasz Janeczko
> // Disclaimer:
> // This code is not supposed to be fully working P&F chart
> // and it may (and probably will) give inaccurate output.
> // The ONLY purpose of this code is to show how to use new graph 
style 8128 (stylePointAndFigure)
> // available in AmiBroker 4.07 that plots P&F-style O and X symbols.
> // True P&F charting will be available in later versions of 
AmiBroker.
> 
> SetBarsRequired(100000,100000);
> AvgTR = LastValue(ATR(50));
> EnableScript("jscript");
> <%
> High = VBArray( AFL( "High" ) ).toArray();
> Low = VBArray( AFL( "Low" ) ).toArray();
> ATR = AFL("AvgTR");
> 
> 
> PFO = new Array();
> PFC = new Array();
> 
> Box = 0.7*ATR; // rma
> 
> // initialize first element
> j = 0;
> PFO[j] = Box*Math.ceil(High[0]/Box);
> PFC[j] = Box*Math.floor(Low[0]/Box);
> down = 1; // By default the first bar is a down bar.
> up = 0;
> swap = 0;
> 
> 
> // perform the loop that produces PF Chart
> for( i = 1; i < High.length; i++ )
> {
> Reverse = Box * 3; // reversal requirement
> 
> if( Low[i] < PFC[j] - Box && down)
> {
> PFC[j] = Box*Math.floor(Low[i]/Box);
> }
> else
> {
> if( High[i] >= PFC[j] + Reverse && down)
> {
> j++;
> swap = 1;
> PFO[j] = Box*Math.floor(Low[i]/Box);
> PFC[j] = Box*Math.ceil(High[i]/Box);
> }
> }
> 
> if( High[i] > PFC[j] + Box && up)
> {
> PFC[j] = Box*Math.ceil(High[i]/Box);
> }
> else
> {
> if( Low[i] <= PFC[j] - Reverse && up)
> {
> j++;
> PFC[j] = Box*Math.floor(Low[i]/Box);
> PFO[j] = Box*Math.ceil(High[i]/Box);
> swap = 1;
> }
> }
> 
> if( swap )
> {
> swap = 0;
> if( up )
> {
> up = 0;
> down = 1;
> }
> else
> {
> up = 1;
> down = 0;
> }
> }
> }
> 
> delta = High.length - j;
> 
> AFL.Var("PFO") = PFO;
> AFL.Var("PFC") = PFC;
> AFL.Var("Box") = Box;
> AFL.Var("delta") = delta;
> 
> %>
> 
> PFO = Ref( PFO, -delta );
> PFC = Ref( PFC, -delta ) ;
> /* High-Low range sets the height of the P&F bar */
> H = Max(PFO,PFC);
> L = Min(PFO,PFC);
> O = PFO;
> /* the difference between Open and Close should be set to box size 
*/
> /* the sign decides if X or O are plotted */
> C = O + Box * IIf( PFC > PFO, 1, -1 ); 
> 
> Graph0Style = 64+8192; // new style is used here
> Graph0BarColor = IIf( PFC > PFO, 5, 4 );
> Graph0 = C;
> 
> 
> List of AFL constants
> 
> True = 1
> False = 0
> 
> stopTypeLoss = 0 
> stopTypeProfit = 1 
> stopTypeTrailing = 2 
> 
> stopModeDisable = 0 
> stopModePercent = 1 
> stopModePoint = 2 
> stopModeRisk = 3 
> 
> colorCustom1 = 0 
> colorCustom2 = 1 
> colorCustom3 = 2 
> colorCustom4 = 3 
> colorCustom5 = 4 
> colorCustom6 = 5 
> colorCustom7 = 6 
> colorCustom8 = 7 
> colorCustom9 = 8 
> colorCustom10 = 9 
> colorCustom11 = 10 
> colorCustom12 = 11 
> colorCustom13 = 12 
> colorCustom14 = 13 
> colorCustom15 = 14 
> colorCustom16 = 15 
> 
> colorBlack = 16 
> colorBrown = 17 
> colorDarkOliveGreen = 18 
> colorDarkGreen = 19 
> colorDarkTeal = 20 
> colorDarkBlue = 21 
> colorIndigo = 22 
> colorDarkGrey = 23 
> 
> colorDarkRed = 24 
> colorOrange = 25 
> colorDarkYellow = 26 
> colorGreen = 27 
> colorTeal = 28 
> colorBlue = 29 
> colorBlueGrey = 30 
> colorGrey40 = 31 
> 
> colorRed = 32 
> colorLightOrange = 33 
> colorLime = 34 
> colorSeaGreen = 35 
> colorAqua = 35 
> colorLightBlue = 37 
> colorViolet = 38 
> colorGrey50 = 39 
> 
> colorPink = 40 
> colorGold = 41 
> colorYellow = 42 
> colorBrightGreen = 43 
> colorTurquoise = 44 
> colorSkyblue = 45 
> colorPlum = 46 
> colorLightGrey = 47 
> 
> colorRose = 48 
> colorTan = 49 
> colorLightYellow = 50 
> colorPaleGreen = 51 
> colorPaleTurquoise = 52 
> colorPaleBlue = 53 
> colorLavender = 54 
> colorWhite = 55 
> 
> styleLine = 1
> styleHistogram = 2
> styleThick = 4
> styleDots = 8
> styleNoLine = 16
> styleLog = 32
> styleCandle = 64
> styleBar = 128
> styleNoDraw = 256
> styleStaircase = 512
> styleSwingDots = 1024
> styleNoRescale = 2048
> styleNoLabel = 4096
> stylePointAndFigure = 8192
> 
> HOW TO REPORT BUGS
> 
> If you experience any problem with this beta version please send 
detailed description of the problem (especially the steps needed to 
reproduce it) to bugs@xxxx