예제 #1
0
def update_start_list(clicks):
    """update manual start bot list"""
    acc_list = []
    tg_wrapper.helper.read_data()
    buttons = []
    pair_count = 0
    tg_wrapper.helper.read_data()
    if "markets" in tg_wrapper.helper.data:
        markets = tg_wrapper.helper.data["markets"]
        for market in markets:
            if not tg_wrapper.helper.is_bot_running(market):
                buttons = []
                buttons.append(
                    dbc.Button(
                        "Start",
                        id={
                            "type": "btn-start",
                            "index": pair_count
                        },
                        n_clicks=0,
                        value=market,
                        className="btn btn-primary",
                    ))
                acc_list.append(
                    dbc.AccordionItem(
                        buttons,
                        title=f"{market} - stopped",
                        item_id=market,
                        class_name="justify-content-md-center",
                    ))
                pair_count += 1

    accordion = html.Div(
        dbc.Accordion(id="start-bots", children=acc_list,
                      start_collapsed=True),
        className="d-md-block",
    )

    return accordion
예제 #2
0
 dbc.Accordion(
     children=dbc.AccordionItem(
         id="start-accordian",
         title="Indicator Options",
         class_name="justify-content-md-center",
         children=dbc.Card(
             dbc.CardBody(
                 html.Div([
                     dbc.Checklist(
                         options=[
                             {
                                 "label": "Live Mode",
                                 "value": "live"
                             },
                             {
                                 "label": "Disable EMA",
                                 "value": "disablebuyema",
                             },
                             {
                                 "label": "Disable MACD",
                                 "value": "disablebuymacd",
                             },
                             {
                                 "label": "Disable OBV",
                                 "value": "disablebuyobv",
                             },
                             {
                                 "label": "Disable Elderray",
                                 "value": "disablebuyelderray",
                             },
                             {
                                 "label":
                                 "Disable Failsafe Fibonacci Low ",
                                 "value":
                                 "disablefailsafefibonaccilow",
                             },
                             {
                                 "label": "Disable Bull Only",
                                 "value": "disablebullonly",
                             },
                         ],
                         value=0,
                         id="switches-indicators",
                         switch=True,
                         inline=True,
                     ),
                 ]), )),
     ),
     start_collapsed=True,
 ),
예제 #3
0
 dbc.Accordion([
     dbc.AccordionItem(
         id='aitem-euler-problem',
         title='Problem',
         children=['None'],
     ),
     dbc.AccordionItem(
         title='Solution',
         children=[
             dac.DashAceEditor(
                 id="editor-euler-solution",
                 value="",
                 placeholder="Select a problem to view solution",
                 mode="python",
                 theme="monokai",
                 readOnly=True,
                 wrapEnabled=True,
                 width='100%',
             ),
         ],
     ),
     dbc.AccordionItem(
         title='Profile',
         children=[
             dcc.Store(
                 id="store-solution-profile",
                 data={},
             ),
             dcc.Graph(
                 id="graph-solution-profile",
                 figure={},
             ),
         ],
     ),
 ]),
예제 #4
0
import dash_bootstrap_components as dbc
from dash import html

accordion = html.Div(
    dbc.Accordion(
        [
            dbc.AccordionItem("This is the content of the first section",
                              title="Item 1"),
            dbc.AccordionItem("This is the content of the second section",
                              title="Item 2"),
            dbc.AccordionItem("This is the content of the third section",
                              title="Item 3"),
        ],
        flush=True,
    ), )
예제 #5
0
import dash_bootstrap_components as dbc
from dash import html

accordion = html.Div(
    dbc.Accordion([
        dbc.AccordionItem(
            [
                html.P("This is the content of the first section"),
                dbc.Button("Click here"),
            ],
            title="Item 1",
        ),
        dbc.AccordionItem(
            [
                html.P("This is the content of the second section"),
                dbc.Button("Don't click me!", color="danger"),
            ],
            title="Item 2",
        ),
        dbc.AccordionItem(
            "This is the content of the third section",
            title="Item 3",
        ),
    ], ))
예제 #6
0
import dash_bootstrap_components as dbc
from dash import Input, Output, html

accordion = html.Div([
    dbc.Accordion(
        [
            dbc.AccordionItem(
                "This is the content of the first section. It has a "
                "default ID of item-0.",
                title="Item 1: item-0",
            ),
            dbc.AccordionItem(
                "This is the content of the second section. It has a "
                "default ID of item-1.",
                title="Item 2: item-1",
            ),
            dbc.AccordionItem(
                "This is the content of the third section. It has a "
                "default ID of item-2.",
                title="Item 3: item-2",
            ),
        ],
        id="accordion-always-open",
        always_open=True,
    ),
    html.Div(id="accordion-contents-open-ids", className="mt-3"),
])


@app.callback(
    Output("accordion-contents-open-ids", "children"),
import dash_bootstrap_components as dbc
from dash import html

from .util import make_subheading

accordion = html.Div(
    [
        make_subheading("Accordion", "accordion"),
        dbc.Accordion([
            dbc.AccordionItem(
                "This is the content of the first section",
                title="Item 1",
            ),
            dbc.AccordionItem(
                "This is the content of the second section",
                title="Item 2",
            ),
            dbc.AccordionItem(
                "This is the content of the third section",
                title="Item 3",
            ),
        ], ),
    ],
    className="mb-4",
)
예제 #8
0
def update_accordions(clicks):
    """create bot accordions"""
    acc_list = []
    pair_count = 0
    for i in tg_wrapper.helper.get_all_bot_list():
        tg_wrapper.helper.read_data(i)
        state = "defaulted"
        if "botcontrol" in tg_wrapper.helper.data:
            state = tg_wrapper.helper.data["botcontrol"]["status"]
        buttons = []
        buttons.append(
            dbc.Button(
                "Stop",
                id={
                    "type": "btn-stop",
                    "index": pair_count
                },
                n_clicks=0,
                value=i,
                className="btn btn-primary",
            ))
        if state not in ("paused", "stopped"):
            buttons.append(
                dbc.Button(
                    "Pause",
                    id={
                        "type": "btn-pause",
                        "index": pair_count
                    },
                    n_clicks=0,
                    value=i,
                    className="btn btn-primary",
                ))
        if state in ("paused"):
            buttons.append(
                dbc.Button(
                    "Resume",
                    id={
                        "type": "btn-resume",
                        "index": pair_count
                    },
                    n_clicks=0,
                    value=i,
                    className="btn btn-primary",
                ))
        if tg_wrapper.helper.data["margin"] == " ":
            buttons.append(
                dbc.Button(
                    "Buy",
                    id={
                        "type": "btn-buy",
                        "index": pair_count
                    },
                    n_clicks=0,
                    value=i,
                    className="btn btn-primary",
                ))
        else:
            buttons.append(
                dbc.Button(
                    "Sell",
                    id={
                        "type": "btn-sell",
                        "index": pair_count
                    },
                    n_clicks=0,
                    value=i,
                    className="btn btn-primary",
                ))

        acc_list.append(
            dbc.AccordionItem(
                buttons,
                title=f"{i} - {get_bot_status(i)}",
                item_id=i,
                class_name="justify-content-md-center",
            ))
        pair_count += 1

    accordion = html.Div(
        dbc.Accordion(id="bots", children=acc_list, start_collapsed=True),
        className="d-grid gap-2",
    )

    return accordion
예제 #9
0
             width={
                 "size": 12,
                 "offset": 0
             },
         )),
     # html buttons
     dbc.Collapse(
         dbc.Card(dbc.CardBody(html.Div(id="market-scan-options"), )),
         id="scan_options",
         is_open=False,
     ),
     html.P(),
     dbc.Accordion(
         children=dbc.AccordionItem(
             id="start-accordian",
             title="Manual Start Bot List",
             class_name="justify-content-md-center",
         ),
         start_collapsed=True,
     ),
     html.P(),
     dbc.Accordion(
         children=dbc.AccordionItem(
             id="bot-accordian",
             title="Bot Controls",
             class_name="justify-content-md-center",
         ),
         start_collapsed=True,
     ),
     html.P(),
     dcc.Interval(id="interval-container", interval=30000, n_intervals=0),
 ],
import dash_bootstrap_components as dbc
from dash import Input, Output, html

accordion = html.Div(
    [
        dbc.Accordion(
            [
                dbc.AccordionItem(
                    "This is the content of the first section",
                    title="Item 1",
                    item_id="item-1",
                ),
                dbc.AccordionItem(
                    "This is the content of the second section",
                    title="Item 2",
                    item_id="item-2",
                ),
                dbc.AccordionItem(
                    "This is the content of the third section",
                    title="Item 3",
                    item_id="item-3",
                ),
            ],
            id="accordion",
            active_item="item-1",
        ),
        html.Div(id="accordion-contents", className="mt-3"),
    ]
)

import dash_bootstrap_components as dbc
from dash import html

accordion = html.Div(
    dbc.Accordion(
        [
            dbc.AccordionItem("This is the content of the first section",
                              title="Item 1"),
            dbc.AccordionItem("This is the content of the second section",
                              title="Item 2"),
            dbc.AccordionItem("This is the content of the third section",
                              title="Item 3"),
        ],
        start_collapsed=True,
    ), )