Exemplo n.º 1
0
 def generic_data_cb_pressed(stock_analysis_tool: QMainWindow,
                             checked: bool,
                             df_column_name: str) -> None:
     if checked:
         # Add open data to graph
         stock_analysis_tool.add_column_to_graph(
             column_name=df_column_name)
     else:
         # Remove open data from graph
         stock_analysis_tool.remove_column_from_graph(
             column_name=df_column_name)
Exemplo n.º 2
0
        def roc_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add ROC to Display Graph
                stock_analysis_tool.df['roc'] = roc(
                    close=stock_analysis_tool.df['close'],
                    n=stock_analysis_tool.roc_n)
                stock_analysis_tool.add_column_to_graph(column_name='roc')
            else:
                # Remove ROC from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='roc')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("roc",
                                                                     axis=1)
Exemplo n.º 3
0
        def dpo_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add DPO to Display Graph
                stock_analysis_tool.df['dpo'] = dpo(
                    close=stock_analysis_tool.df['close'],
                    n=stock_analysis_tool.dpo_n)
                stock_analysis_tool.add_column_to_graph(column_name='dpo')
            else:
                # Remove DPO from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='dpo')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("dpo",
                                                                     axis=1)
Exemplo n.º 4
0
        def cci_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add CCI to Display Graph
                stock_analysis_tool.df['cci'] = cci(
                    close=stock_analysis_tool.df['close'],
                    low=stock_analysis_tool.df['low'],
                    high=stock_analysis_tool.df['high'],
                    n=stock_analysis_tool.cci_n)
                stock_analysis_tool.add_column_to_graph(column_name='cci')
            else:
                # Remove CCI from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='cci')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("cci",
                                                                     axis=1)
Exemplo n.º 5
0
        def adx_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add ADX to Display Graph
                stock_analysis_tool.df['adx'] = adx(
                    high=stock_analysis_tool.df['high'],
                    low=stock_analysis_tool.df['low'],
                    close=stock_analysis_tool.df['close'],
                    n=stock_analysis_tool.adx_n)
                stock_analysis_tool.add_column_to_graph(column_name='adx')
            else:
                # Remove ADX from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='adx')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("adx",
                                                                     axis=1)
Exemplo n.º 6
0
        def cmf_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add CMF to Display Graph
                stock_analysis_tool.df['cmf'] = chaikin_money_flow(
                    high=stock_analysis_tool.df['high'],
                    low=stock_analysis_tool.df['low'],
                    close=stock_analysis_tool.df['close'],
                    volume=stock_analysis_tool.df['volume'],
                    n=stock_analysis_tool.cmf_n)
                stock_analysis_tool.add_column_to_graph(column_name='cmf')
            else:
                # Remove CMF from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='cmf')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("cmf",
                                                                     axis=1)
Exemplo n.º 7
0
        def cmo_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                stock_analysis_tool.df['cmo'] = chande_momentum_oscillator(
                    close_data=stock_analysis_tool.df['close'],
                    period=stock_analysis_tool.cmo_n)
                stock_analysis_tool.df['cmo overbought'] = 50
                stock_analysis_tool.df['cmo oversold'] = -50
                # Add CMO to Display Graph
                stock_analysis_tool.add_column_to_graph(column_name='cmo')
                stock_analysis_tool.add_column_to_graph(
                    column_name='cmo overbought',
                    color=stock_analysis_tool.protected_colors['red'])
                stock_analysis_tool.add_column_to_graph(
                    column_name='cmo oversold',
                    color=stock_analysis_tool.protected_colors['green'])
            else:
                # Remove CMO from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='cmo')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='cmo overbought')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='cmo oversold')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("cmo",
                                                                     axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "cmo overbought", axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "cmo oversold", axis=1)
Exemplo n.º 8
0
        def rsi_cb_pressed(stock_analysis_tool: QMainWindow,
                           cb: QCheckBox) -> None:
            """

            :param stock_analysis_tool:
            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add RSI to Display Graph
                stock_analysis_tool.df['rsi'] = rsi(
                    close=stock_analysis_tool.df['close'],
                    n=stock_analysis_tool.rsi_n)
                stock_analysis_tool.df['rsi overbought'] = 70
                stock_analysis_tool.df['rsi oversold'] = 30
                stock_analysis_tool.add_column_to_graph(column_name='rsi')
                stock_analysis_tool.add_column_to_graph(
                    column_name='rsi overbought',
                    color=stock_analysis_tool.protected_colors['red'])
                stock_analysis_tool.add_column_to_graph(
                    column_name='rsi oversold',
                    color=stock_analysis_tool.protected_colors['green'])
            else:
                # Remove RSI from Display Graph
                stock_analysis_tool.remove_column_from_graph(column_name='rsi')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='rsi overbought')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='rsi oversold')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("rsi",
                                                                     axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "rsi overbought", axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "rsi oversold", axis=1)
Exemplo n.º 9
0
        def macd_cb_pressed(stock_analysis_tool: QMainWindow,
                            cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add MACD to Display Graph
                stock_analysis_tool.df['MACD'] = macd(close=stock_analysis_tool.df['close'],
                                                      n_slow=stock_analysis_tool.macd_slow,
                                                      n_fast=stock_analysis_tool.macd_fast) - \
                                                 macd_signal(close=stock_analysis_tool.df['close'],
                                                             n_slow=stock_analysis_tool.macd_slow,
                                                             n_fast=stock_analysis_tool.macd_fast,
                                                             n_sign=stock_analysis_tool.macd_sign)
                stock_analysis_tool.add_column_to_graph(column_name='MACD')
            else:
                # Remove MACD from Display Graph
                stock_analysis_tool.remove_column_from_graph(
                    column_name='MACD')
                stock_analysis_tool.df = stock_analysis_tool.df.drop("MACD",
                                                                     axis=1)
Exemplo n.º 10
0
        def williams_r_cb_pressed(stock_analysis_tool: QMainWindow,
                                  cb: QCheckBox) -> None:
            """

            :param cb:
            :return:
            """
            if cb.isChecked():
                # Add WilliamsR to Display Graph
                stock_analysis_tool.df['WilliamsR'] = wr(
                    stock_analysis_tool.df['high'],
                    stock_analysis_tool.df['low'],
                    stock_analysis_tool.df['close'])
                stock_analysis_tool.df['WilliamsR overbought'] = -20
                stock_analysis_tool.df['WilliamsR oversold'] = -80
                stock_analysis_tool.add_column_to_graph(
                    column_name='WilliamsR')
                stock_analysis_tool.add_column_to_graph(
                    column_name='WilliamsR overbought',
                    color=stock_analysis_tool.protected_colors['red'])
                stock_analysis_tool.add_column_to_graph(
                    column_name='WilliamsR oversold',
                    color=stock_analysis_tool.protected_colors['green'])
            else:
                # Remove WilliamsR from Display Graph
                stock_analysis_tool.remove_column_from_graph(
                    column_name='WilliamsR')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='WilliamsR overbought')
                stock_analysis_tool.remove_column_from_graph(
                    column_name='WilliamsR oversold')
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "WilliamsR", axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "WilliamsR overbought", axis=1)
                stock_analysis_tool.df = stock_analysis_tool.df.drop(
                    "WilliamsR oversold", axis=1)