目前积累的策略如下:
后续支持线上低代码开发策略,敬请期待。
Day1 100天开发一个AI量化的Web平台
好的技术选型是NiceGUI(背后的技术仍然是FastApi, vue,tailwind css)
开发界面还是相当丝滑的:
代码如下:
from nicegui import ui from utils.basic_utils import data_helper def create_json_editor(): json = { 'features': [1, 2, 3], 'feature_names': [1, 2, 3], 'boolean': True, 'color': '#82b92c', None: None, 'number': 123, 'object': { 'a': 'b', 'c': 'd', }, 'time': 1575599819000, 'benchmark': '000300.SH', } ui.json_editor({'content': {'json': json}}, on_select=lambda e: ui.notify(f'Select: {e}'), on_change=lambda e: ui.notify(f'Change: {e}')) def funds_table(): columns = [ {'name': 'name', 'label': '名称', 'field': 'name', 'required': True, 'align': 'left'}, {'name': 'symbol', 'label': '代码', 'field': 'symbol', 'sortable': True}, ] rows = data_helper.get_basic_df() ui.table(columns=columns, rows=rows, row_key='name') def create_tabs(): with ui.tabs().classes('w-full') as tabs: hot = ui.tab('热门') broad = ui.tab('宽基') ind = ui.tab('行业') with ui.tab_panels(tabs, value=hot).classes('w-full'): with ui.tab_panel(hot): funds_table() with ui.tab_panel(broad): ui.label('Second tab') with ui.stepper().props('vertical').classes('w-full') as stepper: with ui.step('选择基金'): ui.label('请选择要交易的基金列表') create_tabs() with ui.stepper_navigation(): ui.button('下一步', on_click=stepper.next) with ui.step('交易规则'): with ui.stepper_navigation(): ui.button('下一步', on_click=stepper.next) ui.button('上一步', on_click=stepper.previous).props('flat') with ui.step('调仓周期'): create_json_editor() with ui.stepper_navigation(): ui.button('完成', on_click=lambda: ui.notify('Yay!', type='positive')) ui.button('上一步', on_click=stepper.previous).props('flat') ui.run()
发布者:股市刺客,转载请注明出处:https://www.95sca.cn/archives/103423
站内所有文章皆来自网络转载或读者投稿,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。敬请谅解!