From 87dd53c9220ebb7a8eedc68d13967dd5d1fe44cd Mon Sep 17 00:00:00 2001 From: Redsandy <34872843+Redsandyg@users.noreply.github.com> Date: Sat, 23 Apr 2022 20:28:33 +0300 Subject: [PATCH] Delete Ind_bollingerBands.py --- Ind_bollingerBands.py | 109 ------------------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 Ind_bollingerBands.py diff --git a/Ind_bollingerBands.py b/Ind_bollingerBands.py deleted file mode 100644 index da9ef81..0000000 --- a/Ind_bollingerBands.py +++ /dev/null @@ -1,109 +0,0 @@ -import pandas as pd -import datetime -import numpy as np -import plotly as pl -import plotly.graph_objs as go -import matplotlib.pyplot as plt -import math -import scipy -import random -import statistics - - -import datetime -import matplotlib.dates as mdates -import matplotlib.pyplot as plt - -import mplfinance as mpf - -import plotly -#import plotly.plotly as py -import plotly.graph_objs as go -# these two lines allow your code to show up in a notebook -from plotly.offline import init_notebook_mode, iplot -from plotly.subplots import make_subplots -init_notebook_mode() - -import CoreTraidMath -import CoreDraw - - -class BB: - - def __init__(self, base_df,options={}, needFig=False,showOnlyIndex=True,drawFig=False): - self.base_df=base_df.reset_index(drop=True) - self.options=options - self.ans=self.getAns() - if needFig: - self.fig=self.pltShow(showOnlyIndex,drawFig) - - - - def getAns(self): - ans={} - - opMA={'dataType':'ohcl', - 'action':'findMean', - 'actionOptions':{ - 'MeanType':self.options['MeanType'], - 'valueType':self.options['valueType'], - 'window':self.options['window'] - } - } - ans['BB']=CoreTraidMath.CoreMath(self.base_df,opMA).ans - opSTD={'dataType':'ohcl', - 'action':'findSTD', - 'actionOptions':{'valueType':self.options['valueType'],'window':self.options['window']} - } - ans['STD']=CoreTraidMath.CoreMath(self.base_df,opSTD).ans - ans['pSTD']=ans['BB']+ans['STD']*self.options['kDev'] - ans['mSTD']=ans['BB']-ans['STD']*self.options['kDev'] - ans['x']=np.array(self.base_df['date'][self.options['window']-1:].to_list()) - return ans - - def pltShow(self,showOnlyIndex,drawFig): - ans=None - req=[] - row=1 - if not showOnlyIndex: - - #row=2 - req.append({ - 'vtype':'OCHL', - 'df':self.base_df, - 'row':1, - 'col':1, - 'name':'OHCL' - - }) - req.append({ - 'vtype':'Scatter', - 'df':pd.DataFrame( - {'value':self.ans['BB'],'date':self.ans['x']}) , - 'row':row, - 'col':1, - 'name':'BB' - - }) - req.append({ - 'vtype':'Scatter', - 'df':pd.DataFrame( - {'value':self.ans['pSTD'],'date':self.ans['x']}) , - 'row':row, - 'col':1, - 'name':'pSTD' - - }) - req.append({ - 'vtype':'Scatter', - 'df':pd.DataFrame( - {'value':self.ans['mSTD'],'date':self.ans['x']}) , - 'row':row, - 'col':1, - 'name':'mSTD' - - }) - - self.figDict=req - ans = CoreDraw.coreDraw(req,drawFig) - return ans \ No newline at end of file