![]() |
|
| Discuss Perl scripts for Amibroker at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hello All, Java scripts have horrible performance doing anything other than trivial jobs with Amibroker. ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
Hello All,
Java scripts have horrible performance doing anything other than trivial jobs with Amibroker. Besides I am not familiar with the language - but I know Perl. So I started out writing some utilities I needed to manage my Amibroker database. I will post them here as and when I develop them. Hopefully someone will find some use. If you are like me, coming from Unix background, and have some similar Perl scripts for Amibroker, please share. I googled and no hits. You need to have cygwin installed on your computer, along with Perl and Perl Win32 module. -- Milind |
| Sponsored Links |
|
#2
|
|||
|
|||
|
This script changes groupIds of the symbols. A textfile is required listing symbols and groupId. Sure, you can do it with organize assignments in Amibroker. But I am learning perl scripting through some simple exercises, right?
#!/bin/perl use Win32::OLE; #my $server = Win32::OLE->new('Broker.Application','Quit'); my $server = Win32::OLE->new('Broker.Application',''); my $stocks = $server->Stocks; # Do a hash of index vs ticker for ($i=0; $i < $stocks->Count; $i++) { $ticker = $stocks->Item($i)->Ticker; $iticker{$ticker} = $i; $groupId{$ticker} = $stocks->Item($i)->GroupID; } # Read file mapping new groupIds open(FIN,"<bsenseintra.txt"); while (<FIN>) { split; $ticker = $_[0]; $ngroupId = $_[1]; if (defined($groupId{$ticker})) { print "$ticker $groupId{$ticker} $_[1]\n"; $stock = $stocks->Item($iticker{$ticker}); $stock->{GroupID} = $_[1] + 0; } else { print "ticker $ticker notfound\n"; } } close FIN; exit; |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Indemnity, Disclaimer & Disclosure
Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum
Rules Disclaimer & Disclosure and indemnify Traderji.com, its
associates and related parties of all claims howsoever resulting from
the usage of the forum.
• Disclaimer: Trading or investing in stocks & commodities
is a high risk activity. Any action you choose to take in the markets
is totally your own responsibility. Traderji.com will not be liable for
any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
• Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein.
The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.