{"action":"created","issue":{"url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/102","repository_url":"https://api.github.com/repos/mrjbq7/ta-lib","labels_url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/102/comments","events_url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/102/events","html_url":"https://github.com/mrjbq7/ta-lib/issues/102","id":148252892,"number":102,"title":"stucking few SCTR","user":{"login":"csayantan","id":18216368,"avatar_url":"https://avatars.githubusercontent.com/u/18216368?v=3","gravatar_id":"","url":"https://api.github.com/users/csayantan","html_url":"https://github.com/csayantan","followers_url":"https://api.github.com/users/csayantan/followers","following_url":"https://api.github.com/users/csayantan/following{/other_user}","gists_url":"https://api.github.com/users/csayantan/gists{/gist_id}","starred_url":"https://api.github.com/users/csayantan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csayantan/subscriptions","organizations_url":"https://api.github.com/users/csayantan/orgs","repos_url":"https://api.github.com/users/csayantan/repos","events_url":"https://api.github.com/users/csayantan/events{/privacy}","received_events_url":"https://api.github.com/users/csayantan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-14T04:59:43Z","updated_at":"2016-04-14T14:01:58Z","closed_at":null,"body":"```\r\nfrom nsepy import get_history\r\nfrom datetime import date\r\nimport pandas as pd\r\nimport requests\r\nfrom io import BytesIO \r\nimport certifi\r\nfrom dateutil.relativedelta import relativedelta\r\n#import numpy as np\r\n#import matplotlib.pyplot as plt\r\nimport datetime\r\nimport numpy as np\r\nimport matplotlib.colors as colors\r\nimport matplotlib.finance as finance\r\nimport matplotlib.dates as mdates\r\nimport matplotlib.ticker as mticker\r\nimport matplotlib.mlab as mlab\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.font_manager as font_manager\r\nimport talib as ta\r\nfrom talib import MA_Type\r\n\r\n#Long-Term Indicators (weighting)\r\n\r\n#  * Percent above/below 200-day EMA (30%)\r\n#  * 125-Day Rate-of-Change (30%)\r\n\r\n#Medium-Term Indicators (weighting)\r\n\r\n#  * Percent above/below 50-day EMA (15%)\r\n#  * 20-day Rate-of-Change (15%)\r\n\r\n# Short-Term Indicators (weighting)\r\n\r\n#  * 3-day slope of PPO-Histogram (5%)\r\n#  * 14-day RSI (5%)\r\n\r\nurl1 = 'https://www1.nseindia.com/content/indices/ind_nifty_Alpha_Index.csv'\r\ndef datainpy(url):\r\n\r\n    headers = { 'Accept' : '*/*',\r\n                'User-Agent' : 'Mozilla/5.0',\r\n                'Refers' : 'http://www.nseindia.com',\r\n                'Connection' : 'keep-alive'\r\n              }\r\n\r\n    getContents = requests.get(url,headers=headers).content\r\n    symbol_list=pd.read_csv(BytesIO(getContents))\r\n\r\n    print(symbol_list.head())\r\n\r\n    for eachSymbol in symbol_list['Symbol']:\r\n        stock = get_history(symbol = eachSymbol,\r\n                            start = date(2000,3,20),\r\n                            end = date(2016,3,30))\r\n        stock.drop_duplicates(inplace=True)\r\n        stock.drop(stock.columns[[0,1,2,7,8,10,11,12,13]], axis = 1, inplace = True)\r\n        print (stock.head())\r\n        print(stock.head())\r\n        stock.index=pd.to_datetime(stock.index)\r\n        #stock.to_csv('./HistoricalData//' + eachSymbol + '.csv' , date_format='%Y%m%d')\r\n            return stock;\r\n\r\n\r\n\r\nStockData=datainpy(url=url1)   \r\nprint(StockData.head())\r\ntype(StockData)\r\nnp.set_printoptions(precision=3)\r\n\r\nppoHist=ta.PPO(StockData['Last'].values,12,26)\r\n\r\nRSI14=ta.RSI(StockData['Last'].values,14)\r\n\r\nDMA200=ta.SMA(StockData['Last'].values,200)\r\n\r\nEMA50=ta.EMA(StockData['Last'].values,14)\r\n\r\nROC125=ta.ROC(StockData['Last'].values,125)\r\n\r\nROC20=ta.ROC(StockData['Last'].values,14)\r\n\r\nweightPctDiffOfEMA50=(((StockData['Last'].values-EMA50)*100)/StockData['Last'].values)*15\r\n\r\nweightPctDiffOfDMA200=(((StockData['Last'].values-DMA200)*100)/StockData['Last'].values)*30\r\n\r\nweightROC125=ROC125*30\r\n\r\nweightROC20=ROC20*15\r\n\r\nweightRSI14=RSI14*5\r\n\r\nweightppoHist=ppoHist*5\r\nprint(weightppoHist)\r\nSCTR=(weightPctDiffOfDMA200+weightPctDiffOfEMA50+weightROC125+weightROC20+weightppoHist+weightRSI14)/100\r\n\r\nprint(SCTR)\r\n\r\n```\r\n\r\ni have few specific questions here :1\r\n1: SCTR out put is ddifferent as expected.\r\n2.is that PPO i had considered is based on EMA.how can i get the MA_Type?\r\n3.how can i get the slope of PPO histogram ? \r\n\r\ni am looking for a report in html/csv file which will display all SCTR  for 51 stocks daily http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:sctr "},"comment":{"url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/comments/209957529","html_url":"https://github.com/mrjbq7/ta-lib/issues/102#issuecomment-209957529","issue_url":"https://api.github.com/repos/mrjbq7/ta-lib/issues/102","id":209957529,"user":{"login":"mrjbq7","id":24195,"avatar_url":"https://avatars.githubusercontent.com/u/24195?v=3","gravatar_id":"","url":"https://api.github.com/users/mrjbq7","html_url":"https://github.com/mrjbq7","followers_url":"https://api.github.com/users/mrjbq7/followers","following_url":"https://api.github.com/users/mrjbq7/following{/other_user}","gists_url":"https://api.github.com/users/mrjbq7/gists{/gist_id}","starred_url":"https://api.github.com/users/mrjbq7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrjbq7/subscriptions","organizations_url":"https://api.github.com/users/mrjbq7/orgs","repos_url":"https://api.github.com/users/mrjbq7/repos","events_url":"https://api.github.com/users/mrjbq7/events{/privacy}","received_events_url":"https://api.github.com/users/mrjbq7/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T14:01:58Z","updated_at":"2016-04-14T14:01:58Z","body":"P.S., you can see how ta-lib C library implements PPO.\r\n\r\nIt's not quite easy to read, but:\r\n\r\nhttps://sourceforge.net/p/ta-lib/code/HEAD/tree/trunk/ta-lib/c/src/ta_func/ta_PPO.c"}}