I have a script that parses a QS formula that I use to export (transformations of) daily data that I've been using happily for quite a while now. The relevant bit is as follows:
// formula and symbolName are defined before this snippet
int timeframe = 1;
ParserTool ptool = new ParserTool();
Parser p = ptool.CreateParser(formula);
Report report = p.Parse(symbolName, timeframe, true);
DateTime[] dates = report.GetDateArray();
// ... and so on
Recently I've gotten some intraday data and wanted to use the same script to export transformations of it. From what I read I thought that I would just change the timeframe to something like -300 (for 5 minute bars) and things would work fine. However, when I set a negative timeframe (for intraday data) the parser behaves as if timeframe == 1. Diiffering daily intervals do work (eg, timeframe = 5 produces weekly data as expected).
I've searched everywhere and can't find any other settings that might need to change for parser to work in intraday mode. What am I missing? I can verify that I do have intraday data for the symbols that I'm working with.
When I set the isHistorical parameter to 'false' I get no output (report.NbQuotes == 0), so unfortunately that isn't working. Let me add some more information that might help troubleshoot:
* I'm trying to run the Script on historical 5 minute quotes that I've previously imported.
* As far as I can tell the Quotes data are fine; they look good in the Database Editor and I can view intraday charts of these symbols and run formulas on those charts with no trouble.
* I can run Simulator reports on intraday timeframes on these symbols with no trouble.
* I do not have have intraday data to match all of my daily data, for example for IBM I have about ten years of of intraday data but over 30 years of daily bars. Also, intraday data for IBM ends prior to the current date, but I have daily data to the current date.
Setting the "isHistorical" to false will tell QuantShare to get intraday data instead of EOD data. Make sure you are putting a positive time frame (300) and make sure you are testing a ticker symbol that has intraday data.
Ah, wonderful, that did the trick. I'd tried isHistorical == true with positive and negative timeframes, isHistorical == false with negative timeframes, but somehow managed never to plug in a positive timeframe with isHistorical == false. Of course it makes perfect sense now that you point it out XD
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.