Search the web
Sign In
New User? Sign Up
amibroker · AmiBroker User's List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Python and COM   Message List  
Reply | Forward Message #109874 of 144597 |
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\\StockO\
verview.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")
--------------------------------------------------------------------------------\
----------






Wed May 2, 2007 10:07 am

dtschurr
Offline Offline
Send Email Send Email

Forward
Message #109874 of 144597 |
Expand Messages Author Sort by Date

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...
Daniel T
dtschurr
Offline Send Email
May 2, 2007
10:08 am

Try this, it worked for me: AA.Filter(0,"watchlist", 1) # use watchlist 1 jehmac ... ...
jehmac
Offline Send Email
May 3, 2007
4:44 am

Thank you very much, this solved the problem. Daniel ... AA.LoadFormula("C:\\Programme\\AmiBroker\\Formulas\\Custom\\Explorations\\StockOverview.afl")...
Daniel T
dtschurr
Offline Send Email
May 4, 2007
5:33 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help