fxcm / ForexConnectAPI

Designed to trade, retrieve live/history price. Intended to be used to build auto-trading robots, custom trading on FXCM accounts.
132 stars 47 forks source link

O2GMarketDataSnapshotResponseReader returns wrong data #6

Closed jjqqkk closed 3 years ago

jjqqkk commented 3 years ago

Hi,

When querying monthly (M1) price history, O2GMarketDataSnapshotResponseReader returns a duplicated March-1 bar. I paste some test results:

// EURUSD 1.180170, Thu Apr 01 05:00:00 CST 2021 1.194940, Mon Mar 01 06:00:00 CST 2021 1.172940, Mon Mar 01 06:00:00 CST 2021 1.206960, Mon Feb 01 06:00:00 CST 2021 1.212750, Fri Jan 01 06:00:00 CST 2021 1.221520, Tue Dec 01 06:00:00 CST 2020 1.192270, Sun Nov 01 05:00:00 CST 2020 1.164450, Thu Oct 01 05:00:00 CST 2020 1.171860, Tue Sep 01 05:00:00 CST 2020 1.193560, Sat Aug 01 05:00:00 CST 2020 1.177490, Wed Jul 01 05:00:00 CST 2020 1.123260, Mon Jun 01 05:00:00 CST 2020

// AUDJPY 84.229000, Thu Apr 01 05:00:00 CST 2021 84.537000, Mon Mar 01 06:00:00 CST 2021 84.043000, Mon Mar 01 06:00:00 CST 2021 82.084000, Mon Feb 01 06:00:00 CST 2021 79.825000, Fri Jan 01 06:00:00 CST 2021 79.498000, Tue Dec 01 06:00:00 CST 2020 76.564000, Sun Nov 01 05:00:00 CST 2020 73.531000, Thu Oct 01 05:00:00 CST 2020 75.490000, Tue Sep 01 05:00:00 CST 2020 78.101000, Sat Aug 01 05:00:00 CST 2020 75.551000, Wed Jul 01 05:00:00 CST 2020 74.493000, Mon Jun 01 05:00:00 CST 2020

// UKOil 62.703000, Thu Apr 01 05:00:00 CST 2021 69.214000, Mon Mar 01 06:00:00 CST 2021 63.007000, Mon Mar 01 06:00:00 CST 2021 64.339000, Mon Feb 01 06:00:00 CST 2021 55.025000, Fri Jan 01 06:00:00 CST 2021 51.420000, Tue Dec 01 06:00:00 CST 2020 47.630000, Sun Nov 01 05:00:00 CST 2020 37.850000, Thu Oct 01 05:00:00 CST 2020 41.985000, Tue Sep 01 05:00:00 CST 2020 45.590000, Sat Aug 01 05:00:00 CST 2020 43.645000, Wed Jul 01 05:00:00 CST 2020 41.675000, Mon Jun 01 05:00:00 CST 2020

for (int i = 1; i <= 12; i++) {
  double value = respReader.getBidClose(size - i);
  Date date = respReader.getDate(size - i).getTime();
  System.out.printf("  %f, %s\n", value, date);
}
fxcm-dhalpert commented 3 years ago

please try it with the latest FC API version 1.6.4 https://fxcodebase.com/wiki/index.php/Download

jjqqkk commented 3 years ago

OK thanks a lot. btw, my code works correctly on a Linux box, while the previous test was run on macOS.

On Linux, the data of EURUSD is correct.

[1] 1.180850, Wed Mar 31 21:00:00 UTC 2021 [2] 1.172940, Sun Feb 28 22:00:00 UTC 2021 [3] 1.206960, Sun Jan 31 22:00:00 UTC 2021 [4] 1.212750, Thu Dec 31 22:00:00 UTC 2020 [5] 1.221520, Mon Nov 30 22:00:00 UTC 2020 [6] 1.192270, Sat Oct 31 21:00:00 UTC 2020 [7] 1.164450, Wed Sep 30 21:00:00 UTC 2020 [8] 1.171860, Mon Aug 31 21:00:00 UTC 2020 [9] 1.193560, Fri Jul 31 21:00:00 UTC 2020 [10] 1.177490, Tue Jun 30 21:00:00 UTC 2020 [11] 1.123260, Sun May 31 21:00:00 UTC 2020 [12] 1.111460, Thu Apr 30 21:00:00 UTC 2020

Will upgrade to 1.6.4.