kylejusticemagnuson / pyti Goto Github PK
View Code? Open in Web Editor NEWPython library of various financial technical indicators
License: MIT License
Python library of various financial technical indicators
License: MIT License
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")
Stochastic needs high and low inputs. For some reason issue #16 was closed even though it was never fixed.
Williams %R (quite a similar indicator to the above also needs high and low inputs, plus a rolling lookback period.
And tests would need to be re-done too.
hi there .
when i type to my code
df['ema26']=ema((df['close']).tolist(),26)
and check it from tradingview ema 26 prices are not the same that i ve got. how can i fix this problem ?
First of all, thank you for the awesome library
I noticed that stochastic oscillator needs h,l,c
http://incrediblecharts.com/indicators/stochastic.php
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:stochastic_oscillator_fast_slow_and_full
For some reason it seems that you are not using high and low but rather the highest and lowest values from the close. Am I missing something? Would appreciate some clarification on the same
def aroon_up(data, period):
return (1 + data.rolling(period).apply(lambda x: pd.Series(x).idxmax(skipna = True))) / period * 100
def aroon_down(data, period):
return (1 + data.rolling(period).apply(lambda x: pd.Series(x).idxmin(skipna = True))) / period * 100
data must be a pandas.Series object - we could wrap it as pd.Series(data) first.
Current code executes at around 8 seconds on 16285 rows of data.
Code above executes at around 1.36 seconds
Hello there, would you add the Heikin Ashi to the collection formula
regards,
Hello,
thanks for this job first of all.
I would just like to have more info about this point in EMA:
returns += (row['difference (pips)'] * pip_cost * lot_size)
If I well understand being pip_cost < 1 it substract 12% from returns because this is the cost per transaction. So the pip cost would be ( 1 - pip_cost ). Is it rigth?
second question: how should be interpreted a return of 10 in a given year ?
the capital invested is unclear so I am a little uncertain about this point.
Thank you for any help
Hi!
First of all, amazing library! You made a great job here.
My question is regards stockRSi indicator, that only returns NaN for me.
I was planning to use it for the bitcoin trades, but the coins that I'm using have very small values (this is the values of converted_to_list[1]):
<class 'tuple'>: (0.01411, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.01411, 0.01411, 0.01411, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.0141, 0.01411, 0.01411)
And then, independent of the period that I pass, the values are always NaN.
I'm calling: stochrsi.stochrsi([i * 1000 for i in converted_to_list[1]], len(converted_to_list[1]))
I tried to multiple the values by 1000, to make then more like your examples, but still gettin NaN.
Any idea why?
Many thanks,
Joao
hello,
is it possible to have a simple pandas wrapper around all these functions? To make it easier to integrate with people, who use pandas dataframes a lot?
I know it's just nicety and I'm happy to provide these, if this is desired.
kind regards
Good day, please can you write more detailed manual how to backtest all your indicator together via tox?
For example, i download your project to PC as zip file, then unzip.
Then go to destination folder, and run there cmd, in cmd i write what?
'tox' -> i get an error: ""tox" is not internal or external
command, operable program or batch file."
I feel I have to do this another way, please give a hint
Hi Kyle, great job and really helpful
would you give PSAR a try? It's really struggling for me, i gave some attempts but unsuccessful I may admit.
Cheers¡
Hello, just a question about the price channels. The output is a number, but what does that number mean? There is no documentation in the readme or online.
hi, is planned to apply all PR and fix for a new version (on github/pip)?
The ATR indicator implementation in PYTI gives results that differ from all 4 variants (RMA/SMA/EMA/WMA) of Tradingview's ATR.
I know last commit to this lib was done 2 years ago, but maybe someone knows the solution to this problem.
Hello,
I'm struggling a bit here since the documentation is sparse - trying to use the ultimate oscillator but the values I get back are typically ranging anywhere up to ~200. This seems wrong to me, or am I misinterpreting the output?
I am using stock tick price for the oscillator like this:
low = dataframe['BidPrice'].groupby(pd.Grouper(freq='1Min')).min()
close = dataframe['AskPrice'].groupby(pd.Grouper(freq='1Min')).last()
uo = ultimate_oscillator(close,low)
plt.plot(uo)
plt.show()
relative_strength_index calculation is not correct; there is huge difference with actual RSI
When the ADX function is called and run it provides unreasonably high numbers, cuts out on data gaps and never comes back, as opposed to NaN and then going back to evaluated numbers. Not sure what is going on, but something is not right. Perhaps the issue is with another one of the functions ADX uses
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.