# mns **Repository Path**: siryang2006_yang/mns ## Basic Information - **Project Name**: mns - **Description**: MoNeY NeVer SlEePs - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-04-29 - **Last Updated**: 2024-04-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MoNeY NeVeR sLeEpS ## The MNS Architecture ![MNS Architecture](https://foruda.gitee.com/images/1708654033030308172/b620a57f_8027528.png "mns.png") ## Get The Source Code ```bash git clone https://gitee.com/stonego/mns.git cd mns ``` ## Build The MNS project will generate a shared library libmttrade.so, and two executive program mtrader and shmem. libmttrade.so mtrader: the backtest for trade strategies shmeme: the loader for datas ### Debug build ```bash mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Debug .. make -j n # n is thread number make install ``` ### Release build ```bash mkdir release cd release cmake -DCMAKE_BUILD_TYPE=Release .. make -j n # n is thread number make install ``` ## Prepare Data ```bash cd data xz -d * ``` - hb-tick-202312-202401.bin is the tick data - dumperd.bin is all params for every tick ## Load data to shared memory ```bash shmem ``` for example: ```bash cd release ./shmem my-key ../data/hb-tick-202312-202401.bin ../data/dumperd.bin & ``` ## Run Backtest for Strategy ```bash mtrader ``` - debug: show params - step: step-by-step debug - nodebug: just run backtest For example: ```bash cd release ./mtrader my-key 4570000 step ``` ## Run GUI Tools ```bash git clone https://gitee.com/stonego/mnsui.git ``` ## Command For Step-By-Step Debug ### quit quit the mtrader program ### r show the revunue of positions and lists of orders for the mock-interface ### p print current parameters ### g go to the idx data ```bash usage: g ``` ### f forward go to the data, the idx would be **munutes** * 60 + current-index ```bash usage f ``` ### a, s, d, f go forward 15, 30, 45, 60 minutes ### t/j/m ==> u/d/s ```bash tu/td/ts: tom going to up, going down, or stop ju/jd/js: jerry going to up, going down, or stop mu/md/ms: mickey going to up, going down, or stop ``` ### oc/o oc: clear all open-orders ```bash o: add the **price** to open-order-list ``` ### cc/c cc: clear all close-orders ```bash c: add the **price** to close-order-list ``` ### x Cancle Order ```bash xa: cancel all order ``` ### re<--> restart: restart from the beging data ```bash re: restart from the **idx** data rb: restart back to the **idx - minutes * 60** data ``` ### others any input will go to next event-stop