Try this, it worked for me:

AA.Filter(0,"watchlist", 1) # use watchlist 1

jehmac



--- In [email protected], "Daniel T" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Any Python gurus out there ? I'm trying to use AmiBroker with Python
> through COM (see code below). All works well so far, only the
> AA.Filter command gives problems. The following error message appears:
> 
>   File "C:\Dokumente und Einstellungen\Daniel\Eigene
> Dateien\Trading\python\indatc.py", line 11
>     AA.Filter(0,"watchlist") = 1
> SyntaxError: can't assign to function call
> 
> I'm using AmiBroker 4.90 rc2 and ActiveState Python 2.5 on WinXP 
> 
> Any suggestions?
> 
> Cheers,
> 
> Daniel
> 
> Python Script code:
> -----------------------------------------------------
> import win32com.client
> 
> AB = win32com.client.Dispatch("Broker.Application")
> AA = AB.Analysis;
>
AA.LoadFormula("C:\\Programme\\AmiBroker\\Formulas\\Custom\\Explorations\\StockOverview.afl")
> AA.ClearFilters()
> AA.RangeMode = 1   # n last quotes
> AA.RangeN = 1    # nr of quotes
> AA.ApplyTo = 2     # Use filter
> AA.Filter(0,"watchlist") = 1
> AA.Explore()
> AA.Export("C:\\Dokumente und Einstellungen\\Daniel\\Eigene
> Dateien\\Trading\\python\\test_export.csv")
>
------------------------------------------------------------------------------------------
>


Reply via email to