OLD Analysis vs NEW Analysisdocs in OLE

Discussion in 'AmiBroker' started by fishmarket, Jul 15, 2013.

  1. fishmarket

    fishmarket Member

    Joined:
    Dec 2, 2012
    Messages:
    80
    Likes Received:
    4
    Trophy Points:
    8
    The old analysis object is able to set the rangefromdate and rangetodate but it said that this object is obsolete. But the new automatic analysis is using "ANALYSISDOCS", however it seems that it does not contain the properties for specifying the range to scan or explore. Is that true? If yes, what is the new advantages of using the "ANALYSISDOCS", given that Old analysis is more flexible in settings. Thanks.

    Analysis

    This object is obsolete. It is provided only to maintain compatibility with old code. Analysis object always accesses OLD Automatic Analysis.

    Properties:

    RangeMode As Long
    RangeN As Long
    RangeFromDate As Date
    RangeToDate As Date
    ApplyTo As Long

    Reference:
    http://www.amibroker.com/guide/objects.html#AnalysisDocs
     
  2. trash

    trash Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    633
    Likes Received:
    908
    Trophy Points:
    93
    OLE is not multi-threading friendly. It is old Microsoft technology.

    Old Analysis is not multi-threaded. New one is.

    And in New analysis you can save project files (.apx) that save your AFL and save all settings and for example can call them from outside. And those apx files are of type XML. So they are easily readable/editable also.


    Code:
    Hello,
    
    For what is worth - [b]it is highly discouraged to use OLE inside any AFL
    formula including scripting parts because OLE is not multithreaded.[/b]
    
    
    For popup windows there is one, easy, multi-threading friendly and script-less
    method:
    
    native AFL PopupWindow function
    http://www.amibroker.com/f?popupwindow
    
    Best regards,
    Tomasz Janeczko
    amibroker.com
    etc. etc.
     
    Last edited: Jul 15, 2013
    fishmarket likes this.
  3. trash

    trash Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    633
    Likes Received:
    908
    Trophy Points:
    93
    .............

     
    Last edited: Jul 15, 2013
    fishmarket likes this.
  4. trash

    trash Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    633
    Likes Received:
    908
    Trophy Points:
    93
  5. mastermind007

    mastermind007 Well-Known Member

    Joined:
    Dec 17, 2011
    Messages:
    2,336
    Likes Received:
    2,293
    Trophy Points:
    113
    How do I disable my entire AFL from getting embedded into the .apx file. When formula is embedded, as I amend/update/fix errors in the AFL file, .apx file continues to refer to its own embedded copy which I cannot easily update
    because all line feeds are replaced with \r\n
     
  6. trash

    trash Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    633
    Likes Received:
    908
    Trophy Points:
    93
    To update your APX file is pretty easy, IMO.

    Click File>Open... and browse to your apx file and open it.
    If the afl embedded in your apx file is equal to the afl in your formulas folder then nothing will happen (no pop up message will appear) and the analysis opens with your settings and embedded afl.

    If your afl is not equal to the afl of your formulas folder then a pop up message will appear asking you whether you want to keep the afl that is part of your formulas folder or whether you want to overwrite that afl with the afl of your project file. So since you wanna keep the AFL of your formulas folder you click the first option of that pop up message. Then the analysis window opens and then go to File>Save. That's it and your updated AFl is now part of your project file.
     

  7. mastermind007

    mastermind007 Well-Known Member

    Joined:
    Dec 17, 2011
    Messages:
    2,336
    Likes Received:
    2,293
    Trophy Points:
    113
    Trash

    Thanks for responding.

    Unfortunately, it does not do that (or maybe I've got some setting wrong)

    Suppose name of exploration afl is xyz.afl and name of analysis is xyz.apx. I run it thru WScript (.js) file. What it does is it creates another copy of AFL with name like xyz_imported.afl and continues to refer to it (as I keep editing and reediting afl and keep wondering how come none of my changes are appearing when I ran thru script.
     
  8. trash

    trash Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    633
    Likes Received:
    908
    Trophy Points:
    93
    No, it works for me. You are possibly doing something wrong.

    Do the apx file update manually. Re-read my post.
     
Loading...

Share This Page