[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: AmiBroker 4.60.0 BETA released



PureBytes Links

Trading Reference Links

Following is a sample template for a real time data download into 
Amibroker

#!/usr/bin/perl -w
use strict;
use SOAP::Lite;# + trace => 'debug';
use XML::DOM;
use Time::Local;use Time::localtime;
use OLE;

# Parameters
my $amiobj = CreateObject OLE "Broker.Application"|| 
die "CreateObject : $!";
my $user = "...";
my $pwd = '...';
my $brand = '...';
my $key;

# Set Hash for issues
my %issues = ('USD/JPY' => 'JPY A0-FX',
           'GBP/USD' => 'GBP A0-FX',
           'EUR/USD' => 'EUR A0-FX',
           'USD/CHF' => 'CHF A0-FX',
           'USD/CAD' => 'CAD A0-FX',
           'AUD/USD' => 'AUD A0-FX');

my $i = 0;
while($i <= 9600){

# Here you retrive quotes from your broker. My broker uses 
#WebServices and I therefore
# Use the perl module SOAP::Lite




# update Amibroker

Amibroker($amiobj,$ticker,$timda,$open,$high,$low,$close,$vol);
}



$i=$i+1;
sleep(120);
print "This is iteration: $i \n";
}
exit;



sub Amibroker{
my ($amiobj,$ticker,$time,$open,$high,$low,$close,$vol) = @_;
# add ticker
my $stock = $amiobj->stocks->add($ticker);

# add new quotation

my $quote = $stock->Quotations->Add($time);

# put data into it

$quote->{High}=$high;
$quote->{Open}=$open;
$quote->{Low}=$low;
$quote->{Close}=$close;
$quote->{Volume}=$vol;

$amiobj->RefreshAll();
print "$ticker $time $open $high $low $close $vol \n";
return;
}





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/