Beispiel #1
0
def sma():
    with dpg.child(width=200, height=70):
        item = dpg.add_button(label='SMA')
        dpg.set_item_theme(dpg.last_item(), button_themes[5])
        dpg.add_same_line()
        i = dpg.add_input_int(default_value=3, label='', width=70)
        dpg.add_button(label='SMA200')
        dpg.set_item_theme(dpg.last_item(), button_themes[4])
        with dpg.tooltip(dpg.last_item()):
            dpg.add_text('Media Movel de 200 dias')
        with dpg.drag_payload(parent=dpg.last_item(),
                              drag_data=('SMA', 200),
                              payload_type='candle_plot'):
            dpg.add_text('SMA200')
        dpg.add_same_line()
        dpg.add_button(label='SMA50')
        dpg.set_item_theme(dpg.last_item(), button_themes[3])
        with dpg.drag_payload(parent=dpg.last_item(),
                              drag_data=('SMA', 50),
                              payload_type='candle_plot'):
            dpg.add_text('SMA50')
        dpg.add_same_line()
        dpg.add_button(label='SMA7')
        dpg.set_item_theme(dpg.last_item(), button_themes[2])
        with dpg.drag_payload(parent=dpg.last_item(),
                              drag_data=('SMA', 7),
                              payload_type='candle_plot'):
            dpg.add_text('SMA7')
    with dpg.drag_payload(parent=item,
                          drag_data=('SMA', dpg.get_value(i)),
                          payload_type='candle_plot'):
        dpg.add_text('SMA')
Beispiel #2
0
    def submit(self, parent):

        with dpg.child(parent=parent, width=self._width, height=self._height, id=self._uuid, menubar=True) as child_parent:
            with dpg.menu_bar():
                dpg.add_menu(label=self._label)

            for child in self._children:
                child.submit(child_parent)
Beispiel #3
0
def rlines():
    with dpg.child(width=200, height=90):
        item = dpg.add_button(label='RLINES')
        dpg.set_item_theme(dpg.last_item(), button_themes[5])
        with dpg.tooltip(dpg.last_item()):
            dpg.add_text('Linhas de Resistencia')
        s = dpg.add_slider_float(label='%',
                                 default_value=2,
                                 min_value=0.1,
                                 max_value=5)
        i = dpg.add_input_int(default_value=0, label='')
    with dpg.drag_payload(parent=item,
                          drag_data=('RLINES', s, i),
                          payload_type='candle_plot'):
        dpg.add_text('RLINES')
Beispiel #4
0
def rsi():
    with dpg.child(width=200, height=90):
        item = dpg.add_button(label='RSI')
        dpg.set_item_theme(dpg.last_item(), button_themes[5])
        i = dpg.add_slider_int(default_value=14,
                               label='',
                               min_value=3,
                               max_value=200)
        j = dpg.add_slider_float(default_value=24,
                                 label='',
                                 min_value=3,
                                 max_value=200)
    with dpg.drag_payload(parent=item,
                          drag_data=('RSI', i, j),
                          payload_type='volume_plot'):
        dpg.add_text('RSI')
Beispiel #5
0
def bbands():
    with dpg.child(width=200, height=95):
        item = dpg.add_button(label='BOLLINGER BANDS')
        dpg.set_item_theme(dpg.last_item(), button_themes[5])
        i = dpg.add_slider_int(default_value=10,
                               label='',
                               min_value=3,
                               max_value=200)
        j = dpg.add_slider_float(default_value=5,
                                 label='',
                                 min_value=1,
                                 max_value=5)
    with dpg.drag_payload(parent=item,
                          drag_data=('BOLLINGER_BANDS', dpg.get_value(i),
                                     dpg.get_value(j)),
                          payload_type='candle_plot'):
        dpg.add_text('BOLLINGER BANDS')
Beispiel #6
0
        nodes.add_history(node_editor_id)
        nodes.add_rlines(node_editor_id)


with dpg.window(label='Main', no_title_bar=True):
    core.set_primary_window(dpg.last_item(), True)
    with dpg.menu_bar():
        with dpg.menu(label="File"):
            dpg.add_menu_item(label="show dpg demo", callback=lambda: show_demo())
            dpg.add_menu_item(label="show dpg doc", callback=lambda: dpg.show_documentation())
    with dpg.group():
        main_parent = dpg.last_item()
        # menu bar
        # main
        with dpg.group(horizontal=True):
            with dpg.child(label='column_0', width=150, height=500):
                _candle_indicators()
            with dpg.child(label='column_1', width=700, height=500, payload_type='main_window',
                           drop_callback=_ticker_drop):
                window_data.main_window_title = dpg.add_text('Ticker: ')
                # dpg.add_button(label='Period')
                # with dpg.popup(dpg.last_item(), modal=True, mousebutton=dpg.mvMouseButton_Left) as modal_id:
                #     period_start = ''
                #     dpg.add_date_picker(level=dpg.mvDatePickerLevel_Day,
                #                         default_value={'month_day': 8, 'year': 93, 'month': 5},
                #                         callback=)
                #     dpg.add_button(label="OK", width=75, user_data=modal_id, callback=_period)
                dpg.add_radio_button(("1y", '6m', '1m', '1w', '1d'), callback=_period, horizontal=True)
                dpg.add_same_line()
                dpg.add_text(' on intervals of: ')
                dpg.add_same_line()
Beispiel #7
0
    dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, (0, 255, 255, 255))
    dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 0, 0, 255))

    dpg.add_theme_color(dpg.mvThemeCol_TitleBg, (100, 150, 0, 255))
    dpg.add_theme_color(dpg.mvThemeCol_ScrollbarGrab, (0, 255, 0, 255))

    # Some styles use only one variable "x" and some use 2 "x,"y" looking at the style editor can help
    dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 20)
    dpg.add_theme_style(dpg.mvStyleVar_FramePadding, 10, 10)

# Themes applied to containers and will propagate to any children that use that theme constant
with dpg.window(label="Theme applied to child that propagates",
                width=300,
                height=300):
    dpg.add_button(label="Default Theme Because above theme")
    with dpg.child() as top_container:
        dpg.add_button(label="Button")
        dpg.add_combo(label="recursive theme Radio Button")
        with dpg.child():
            dpg.add_button(label="recursive theme Button")
            dpg.add_combo(label="recursive theme Radio Button")
    with dpg.group():
        dpg.add_button(label="Button")
        dpg.add_combo(label=" Radio Button")
    dpg.set_item_theme(top_container, our_theme)

# Themes applied to all container types will apply and propigate to all container types across windows
with dpg.window(label="Theme applied to all group containers",
                width=300,
                height=150):
    dpg.add_button(label="Default Theme Because above theme")