Dukascopy
 
 
Wiki JStore Search Login

GetHistoricalCandle doesn't work
 Post subject: GetHistoricalCandle doesn't work Post rating: 0   New post Posted: Wed 30 Sep, 2015, 11:31 

User rating: 0
Joined: Mon 12 Jan, 2015, 16:12
Posts: 11
Location: United States, Virginia
Dear Support Team,

I wrote a simple strategy in order to see the GetHistoricalCandle function "in action". But something is wrong because the strategy didn't make any trade.

Where did I make a mistake?

Thank you in advance.


Attachments:
Steev1.vfs [29.18 KiB]
Downloaded 56 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: GetHistoricalCandle doesn't work Post rating: 1   New post Posted: Wed 30 Sep, 2015, 15:08 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

This is actually due to that the last candle data (OHLC) are not yet retrieved when the candle starts. When the flow reaches the IF block after 10mn (or any candle period defined), the last candle (which is the current candle under construction) did not get assigned yet with its data. This is mainly due to the way the candles are built technically speaking.
If you need to compare 2 candle data, it is more accurate to do it using 2 "finished" candles (i.e Shift 1 and Shift 2 for instance) therefore, you are sure to use candle's high price that is permanently assigned and not a high price that still fluctuating along with the candle construction till the candle's period is over and the final data is attributed (we're talking here about High, low and close prices as the open price is the first variable to be assigned).

Hope this clarifies things ...
Cheers


 
 Post subject: Re: GetHistoricalCandle doesn't work Post rating: 0   New post Posted: Thu 01 Oct, 2015, 11:17 

User rating: 0
Joined: Mon 12 Jan, 2015, 16:12
Posts: 11
Location: United States, Virginia
Yes, I understood.
Thank you very much for your help.


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com