[amibroker] How to change watchlist symbols properties with AFL & OLE?

 

Hi,

In Amibroker version 6.10, I've been trying to update the properties of a group of symbols in a watchlist without success. Here's what I've tried so far:

1) In the AA window, Apply to -> Filter -> MyWatchlist, Range -> 1 recent bar(s), Scan

AFL:

AB = CreateObject( "Broker.Application" );
st = AB.Stocks( Name() );
st.MarginDeposit = 5200;

Result: Error 18. COM object variable is not initiated or has invalid type (valid COM object handle required)

If i remove the last line, the scan does not throw an error.

2) Same AA window set-up as #1

AFL:

AB = CreateObject( "Broker.Application" );
sts = AB.Stocks();
qty = sts.Count;

for( i=qty-1; i>=0; i=i-1 )
{
st = sts.item(i);
st.MarginDeposit = 5200;
}

Result: all symbols in all watchlists have been changed...in other words, the code ignored the filter setting in the AA window.

How do I isolate the symbols in the watchlist when running a scan to change only their properties?

Many thanks



__._,_.___

Posted by: davelin01@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Save time and get your email on the go with the Yahoo Mail App
Get the beautifully designed, lighting fast, and easy-to-use, Yahoo Mail app today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv