No data loaded into AmiBroker

165 views
Skip to first unread message

k.domo...@gmail.com

unread,
Feb 13, 2017, 3:45:10 AM2/13/17
to AmiBroker Developers Group
Hi,

Before jumping into implementation of real data feed I wanted to check the plugin with some fake data. For that I implemented a simple generator:

        public Quotation[] GetQuotes(string ticker, Periodicity periodicity, int limit, Quotation[] existingQuotes)
       
{
           
// TODO: Return the list of quotes for the specified ticker.
           
var quotes = new Quotation[10];


           
var date = new DateTime(2017, 1, 1);


           
for (int i=0; i < 10; i++)
           
{
               
var quote = new Quotation();
                date
.AddDays(1);
                quote
.DateTime = Convert.ToUInt64(date.Ticks);
               
var rand = new Random();
                quote
.Price = 100 + rand.Next(100);
                quotes
[i] = quote;
           
}


           
return quotes;
       
}

The plugin builds fine and is being loaded correctly, a new database is configured to use the plugin, but the fake data is not loaded at all, even after forcing the refresh (F5). There are no errors at all. Nothing happens.

Why is that?

punit kandoi

unread,
Feb 13, 2017, 3:51:31 AM2/13/17
to ami...@googlegroups.com
How getQueotes is called? its called by a timer in specific time with ticker attached to it. Put a log and check is it called for you or not?

With Best Regards
Punit Kandoi
919035307729(M)

--
You received this message because you are subscribed to the Google Groups "AmiBroker Developers Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to amidev+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/amidev.

k.domo...@gmail.com

unread,
Feb 14, 2017, 5:40:37 AM2/14/17
to AmiBroker Developers Group
The DataSource.GetQuotes is called from Plugin.GetQuotesEx, just in a default way. The Plugin.GetQuotesEx is called in a default way and it's called for sure, because when I had an exception in the DataSource.GetQuotes then there was an error message related to Plugin.GetQuotesEx displayed by AmiBroker when it tried to get the data.

How can I exactly check when  Plugin.GetQuotesEx is called? How to force calling it from Amibroker? F5 (Refresh) doesn't seem to do that.

It would be nice to have a way to log the plugin activity but it seems the log messages from Plugin are not stored in any AmiBroker log files, e.g. c:\Program Files (x86)\AmiBroker\broker.log 

Cheers,
Chris
To unsubscribe from this group and stop receiving emails from it, send an email to amidev+un...@googlegroups.com.

punit kandoi

unread,
Feb 14, 2017, 6:00:20 AM2/14/17
to ami...@googlegroups.com
you can write your own log in separate file in windows (ie open, write, close file descriptor) and print variables.

With Best Regards
Punit Kandoi
919035307729(M)

To unsubscribe from this group and stop receiving emails from it, send an email to amidev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages