Dukascopy
 
 
Wiki JStore Search Login

Confusing OHLC values between the current candle and 1-shift candle
 Post subject: Confusing OHLC values between the current candle and 1-shift candle Post rating: 1   New post Posted: Tue 15 Oct, 2013, 16:24 

User rating: 1
Joined: Mon 05 Aug, 2013, 22:37
Posts: 33
Location: SwitzerlandSwitzerland
Hello fellow VJForexers,

I am lost again. It's been a long journey trying to figure out what the "shift" function in the Get Historical Candle component exactly does!! For 5 min candle period, I was trying to get the OHLC of current and the OHLC of the previous candle. The followings are the results:

1) OHLC values display in the separate "variable" fields are not the same as the ones that are displayed by the OHLC Index generated by the chart (please see the red against another red rectangles)
2) This is also true for volume as well as time (date is the only variable which displays the same value) (please see the yellow highlights - the candle times were correctly displayed in the charts as 10:40 and 10:45 for the required 5-minute candle. They were confusingly displayed as 11:25 and 12:49 - with different time and the 24 minute candle-period!!)

Image

Or am I doing something dump? :mrgreen:

Thanks,


Attachments:
Shift_Learning.vfs [22.45 KiB]
Downloaded 235 times
Shift.PNG [82.04 KiB]
Downloaded 461 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: Confusing OHLC values between the current candle and 1-shift candle Post rating: 0   New post Posted: Tue 15 Oct, 2013, 18:08 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings :mrgreen:

I tested the output of all:

I always recommended to use "GetHistoricalCandle" in order to get the last candle's info.
Apparently the "Last Ask(Bid) Candle" info is not working properly. We already know about that. We are trying to fix that asap.

When speaking about the candle time: Unfortunately it is always taking the local time (your time), not GMT.

In order to minimize errors please use GetHistoricalCandle (s) when you want info about last candle(s).


 
 Post subject: Re: Confusing OHLC values between the current candle and 1-shift candle Post rating: 0   New post Posted: Wed 16 Oct, 2013, 21:55 

User rating: 1
Joined: Mon 05 Aug, 2013, 22:37
Posts: 33
Location: SwitzerlandSwitzerland
Hi Dirk..
Thanks... In fact, as you can see from my vfs file, I used the GetHistoricalCandle with the Shift set at 1. I wanted to know if the OHLC values provided by that setting of shift-1 and so used the OHLC (see my chart under PREVIOUS CANDLE heading) provided by the auto created variable candle16. Unfortunately, the values displayed are not the same as the values displayed on the actual chart and the OHLC index on the chart. This implies that I cannot build a reliable strategy based on this.

Understand that the OHLC from the last bid candle is not working. So, I won't compare it with the actual chart for now.

Thought of the same on GMT and local time. Wish there is a functionality on the platform to switch between GMT and local.

Thanks again,


 
 Post subject: Re: Confusing OHLC values between the current candle and 1-shift candle Post rating: 0   New post Posted: Thu 17 Oct, 2013, 11:28 
User avatar

User rating: 0
Joined: Wed 24 Oct, 2012, 17:12
Posts: 20
Location: France, Paris
Hi traders,

I n you read your post very carefuly, because I use in my strategy the object GetHistoryCandles("p"=period, "s"=shift) in order to retrieve the "p" last candles.

I'm very confused because :

- If you set up your GetHistoryCandles with a period = 20 and the shift = 0, you retrieve in fact 21 candles. But one of these candles is not yet fully formed : the current candle. And thus, you can't retrieve the close, high and low informations concerning the current candle because the vary every tick.


=> Can you explain me why it's possible to shift 0 the block GetHistoryCandles, considering that you can retrieve the information of the current Candle with the method OnCandle/lastAskcandle

=> if you want to compare the previous and current SMA values, you use a shift = 0 to retrieve the CURRENT SMA and shift = 1 to retrieve the PREVIOUS SMA. But here I'm very confused, because for me, if you retieve the current SMA with shift = 0, you can't have the real value a the SMA, because the SMA is calculate with a candle who is not fully formed (the current candle). CAn you explain me why I'm confused ?

Regards and good trades !


 

Jump to:  

  © 1998-2025 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