Coming soon: Easy sequencing in AmiBroker 6.40.2

There is a new feature coming in AmiBroker 6.40.2 that is intended to enhance usability of Analysis window and it is Easy Sequencing

As you know, AmiBroker already allows you to run batches that consist of many different actions including Analysis Scan/Exploration/Backtest/Optimization.

Starting from AmiBroker 6.40.2, you will be able to run sequences of actions via single click in Analysis windows alone.

This new feature is not intended to replace batches but to augment available choices and allow "quick hacking" so you can run sequences directly in Analysis window without resorting to using full-fledged batches.

There will be a new #pragma sequence statement that will define sequence of actions to be performed and a toolbar button "Run Sequence" to allow you to run sequence of actions via single click.

This would allow you to say create composites and later run exploration that uses those composites all via single click on "Run Sequence" button

The code would look like this:

// the statement below defines sequence of actions
#pragma sequence(scan,exploration)

if( Status("action") == actionScan )
{
   AddToComposite( .. );
   StaticVarAdd(...);
  _exit(); // quick exit in scan mode
}

// below is exploration code 
// that can use composites / static vars created in scan step
Filter = ...
AddColumn( ... ); 
22 Likes

This sounds very promising. Thanks @Tomasz

My hope (as it was with batch files) is that this will minimize the time it takes to set up my analysis workflow every time I open AMI broker, because it's all lost when you close.

Batch files are useful but limited as we can't fine tune what happens during a backtest (that I know of).

It is not "lost when you close". Just save project file and all Analysis setup is saved and can be loaded back using File->Open.

1 Like

True. I guess that could be a solution to batch files without in depth options.

As far as layout goes: You still have to manually open those files each time. Not conducive if you were trying to go headless and have some sort of power outage protection, for instance. The last state is not saved, saveable, or even batchable (that I know of).

My guess at the easiest semi-auto solution would be a radio button in batch > Load Project for "open in new tab"? I don't know the source code or c++ though so might be completely wrong.

@Tomasz, are you still planing to release 6.40.02 in December? It has couple of features that helps me with year end database maintenance.

Yes, as promised, 6.40.2 will arrive in December 2021. Today I have finished updating AFL function reference (docs): AFL Function Reference

What's new in AmiBroker 6.40

Highlights of version 6.40

Version 6.40 brings lots of new functionality especially with regards to the formula language and performance . There are hundreds of new features and changes to existing functionality as compared to version 6.30, listed in detail in "Release Notes" document in AmiBroker directory. Below is just a short list of few of them:

  • QuickGFX - brand new chart rendering engine delivering upto 100x performance boost as compared to GDI rendering. GDI rendering speed also improved upto 2x.

    In-house developed QuickGFX direct rendering technology completely bypasses Windows GDI and offers amazing 10x-100x performance gain as compared to GDI renderingTo enable QuickGFX experimental tech go to Tools->Preferences, "Miscellaneous" tab, click "Experimental: Use QuickGFX render" and press "Apply" or "OK"
    You can see when it is enabled, chart timing footnote (when enabled) will say "QuickGFX render ...ms" instead of "GDI render ...ms"This is PROFESSIONAL edition feature only. Users of Standard version would need to purchase upgrade in order to use this feature.

  • Automatic Analysis improvements

    • Easy Sequencing of multiple Analysis actions via #pragma sequence(scan,exploration) and new "Run Sequence" button without need to write batches. Allows for example single click two-step analysis runs creating composites or static variables in first step and using them in second step
    • Backtester - added "Max. position value" option in the settings allowing to specify maximum dollar value of position. Zero (0) means no maximum. Positions larger will be shinked (if shrinking is enabled) or won't be entered at all (if shrinking is disabled)
    • huge speedups in running large explorations, dark theme and 5x speed up for rendering huge list views like (as compared to 6.31)
  • AmiBroker Formula Language new functions / features

    • FindIndex( array, value, start_from = 0, dir = 1 ) - find index of array item matching specified value
    • BarsSinceCompare( past, comparison, current ) - for every bar, compare past array values with current bar value and return the number of bars since last time comparision was true
    • InternetSetHeaders( "headers" ) - set custom HTTP headers for subsequent web requests
    • InternetSetOption( option, value ) - set HTTP option for internet session
    • InternetPostRequest(''http://url_to_your_web_resource'', data, flags = 0) - send HTTP Post request to Internet web resource (URL)
    • MxCopy() - in-place copy of rectangular blocks from one matrix to the other (copy portions of one matrix to the other matrix)
    • _exit() - gracefully ends AFL execution at the point of the call
    • InternetGetStatusCode() - returns HTTP status code of last InternetOpenURL or InternetPostRequest call
    • Chr( code ) returns string representing single character of given ascii code
    • GetObject( path, class ) providing functionality equivalent to JScript GetObject and VBScript GetObject
    • GuiSendKeyEvents("ED") - register given characters to be sent as Gui event when keyboard key is pressed. GuiGetEvent will return code == notifyKeyDown and id of given character, for example id == 'D' for D letter
    • inverf(x) - inverse of erf function
    • erf(x) - computes Error function Error function - Wikipedia
    • SafeDivide( x, y, valueifzerodiv )- safe division that handles division by zero using special handling (replace result with user-defined value)
    • new Javascript engine (Chakra) featuring native JSON support (EnableScript("chakra"))
  • AmiBroker Formula Language improvements, enhancements and fixes

    • exponentation operator is made 50-100x faster in cases of small integer exponents of 2, 3, 4 and 5
    • GuiSetText() function avoids sending change notifications to prevent update loops
    • ADX function vectorized (2x faster than before)
    • added extra parameter for Error() function to stop execution
    • internal function signatures changed to allow flexible ordering of arguments regardless of their type and varargs with less overhead
    • GfxDrawImage with PNG images exclusive file lock removed
    • parser warns if empty body is used in 'for' or 'while' statements
    • support for gzip and deflate compression in Internet functions
    • plugin interface backward compatibility with changing function signatures
    • more runtime checks to prevent user errors and other fixes
  • Batch window new features / improvements

    • Clipboard Cut/Copy/Paste implemented in batch editor
    • Edit->Delete (from main menu) and Edit-Delete All implemented for completeness
    • list view uses virtual mode now (owner data)
    • added "add results to watchlist" action / WatchlistAddResults
    • added "clear watchlist" action / WatchlistClear
    • added "comment" action
    • added optional parameter to Data Import ASCII command to allow specify format definition file
    • added optional parameter to Execute and Wait command to specify current working directory for command
    • added optional parameter to Export to File / Export walk-forward to file to specify column separator in CSV files
      -optional parameter defines the column SEPARATOR used for export. Only single character is used. When it is not supplied, comma is used.
  • AFL editor enhancements

    • call tips (parameter information tooltips) now provide extra description about the function and its parameters (as of v6.39 only 20 functions have this extra info)
    • debugging session is automatically terminated with appropriate notice when user attempts to edit the code during debugging (this saves mouse clicks that were needed to stop debug session in order to edit)
    • previously when no text was selected and Prettify Code was choosen, the message box caused main frame to get focus instead of focus staying in AFL frame. Fixed
    • when an runtime error is detected debugging session the message bar shows now number of detected errors (as it did previously during normal "verify"
    • when dark mode list views are used watch window default text color was black making it hardly visible, changed to white
  • User Interface new features and improvements:

    • Dark theme for all owner-draw list views (NOT in dialogs) now feature customizable theme (currently available "system (light) theme" and "black theme") - go to Tools->Customize, "Appearance" tab, "Dark mode for listviews" checkbox
    • 5x speed up for rendering huge list views (bypassing Windows rendering)
    • Preferences: added Text Tool font setting independent from Axis font (Preferences->Miscellaneous page)
    • Charts: improved text tool with per-study selectable font size
    • Parameter names are not truncated in HighDPI screens
  • Database improvements

    • new 8-digit ICB structure implemented: https://www.ftserussell.com/data/industry-classification-benchmark-icb
    • Database Purify is 10x faster
    • OLE: added Stock.Quotations.Adjust function to perform adjustments programmatically OLE: added Stock.Quotations.Adjust() function. long Adjust(BSTR pszFieldList, float fMultiplier, float fOffset, DATE dDateTime, boolean bBefore)
12 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.