Issue with the timeframe at the end of a tick.
Forums › ProRealTime English forum › ProBuilder support › Issue with the timeframe at the end of a tick.
- This topic has 8 replies, 2 voices, and was last updated 1 year ago by Nicolas.
-
-
04/18/2023 at 3:23 PM #213446
Hi
I want to display the bollinger bands of the 5000 ticks time frame in my current time frame (500ticks).
At each close after startup everything shifts, I tried to search on the forum to change the mode but nothing, anyone have an idea ?Kind regards
TIMEFRAME(5000ticks)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586TIMEFRAME(5000ticks,UPDATEONCLOSE)s=2p1=18p2=19p3=20p4=21p5=22//p1moyenneBollinger1 = AVERAGE[p1](CLOSE)IF BARINDEX >= p1-1 THENsumy21 = 0sumy1 = 0FOR i = 0 TO p1-1sumy21 = sumy21 + SQUARE(CLOSE[i])sumy1 = sumy1 + CLOSE[i]NEXTecartType1 = SQRT(sumy21 / p1 - SQUARE(sumy1 / p1))ELSEecartType1 = UNDEFINEDENDIFbollSup1 = moyenneBollinger1 + s * ecartType1bollInf1 = moyenneBollinger1 - s * ecartType1//p2moyenneBollinger2 = AVERAGE[p2](CLOSE)IF BARINDEX >= p2-1 THENsumy22 = 0sumy2 = 0FOR i = 0 TO p2-1sumy22 = sumy22 + SQUARE(CLOSE[i])sumy2 = sumy2 + CLOSE[i]NEXTecartType2 = SQRT(sumy22 / p2 - SQUARE(sumy2 / p2))ELSEecartType2 = UNDEFINEDENDIFbollSup2 = moyenneBollinger2 + s * ecartType2bollInf2 = moyenneBollinger2 - s * ecartType2//p3moyenneBollinger3 = AVERAGE[p3](CLOSE)IF BARINDEX >= p3-1 THENsumy23 = 0sumy3 = 0FOR i = 0 TO p3-1sumy23 = sumy23 + SQUARE(CLOSE[i])sumy3 = sumy3 + CLOSE[i]NEXTecartType3 = SQRT(sumy23 / p3 - SQUARE(sumy3 / p3))ELSEecartType3 = UNDEFINEDENDIFbollSup3 = moyenneBollinger3 + s * ecartType3bollInf3 = moyenneBollinger3 - s * ecartType3//p4moyenneBollinger4 = AVERAGE[p4](CLOSE)IF BARINDEX >= p4-1 THENsumy24 = 0sumy4 = 0FOR i = 0 TO p4-1sumy24 = sumy24 + SQUARE(CLOSE[i])sumy4 = sumy4 + CLOSE[i]NEXTecartType4 = SQRT(sumy24 / p4 - SQUARE(sumy4 / p4))ELSEecartType4 = UNDEFINEDENDIFbollSup4 = moyenneBollinger4 + s * ecartType4bollInf4 = moyenneBollinger4 - s * ecartType4//p5moyenneBollinger5 = AVERAGE[p5](CLOSE)IF BARINDEX >= p5-1 THENsumy25 = 0sumy5 = 0FOR i = 0 TO p5-1sumy25 = sumy25 + SQUARE(CLOSE[i])sumy5 = sumy5 + CLOSE[i]NEXTecartType5 = SQRT(sumy25 / p5 - SQUARE(sumy5 / p5))ELSEecartType5 = UNDEFINEDENDIFbollSup5 = moyenneBollinger5 + s * ecartType5bollInf5 = moyenneBollinger5 - s * ecartType5return bollSup1 AS "Boll1+", bollInf1 AS "Boll1-", bollSup2 AS "Boll2+", bollInf2 AS "Boll2-", bollSup3 AS "Boll3+", bollInf3 AS "Boll3-", bollSup4 AS "Boll4+", bollInf4 AS "Boll4-", bollSup5 AS "Boll5+", bollInf5 AS "Boll5-"04/19/2023 at 7:59 AM #21346904/19/2023 at 12:57 PM #21350004/19/2023 at 1:07 PM #21350204/19/2023 at 1:18 PM #21350604/19/2023 at 1:35 PM #21350904/19/2023 at 3:56 PM #213521The big “shift” that you observe is normal in the history. Indeed, if we calculate a data with the help of X candles (period = X), then as soon as a new candlestick is opened (here the 5000-ticks), we remove the candlestick 1 to replace it by the new candlestick that is created in real time, so according to the price difference we can observe big steps.
On the other hand, in real time, on the time-decorrelated charts, there is a problem on the current candlestick, this problem is known and is being solved. Note that this problem exists only for charts not correlated to time (like ticks, or volume candlesticks for example).1 user thanked author for this post.
04/19/2023 at 4:24 PM #213523I understood, so no solution.
I thought the 5000 ticks was streamer on the 200 for example. But if it is recalculated with the current candle it is logical that I have large gaps, I thought the updateonclose would solve this problem but no.
Do you know if this is something that is taken into account quickly? because even on version 12 it is the same. To summarize, the “timeframe” just doesn’t work with ticks and volume.Any way to get around this ?
Thx you for your help
04/20/2023 at 8:15 AM #213530The big “shift” that you observe is normal in the history. Indeed, if we calculate a data with the help of X candles (period = X), then as soon as a new candlestick is opened (here the 5000-ticks), we remove the candlestick 1 to replace it by the new candlestick that is created in real time, so according to the price difference we can observe big steps.
What I describe above is the normal behavior (understand logical) and it is not an issue. When you calculate a 20-period moving average, when a new candle open, the first candlestick close of the serie is removed and replace with the new one in order to get only the 20 last (including current one) candlesticks values. You cannot spot any difference (gap) when applying the MA on a chart, but by observing its calculation in an smaller timeframe that difference is easily spottable. Hope I’m clear.. 🙂
On the other hand, in real time, on the time-decorrelated charts, there is a problem on the current candlestick, this problem is known and is being solved. Note that this problem exists only for charts not correlated to time (like ticks, or volume candlesticks for example).
Even with UPDATEONCLOSE, there is indeed a problem on current candlestick only, I have no ETA about the fix but should be soon.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on