### Create and Run a Simple Trading System Source: https://hikyuu.org/ This example demonstrates how to create a simulation trading account, define a signal indicator, set a fixed trade count for money management, and then run a simple trading system on a specified stock. ```python #创建模拟交易账户进行回测,初始资金30万 my_tm = crtTM(init_cash = 300000) #创建信号指示器(以5日EMA为快线,5日EMA自身的10日EMA最为慢线,快线向上穿越慢线时买入,反之卖出) my_sg = SG_Flex(EMA(CLOSE, n=5), slow_n=10) #固定每次买入1000股 my_mm = MM_FixedCount(1000) #创建交易系统并运行 sys = SYS_Simple(tm = my_tm, sg = my_sg, mm = my_mm) sys.run(sm['sz000001'], Query(-150)) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.