| || |
get history price from datetime to datetime
hi, currently i were try to get history price from "2012-05-01 00:00:00" to "2012-05-22 23:59:59". But after i run the sample code C:\Program Files (x86)\Candleworks\ForexConnectAPI\samples\java\SimpleSamples\GetHistPrices, what i get at below...
So, may i know where do i did incorrectly..
Connecting to MICR564176001 *** http://www.fxcorporate.com/Hosts.jsp DEMO
Market data snapshot for EUR/USD, timeframe t1, from Tue May 01 00:00:00 SGT 2012, to Tue May 22 23:59:59 SGT 2012, maximum Bars 300
Date=5/22/12 11:58 PM,BidOpen=1.273,BidHigh=1.273,BidLow=1.273,BidClose=1.273,AskOpen=1.274,AskHigh=1.274,AskLow=1.274,AskClose=1.274
Date=5/22/12 11:59 PM,BidOpen=1.273,BidHigh=1.273,BidLow=1.273,BidClose=1.273,AskOpen=1.274,AskHigh=1.274,AskLow=1.274,AskClose=1.274
NOTE : API Version : FX Connect 1.0.3 (Beta)
This is an issue in the sample for version 1.0.3. Please see the corrected version in the attachment.
Last edited by Natalya; 05-24-2012 at 08:21 AM.
hi, thanks for ur sample. But what i get still same and from datetime is "05/02/11 03:00:00" to datetime is "05/02/11 03:01:00". anyway, i also upload my log file for refrence. hope that can help.
Originally Posted by Natalya
Could you please also try the modified sample from the attachment and post the received log (please change the login and password in build.xml before using)
Hi Nat, lis there a similar sample for excel vba please.
we will write sample and give it to you tomorrow.
Here is the 'Get historic prices' sample for Excel vba.
I am also running into issues with the "gethistprices" sample. I am using the classes that Natalya updated and posted earlier in this thread. In Natalya's gethistprices zip file, I'm having issues with the Main class.
Here's the issue I'm running into (I javadoced in my code and I'm just copying and pasting that javadoc):
This error brings up another concern: when I added my external JAR files, the library seemed to import ok but it didn't seem to configure properly. When I attempt to go into the fxcore2 library in Eclipse and view the code of the classes, the classes aren't available for viewing. A page comes up in Eclipse that says "Class File Editor" and "Source not found". There's a button that says "Attach Source.." and when I try to attach it, there is no .java or .class file for the particular class. I have already tried reinstalling the Java API and no luck with that.
* Java error at the mSession = 02GTransport.createSession() line:
* Exception in thread "main" java.lang.UnsatisfiedLinkError: no gstool2 in java.library.path
* at java.lang.ClassLoader.loadLibrary(Unknown Source)
* at java.lang.Runtime.loadLibrary0(Unknown Source)
* at java.lang.System.loadLibrary(Unknown Source)
* at com.fxcore2.O2GTransport.<clinit>(Unknown Source)
* at com.fxcore2.tests.Main.main(Main.java:130)
* (Main.java.130) or line 130 was originally the
* mSession = 02GTransport.createSession() line before I inputed this javadoc.
Any help or input would be appreciated!
Regarding my previous post, I sought out additional help and learned the fxcore2 classes are licensed and therefore hidden due to copyright (or similar) reasons.
What's strange (to me) is the mSession = O2GTransport.createSession();, the line in my code that's giving me an error in the "gethistprices" sample main class, works just fine in the "login" sample main class. In other words, the same code for the mSession field works when I login, but it doesn't work when trying to pull historical data.
I continue to get the error displayed in the javadoc in the previous post.
Any ideas or possible solutions would be greatly appreciated. Thanks.
It looks like the working directory was not set properly. To learn how to do this, please read How to Start Using ForexConnect in Java