The process and thinking of developing a quantitative strategy

Author: The Little Dream, Created: 2016-08-29 17:44:47, Updated: 2019-08-01 09:52:18

The process and thinking of developing a quantitative strategy

Inventor quantification may be the same as many new users when they start writing strategies. It feels like nothing is going to happen, it really is. Writing and writing poetry are two completely different concepts. So there's a hard condition: you need the most basic programming. Here you might ask, how basic is the craft?The transmission gateThe article is short, rich in content, and it is enough to write a strategy.

  • We'll cut to the chase here: What is the process of developing a strategy? Here are the rough steps:img

You see, programming is just one part of it.

- 1、建模:
    我的理解是,你的想法应该是一个靠谱的好主意(我想没人愿意付出大量精力去验证一个错误的IDEA)。所以这个好主意不是胡思乱想出来的。是通过观察市场现象、行为。数据分析,数学分析等一些科学的方法设计出的完善的逻辑、数学模型。并且要通过论证。
- 2、编程:
    这个过程就如同拿到设计图纸后造车一样。当然实际写的时候会遇到各种在 模型中 没有想到的问题,需要反复调整。经过这个过程你会深刻的体会到: “想的简单”这几个字,也会知道 策略 和 策略源码 之间的距离。
- 3、回测:
    必不可少的一步。此刻不管策略代码作者多自信,这个时候的策略代码也只是残次品。 还要经过 “回测” 这个大熔炉 锤炼。回测是在历史数据中,舒舒服服的测试。主要验证程序的基本逻辑,基本功能,验证策略的基本正确性、可行性。这个过程往往会发现一批明显的BUG。
- 4、实时行情的模拟交易:
    在明显的问题通过回测检验,排除后。回测结果接近预期的设计(至少是策略有可行性)。开始让策略程序接受实时行情模拟交易的考验。这个阶段依然会发现不少问题,这些问题更加隐秘、难以查找。所以该阶段DeBug需要认真。找错误是个基本功。(甚至我个人感觉DeBug功力比写代码还重要)。如果这方面经验不足、粗心大意,会导致一个BUG,没处理对(甚至没找到,但是误改了别的地方),进而产生更多的BUG,这种情况我经历过,说体验就两个字:“抓狂!”。
- 5、实盘测试
    终于迎来最残酷的实盘测试,策略程序要经得住实盘各种问题的摧残(网络异常,超时,交易细节问题,响应速度,容错机制 等等)。 有些问题藏得非常之深。要经过长时间的实盘测试才能体现出来。找出这些问题的根源也是需要一番功夫的。

A strategy would probably require the above steps. Repeat testing takes up most of the entire cycle and coding is only a small part.

  • The experience:

    • 1, I was also tortured when I wrote the first strategy. And usually do not expect to write it completely the first time. It is best to read some simple code first, write a comment to the code, understand the role of each line.
    • 2, imitate some simple strategy code.
    • 3⁄4 Seriously, this is a must. ¤ Carelessness is a disaster ¤
    • 4, patience, I've been bullied by BUG a thousand times, I'm waiting for BUG like I'm in love!
    • 5, in the elementary stage with good annotation, with good output of information function ((API), in the inventor quantification is to use good Log ((() function. You can write Log (( run to here, mark A); add this to the logical structure of your code, it is convenient to know when the program enters the process has this Log function.
    • 6 Don't be afraid! Get on with it!

More