The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Amibroker::OLE::APXCreator - A simple interface to create .apx extension file for accessing Amibroker analysis document from external scripts.

VERSION

Version 0.03

SYNOPSIS

        use Amibroker::OLE::APXCreator;
        my $new_apx_file = create_apx_file( {
                                        afl_file   => 'test_afl.afl',
                                        symbol     => 'ADANIPORTS-I',
                                        timeframe  => '20-minute',
                                        from       => '01-09-2015',
                                        to         => '20-09-2015',
                                        range_type => 0,
                                        apply_to   => 1
                                    } );

DESCRIPTION

This module helps in creating apx file (i.e. file with .apx extention), which is the basic input file for running Amibroker analysis externally through OLE automation.

Creating this file automatically is a challenge as Amibroker is very sensitive to any changes with respect to apx file. If there is even a space missed in creating it, then it will not process it. So, to make life easier, this module handles the creation of the file as required by the amibroker.

NOTE: Please ensure to provide all the required necessary fields.

        use Amibroker::OLE::APXCreator;
        my $new_apx_file = create_apx_file( {
                                        afl_file   => 'path_to_the_location_of_the_afl_file',
                                        symbol     => 'symbol_name',
                                        timeframe  => 'timeframe',
                                        from       => 'from_date',
                                        to         => 'to_date',
                                        range_type => range_type_in_number,
                                        apply_to   => apply_to_in_number
                                     } );

REQUIRED PARAMETERS

afl_file

Complete Path to the AFL file, that you need to backtest or optimize or scan etc. Eg: afl_file => 'C:/Amibroker/Stratergy/Release/IBM.afl'

symbol

The Symbol name should match with the symbol names in the Amibroker database Eg: symbol => 'IBM-I' or symbol => 'IBM' (The name should exactly match with your database symbol)

timeframe
    Default available timeframe with Amibroker.
    yearly    
    quarterly  
    monthly   
    weekly    
    daily     
    day/night 
    hourly     
    15-minute 
    5-minute 
    1-minute   
    3-minute 
    7-minute  
    10-minute
    12-minute 
    20-minute 

If you want to have your custom defined timeframe then you need to update here Amibroker -> Tools -> Preferences -> Intraday Tab -> Custom Time Intervals

from
    from date, Eg: from => '01-12-2010' (for 1st December 2010 date)
                   from => '2010-12-01' (for 1st December 2010 date)
                   from => '2010-01-12' (for 1st December 2010 date)
                   from => '12-01-2010' (for 1st December 2010 date)
                   from => '12-2010-01' (for 1st December 2010 date)
Date format should match your Amibroker date format : Usually it is windows system time settings
Please check your amibroker date format and send the appropriate date format
to
    to date, Eg: to => '31-05-2015' (for 31st May 2015 date)
Date format should match your Amibroker date format : Usually it is windows system time settings
Please check your amibroker date format and send the appropriate date format
apx_file

complete path of the apx file where you want to create this file. Eg: apx_file => 'C:/IBM.apx'

range_type
    Range in Amibroker analysis refers to
        'All Quotes'      = 0  
        '1 recent bar(s)' = 1
        '1 recent day(s)' = 2
        'From-To-dates'   = 3
    So provide range number accordingly
apply_to
    Apply the settings to
           '*All Symbols' = 0
           '*Current'     = 1
           '*Filter'      = 2

OPTIONAL PARAMETERS

periodicity

This module assumes that there is no change in the amibroker custom time interval settings. i.e Amibroker -> Tools -> Preferences -> Intraday Tab -> Custom Time Intervals.

Amibroker assigns a value to every intervals Eg: (Below are the default Amibroker intervals provided and their default values) yearly = -4 quarterly = -3 monthly = -2 weekly = -1 daily = 0 day/night = 1 hourly = 2 15-minute = 3 5-minute = 4 1-minute = 5 3-minute = 10 7-minute = 11 10-minute = 12 12-minute = 13 20-minute = 14

If you happen to change the custom time intervals, then the amibroker default values may change. In that case you have to find out the actual value of the custom interval and pass as the parameter.

    Eg:
    periodicity => -5 
    (you can find this out by manually saving the apx file and checking the periodicity field)

How to create apx file manually:

  • Open Amibroker -> Analysis window -> Settings

  • Edit settings as per your requirement

  • Menu-> File-> Save_AS -> select (.apx extenstion)

For more infor on apx file, check this forum : http://amibrokerforum.proboards.com/thread/57/analysis-project-files-apx

AUTHOR

Babu Prasad HP, <bprasad at cpan.org>

BUGS

Please report any bugs or feature requests to bug-amibroker-ole-apxcreator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Amibroker-OLE-APXCreator. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Amibroker::OLE::APXCreator

You can also look for information at:

ACKNOWLEDGEMENTS

I would like to thank Mr.Pannag M for supporting me in writing this module.

LICENSE AND COPYRIGHT

Copyright 2015 Babu Prasad HP.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.