kylejusticemagnuson / pyti

Python library of various financial technical indicators
MIT License
646 stars 169 forks source link

triple_exponential_moving_average #11

Closed alikopasa closed 5 years ago

alikopasa commented 6 years ago

Hello,

Below code is an indicator at Tradingview. For 13 period your triple_exponential_moving_average is the same as tradingview. But for 34 it is not same. What will be the problem? Kindly, can you help me please?

Regards, Ali

//////////////////////////////////////////////////////////// // Copyright by HPotter v1.0 16/05/2014 // This study plots the TEMA1 indicator. TEMA1 ia s triple MA (Moving Average), // and is calculated as 3MA - (3MA(MA)) + (MA(MA(MA))) //////////////////////////////////////////////////////////// study(title="TEMA1", shorttitle="TEMA", overlay = true ) Length = input(26, minval=1) xPrice = close xEMA1 = ema(xPrice, Length) xEMA2 = ema(xEMA1, Length) xEMA3 = ema(xEMA2, Length) nRes = 3 xEMA1 - 3 xEMA2 + xEMA3 plot(nRes, color=blue, title="TEMA1")

kylejusticemagnuson commented 6 years ago

Hi Ali,

Looking at both formulas used I'm not sure why they would differ. I will have to spend some more time investigating when I have some free time.

Thanks for bringing up the Issue.

kylejusticemagnuson commented 6 years ago

Hi @alikopasa

I've run my tema indicator against the Tradingview indicator you posted for both periods 13 and 34 and have found that for both periods the output is exactly the same.

What python version are you using? Could you also post the price data that you are using and the outputs for the 34 periods?

Thanks

alikopasa commented 5 years ago

Hi @kylejusticemagnuson

Sorry for delay. Thank you very much for your support.