3D Candlesticks TOPIC
Forums › ProRealTime English forum › ProBuilder support › 3D Candlesticks TOPIC
- This topic has 61 replies, 10 voices, and was last updated 4 years ago by Bard.
-
-
01/07/2020 at 11:09 AM #116114
Is it possible to display the colours as a line instead to reduce the noise of the candlesticks? I´ve tried to simply change the “DRAWCANDLE” to “DRAWLINE” in the indicators code but it doesn´t seem to work.
I would like to have a simple line that changes colour like the candles does.
Thank you.
01/07/2020 at 3:00 PM #11614301/07/2020 at 3:25 PM #11614501/07/2020 at 4:15 PM #11614901/07/2020 at 4:17 PM #116150What do you mean? Is it not possible to simply anchor to a standard line chart?
01/07/2020 at 4:46 PM #116152oh I see now what you want. Use this version of the code:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172//05.07.2018//ALE@PROREALCODE//https://www.automatictrading.it/////////////////////////////////////////////////////////////TranslateCandle =0 // To maintain both the candles on the graph without overlapTransRange =0.01 // To choose distance of the 3D caNdleTransparency =0////////////////////////////////////////////////////////////ONCE CandleCci =1 // CANDLE + COMMODITY CHANNEL INDEX COLOURONCE CandleRsi =0 // CANDLE + RSI COLOURONCE CandleStochastic =0 // CANDLE + STOCASTIC COLOURONCE CandleCycle =0 // CANDLE + CYCLE COLOURONCE CandleDI =0 // CANDLE + DIRECTIONAL INDEX COLOUR//////////////////////////////V//////////////////////////////ONCE CciPeriod =20ONCE RsiPeriod =14ONCE N =14ONCE K =3ONCE DiPeriod =14//////////////////////////////V//////////////////////////////If CandleCci then // CANDLE + COMMODITY CHANNEL INDEX COLOURMyCci = Cci[max(1,CciPeriod)](customclose)R = (200-MyCci)G =(200+MyCci)if TranslateCandle thenDRAWCANDLE(open-(open*TransRange*pointsize), high-(high*TransRange*pointsize), low-(low*TransRange*pointsize), close-(close*TransRange*pointsize)) Coloured (R,G,0,transparency*50)elseDRAWCANDLE(open, high, low, close) Coloured (R,G,0,transparency*50)endifElsif CandleRsi then // CANDLE + RSI COLOURMyRsi = RSI[max(1,RsiPeriod)](customclose)R =50+(200-(MyRsi-50)*12)G =50+(200+(MyRsi-50)*12)if TranslateCandle thenDRAWCANDLE(open-(open*TransRange*pointsize), high-(high*TransRange*pointsize), low-(low*TransRange*pointsize), close-(close*TransRange*pointsize)) Coloured (R,G,0,transparency*50)elseDRAWCANDLE(open, high, low, close) Coloured (R,G,0,transparency*50)endifElsif CandleStochastic then // CANDLE + STOCHASTIC COLOURMyStoch = Stochastic[max(1,N),max(1,K)](customclose)R =50+(200-(MyStoch-50)*6)G =50+(200+(MyStoch-50)*6)if TranslateCandle thenDRAWCANDLE(open-(open*TransRange*pointsize), high-(high*TransRange*pointsize), low-(low*TransRange*pointsize), close-(close*TransRange*pointsize)) Coloured (R,G,0,transparency*50)elseDRAWCANDLE(open, high, low, close) Coloured (R,G,0,transparency*50)endifElsif CandleCycle then // CANDLE + CYCLE COLOURMyCycle = Cycle(customclose)R = (200-MyCycle*10)G =(200+MyCycle*10)if TranslateCandle thenDRAWCANDLE(open-(open*TransRange*pointsize), high-(high*TransRange*pointsize), low-(low*TransRange*pointsize), close-(close*TransRange*pointsize)) Coloured (R,G,0,transparency*50)elseDRAWCANDLE(open, high, low, close) Coloured (R,G,0,transparency*50)endifElsif CandleDI then // CANDLE + DIRECTIONAL INDEXMyDi = DI[max(1,DiPeriod)](customclose)R = 50+(200-MyDi*10)G =50+(200+MyDi*10)if TranslateCandle thenDRAWCANDLE(open-(open*TransRange*pointsize), high-(high*TransRange*pointsize), low-(low*TransRange*pointsize), close-(close*TransRange*pointsize)) Coloured (R,G,0,(transparency)*50)elseDRAWCANDLE(open, high, low, close)Coloured (R,G,0,transparency*50)endifendifReturn close coloured(r,g,0)and set your price setting to a line (otherwise you will still see the normal candlestick of the price chart).
01/07/2020 at 4:54 PM #116154This is exactly what I was looking for, thank you for the quick help Nicolas!
02/04/2020 at 9:56 PM #118683Hi there,
I used a customised RSI Dominant Cycle and standard RSI but although the code looks okay (?), when I launched it on the price chart it now sits just below the current prices/candlesticks?
So I have two price series candlesticks, one green/white and the other the 3D candles! Any ideas? For those without the code it’s on this forum somewhere but here it is:DC RSI1234Period = CALL "Ehler's Dominant Cycle Modify"DC = MAX(8, MIN(Round(Period),48) )myRSI = RSI[DC](close)Return myRSI coloured(0,255,255) as "RSIdc"Ehler's Dominant Cycle Modify123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051//PeriodDC= 20 // original by John EhlersPeriodDC= MAX(8, MIN(DC, 48))IF barindex = 1 THENBP= 0.01DC= 20ELSIF Barindex >= 2 THENREM ---------------------------------------------REM Highpass Filter and BP or SuperSmoother Filter together form a Roofing FilterREM ---------------------------------------------HPPrice= closeHPPeriod= PeriodDCHPBandwidth= 0.3 // 0.7 original Dominant Cycle Measured, 0.3 (0.10-0.50) from Roofing FilterHPalpha= (COS(0.25*HPBandwidth*360/HPPeriod) + SIN(0.25*HPBandwidth*360/HPPeriod)-1) / COS(0.25*HPBandwidth*360/HPPeriod)HP= (1+HPalpha/2)*(HPPrice-HPPrice[1]) + (1-HPalpha)*HP[1]BPPrice= HPBPPeriod= PeriodDCBPBandwidth= HPBandwidthbeta= COS(360/BPPeriod)gamma= 1/COS(360*BPBandwidth/BPPeriod)BPalpha= gamma - SQRT(gamma*gamma-1)BP= 0.5*(1-BPalpha)*(BPPrice-BPPrice[2]) + beta*(1+BPalpha)*BP[1] - BPalpha*BP[2]REM ---------------------------------------------REM Calculation of Dominant Cycle by counting Zero crossing of BPREM ---------------------------------------------CountPrice= BPDC= DC[1]DC= MAX(6, DC)counter= counter + 1IF CountPrice CROSSES OVER 0 OR CountPrice CROSSES UNDER 0 THENDC= 2*counterThrashH= 1.11 // original 1.25IF 2*counter > ThrashH*DC[1] THENDC= ThrashH*DC[1]ENDIFThrashL= 0.90 // original 0.8IF 2*counter < ThrashL*DC[1] THENDC= ThrashL*DC[1]ENDIFcounter= 0ENDIFENDIFDC= MAX(8, MIN(DC, 48))RETURN DC coloured(0,255,255) as "DomCyclePeriod"//, BP coloured(0,255,0,255) as "BandPass"Cheers,
Bard
02/05/2020 at 10:04 AM #11870602/05/2020 at 11:36 AM #118716Oh I see now what you mean.. sorry. The candlesticks must have Open/High/Low/Close as reference to perfectly match the ones from the platform. So there must be something that explain this offset in the 3D candlesticks code you are using!
1 user thanked author for this post.
02/05/2020 at 1:47 PM #118740I know I’m a veteran “newbie” coder but even I figured out the 3D needs to be applied to the Price chart! 😀 I commented out the “Dominant Cycle RSI” code just now and left the generic RSI code and it looks great! (pls see screenshot – this image shows the generic RSI working okay)
Problem is my DC RSI is applied to the Close but still sits below the price series? Can you see anything in my DC RSI code that looks like it could be causing this problem? When I try Settings: Apply to Low or any other combination like (H+L+C)/3 the extra price series of candles doesn’t respond and stays in exactly the same position?
Cheers Nicolas.
02/06/2020 at 4:57 PM #118853If I need to reference the O/C/H/L when I’m using myRSI = RSI [DC] (close) and HPPrice= close which also refernces the closing price (from Ehler’s Dominant Cycle indicator), I’m still not sure how to go about this to get it to work? I mean, “close” is already referenced, so what’s the problem?
123Elsif CandleDCRsi then // CANDLE + DC RSI COLOURMyDCRsi = CALL "RSI - Dominant Cycle"DCRsi = MyDCRsi[max(1,PeriodDC)]12HPPrice= closeHPPeriod= PeriodDC02/14/2020 at 2:00 PM #119633This setting fixes overlapping On Price candles: TransRange =0.0001 (instead of default setting = 0.01)
Hi @Nicolas, can you figure out why this warning comes up (pls see screnshot) when I add an implied volatility indicator to the 3D, code even though I have added the parameters [22,60] into that 3D candle code?
123456MyIVStoch = CALL "Implied Volatility Stochastic"MyIVStoch = CALL "Implied Volatility Stochastic"[22,60]IVStoch = MyIVStoch // Two external vars [22,60], Short IV + Long IV PeriodR =50+(200-(IVStoch-50)*6)etc etc...Much appreciated,
Cheers Bard
02/14/2020 at 2:31 PM #11963602/15/2020 at 4:49 PM #119693Thanks Vonasi, Line 1 was actually buried far higher up in my indicator code but I should have spotted this in my posting above. Line 1 has been removed.
Now my indicator “Implied Volatility Stochastic” actually in fact has 7 values returned (at the end of it’s code) but I only made two of them actual variables, [22, 60]. However now the warning is now telling me that the “Implied Volatility Stochastic” returns 7 values but your code needs 1.
One? Shouldn’t it be two, as in [22, 60]?
And if it is one value which do I use, 22 or 60?
Cheers.
-
AuthorPosts
Find exclusive trading pro-tools on