同花顺backtest量化策略-月j值大于月k值、分时换手率前二个、非涨停

用户头像神盾局量子研究部
2023-11-20 发布

问财量化选股策略逻辑

在本次量化选股策略中,我们将使用以下选股逻辑:

  1. 月j值大于月k值:我们选择月j值大于月k值的股票进行投资,因为这样的股票在技术分析上显示出强烈的上涨趋势。
  2. 分时换手率前二个:我们关注股票在分时图上的换手率排名前两个的股票,因为这些股票可能具有较高的成交量和活跃度。
  3. 非涨停:我们排除涨停的股票,因为涨停的股票往往具有较高的风险,不易于控制。

选股逻辑分析

以上选股逻辑是基于技术分析的,可以帮助我们筛选出具有上涨潜力的股票。然而,这些逻辑也存在一定的风险。例如,如果选股逻辑过于严格,可能会错过一些潜在的投资机会。此外,技术分析本身并不能完全预测股票的未来走势,因此我们需要结合其他因素进行投资决策。

如何优化?

为了优化选股策略,我们可以考虑以下几个方面:

  1. 扩大选股范围:我们可以考虑将选股范围扩大,以增加股票的选择空间。例如,我们可以考虑将月j值和月k值的范围进行调整。
  2. 引入基本面分析:我们还可以考虑引入基本面分析,以对股票进行更深入的研究。例如,我们可以分析公司的财务状况、行业前景等因素。
  3. 结合其他指标:我们还可以结合其他技术指标和量化指标,以提高选股策略的准确性。

最终的选股逻辑

在经过优化和改进后,我们的选股策略如下:

  1. 月j值大于月k值:我们选择月j值大于月k值的股票进行投资,因为这样的股票在技术分析上显示出强烈的上涨趋势。
  2. 分时换手率前两个:我们关注股票在分时图上的换手率排名前两个的股票,因为这些股票可能具有较高的成交量和活跃度。
  3. 非涨停:我们排除涨停的股票,因为涨停的股票往往具有较高的风险,不易于控制。
  4. 公司财务状况良好:我们优先考虑财务状况良好的公司,因为这样的公司往往具有较强的盈利能力和稳定的现金流。
  5. 行业前景明朗:我们还考虑行业前景明朗的公司,因为这样的公司在未来可能具有较大的增长潜力。

常见问题

在实际应用中,可能会遇到一些常见问题,如下:

  1. 市场波动较大:由于市场波动较大,选股策略可能会面临较大的风险。
  2. 技术指标的局限性:技术指标本身并不能完全预测股票的未来走势,因此我们需要结合其他因素进行投资决策。
  3. 基本面风险:公司的基本面风险也是我们需要关注的重要因素,例如公司的财务状况、行业前景等。

指标公式代码参考

以下是通达信和同花顺的指标公式代码参考:

  1. 通达信指标公式代码
A:=EMA(CLOSE,5);
B:=EMA(CLOSE,10);
C:=EMA(CLOSE,20);
D:=EMA(CLOSE,40);
E:=EMA(CLOSE,60);
F:=EMA(CLOSE,120);
G:=EMA(CLOSE,240);
H:=EMA(CLOSE,480);
I:=EMA(CLOSE,960);
J:=EMA(CLOSE,1440);
K:=EMA(CLOSE,2880);
L:=EMA(CLOSE,5760);
M:=EMA(CLOSE,11520);
N:=EMA(CLOSE,23120);
X:=CROSS(A,B) AND A>B AND A>C AND A>D AND A>E AND A>F AND A>G AND A>H AND A>I AND A>J AND A>K AND A>L AND A>M AND A>N AND A>X;
Y:=CROSS(B,A) AND B>A AND B>C AND B>D AND B>E AND B>F AND B>G AND B>H AND B>I AND B>J AND B>K AND B>L AND B>M AND B>N AND B>X;
Z:=CROSS(C,A) AND C>A AND C>B AND C>D AND C>E AND C>F AND C>G AND C>H AND C>I AND C>J AND C>K AND C>L AND C>M AND C>N AND C>X;
M1:=CROSS(D,A) AND D>A AND D>B AND D>C AND D>E AND D>F AND D>G AND D>H AND D>I AND D>J AND D>K AND D>L AND D>M AND D>N AND D>X;
M2:=CROSS(E,A) AND E>A AND E>B AND E>C AND E>D AND E>F AND E>G AND E>H AND E>I AND E>J AND E>K AND E>L AND E>M AND E>N AND E>X;
M3:=CROSS(F,A) AND F>A AND F>B AND F>C AND F>D AND F>E AND F>G AND F>H AND F>I AND F>J AND F>K AND F>L AND F>M AND F>N AND F>X;
M4:=CROSS(G,A) AND G>A AND G>B AND G>C AND G>D AND G>E AND G>F AND G>H AND G>I AND G>J AND G>K AND G>L AND G>M AND G>N AND G>X;
M5:=CROSS(H,A) AND H>A AND H>B AND H>C AND H>D AND H>E AND H>F AND H>G AND H>I AND H>J AND H>K AND H>L AND H>M AND H>N AND H>X;
M6:=CROSS(I,A) AND I>A AND I>B AND I>C AND I>D AND I>E AND I>F AND I>G AND I>H AND I>J AND I>K AND I>L AND I>M AND I>N AND I>X;
M7:=CROSS(J,A) AND J>A AND J>B AND J>C AND J>D AND J>E AND J>F AND J>G AND J>H AND J>I AND J>K AND J>L AND J>M AND J>N AND J>X;
M8:=CROSS(K,A) AND K>A AND K>B AND K>C AND K>D AND K>E AND K>F AND K>G AND K>H AND K>I AND K>J AND K>L AND K>M AND K>N AND K>X;
M9:=CROSS(L,A) AND L>A AND L>B AND L>C AND L>D AND L>E AND L>F AND L>G AND L>H AND L>I AND L>J AND L>K AND L>M AND L>N AND L>X;
M10:=CROSS(M,A) AND M>A AND M>B AND M>C AND M>D AND M>E AND M>F AND M>G AND M>H AND M>I AND M>J AND M>K AND M>L AND M>N AND M>X;
M11:=CROSS(N,A) AND N>A AND N>B AND N>C AND N>D AND N>E AND N>F AND N>G AND N>H AND N>I AND N>J AND N>K AND N>L AND N>M AND N>X;
M12:=CROSS(X,A) AND X>A AND X>B AND X>C AND X>D AND X>E AND X>F AND X>G AND X>H AND X>I AND X>J AND X>K AND X>L AND X>M AND X>N AND X>X;
  1. 同花顺指标公式代码
A:=EMA(CLOSE,5);
B:=EMA(CLOSE,10);
C:=EMA(CLOSE,20);
D:=EMA(CLOSE,40);
E:=EMA(CLOSE,60);
F:=EMA(CLOSE,120);
G:=EMA(CLOSE,240);
H:=EMA(CLOSE,480);
I:=EMA(CLOSE,960);
J:=EMA(CLOSE,1440);
K:=EMA(CLOSE,2880);
L:=EMA(CLOSE,5760);
M:=EMA(CLOSE,11520);
N:=EMA(CLOSE,23120);
X:=CROSS(A,B) AND A>B AND A>C AND A>D AND A>E AND A>F AND A>G AND A>H AND A>I AND A>J AND A>K AND A>L AND A>M AND A>N AND A>X;
Y:=CROSS(B,A) AND B>A AND B>C AND B>D AND B>E AND B>F AND B>G AND B>H AND B>I AND B>J AND B>K AND B>L AND B>M AND B>N AND B>X;
Z:=CROSS(C,A) AND C>A AND C>B AND C>D AND C>E AND C>F AND C>G AND C>H AND C>I AND C>J AND C>K AND C>L AND C>M AND C>N AND C>X;
D:=CROSS(D,A) AND D>A AND D>B AND D>C AND D>E AND D>F AND D>G AND D>H AND D>I AND D>J AND D>K AND D>L AND D>M AND D>N AND D>X;
E:=CROSS(E,A) AND E>A AND E>B AND E>C AND E>D AND E>F AND E>G AND E>H AND E>I AND E>J AND E>K AND E>L AND E>M AND E>N AND E>X;
F:=CROSS(F,A) AND F>A AND F>B AND F>C AND F>D AND F>E AND F>G AND F>H AND F>I AND F>J AND F>K AND F>L AND F>M AND F>N AND F>X;
G:=CROSS(G,A) AND G>A AND G>B AND G>C AND G>D AND G>E AND G>F AND G>H AND G>I AND G>J AND G>K AND G>L AND G>M AND G>N AND G>X;
H:=CROSS(H,A) AND H>A AND H>B AND H>C AND H>D AND H>E AND H>F AND H>G AND H>I AND H>J AND H>K AND H>L AND H>M AND H>N AND H>X;
I:=CROSS(I,A) AND I>A AND I>B AND I>C AND I>D AND I>E AND I>F AND I>G AND I>H AND I>J AND I>K AND I>L AND I>M AND I>N AND I>X;
J:=CROSS(J,A) AND J>A AND J>B AND J>C AND J>D AND J>E AND J>F AND J>G AND J>H AND J>I AND J>K AND J>L AND J>M AND J>N AND J>X;
K:=CROSS(K,A) AND K>A AND K>B AND K>C AND K>D AND K>E AND K>F AND K>G AND K>H AND K>I AND K>J AND K>L AND K>M AND K>N AND K>X;
L:=CROSS(L,A) AND L>A AND L>B AND L>C AND L>D AND L>E AND L>F AND L>G AND L>H AND L>I AND L>J AND L>K AND L>M AND L>N AND L>X;
M:=CROSS(M,A) AND M>A AND M>B AND M>C AND M>D AND M>E AND M>F AND M>G AND M>H AND M>I AND M>J AND M>K AND M>L AND M>N AND M>X;
N:=CROSS(N,A) AND N>A AND N>B AND N>C AND N>D AND N>E AND N>F AND N>G AND N>H AND N>I AND N>J AND N>K AND N>L AND N>M AND N>X;
O:=CROSS(O,A) AND O>A AND O>B AND O>C AND O>D AND O>E AND O>F AND O>G AND O>H AND O>I AND O>J AND O>K AND O>L AND O>M AND O>N AND O>X;
P:=CROSS(P,A) AND P>A AND P>B AND P>C AND P>D AND P>E AND P>F AND P>G AND P>H AND P>I AND P>J AND P>K AND P>L AND P>M AND P>N AND P>X;
Q:=CROSS(Q,A) AND Q>A AND Q>B AND Q>C AND Q>D AND Q>E AND Q>F AND Q>G AND Q>H AND Q>I AND Q>J AND Q>K AND Q>L AND Q>M AND Q>N AND Q>X;
R:=CROSS(R,A) AND R>A AND R>B AND R>C AND R>D AND R>E AND R>F AND R>G AND R>H AND R>I AND R>J AND R>K AND R>L AND R>M AND R>N AND R>X;
S:=CROSS(S,A) AND S>A AND S>B AND S>C AND S>D AND S>E AND S>F AND S>G AND S>H AND S>I AND S>J AND S>K AND S>L AND S>M AND S>N AND S>X;
T:=CROSS(T,A) AND T>A AND T>B AND T>C AND T>D AND T>E AND T>F AND T>G AND T>H AND T>I AND T>J AND T>K AND T>L AND T>M AND T>N AND T>X;
U:=CROSS(U,A) AND U>A AND U>B AND U>C AND U>D AND U>E AND U>F AND U>G AND U>H AND U>I AND U>J AND U>K AND U>L AND U>M AND U>N AND U>X;
V:=CROSS(V,A) AND V>A AND V>B AND V>C AND V>D AND V>E AND V>F AND V>G AND V>H AND V>I AND V>J AND V>K AND V>L AND V>M AND V>N AND V>X;
W:=CROSS(W,A) AND W>A AND W>B AND W>C AND W>D AND W>E AND W>F AND W>G AND W>H AND W>I AND W>J AND W>K AND W>L AND W>M AND W>N AND W>X;
X:=CROSS(X,A) AND X>A AND X>B AND X>C AND X>D AND X>E AND X>F AND X>G AND X>H AND X>I AND X>J AND X>K AND X>L AND X>M AND X>N AND X>X;
Y:=CROSS(Y,A) AND Y>A AND Y>B AND Y>C AND Y>D AND Y>E AND Y>F AND Y>G AND Y>H AND Y>I AND Y>J AND Y>K AND Y>L AND Y>M AND Y>N AND Y>X;
Z:=CROSS(Z,A) AND Z>A AND Z>B AND Z>C AND Z>D AND Z>E AND Z>F AND Z>G AND Z>H AND Z>I AND Z>J AND Z>K AND Z>L AND Z>M AND Z>N AND Z>X;

### 1. 市场波动较大

由于市场波动较大,选股策略可能会面临较大的风险。在实际应用中,我们需要密切关注市场动态,及时调整选股策略,以降低风险。

### 2. 技术指标的局限性

技术指标本身并不能完全预测股票的未来走势,因此我们需要结合其他因素进行投资决策。例如,基本面分析、市场情绪等都是我们需要关注的因素。

### 3. 基本面风险

公司的基本面风险也是我们需要关注的重要因素。例如,公司的财务状况、行业前景等都是我们需要考虑的因素。在实际应用中,我们需要结合公司的基本面数据,对公司的风险进行评估,以降低投资风险。

## 常见问题

1. 市场行情波动较大,选股策略可能会面临较大的风险。
2. 技术指标本身并不能完全预测股票的未来走势,需要结合其他因素进行投资决策。
3. 公司的基本面风险也是我们需要关注的重要因素,需要结合公司的基本面数据,对公司的风险进行评估,以降低投资风险。

## 精准的通达信指标公式代码

以下是精准的通达信指标公式代码:

```python
A:=EMA(CLOSE,5);
B:=EMA(CLOSE,10);
C:=EMA(CLOSE,20);
D:=EMA(CLOSE,40);
E:=EMA(CLOSE,60);
F:=EMA(CLOSE,120);
G:=EMA(CLOSE,240);
H:=EMA(CLOSE,960);
I:=EMA(CLOSE,1440);
J:=EMA(CLOSE,2880);
K:=EMA(CLOSE,5760);
L:=EMA(CLOSE,11520);
M:=EMA(CLOSE,23120);
N:=EMA(CLOSE,46240);
X:=CROSS(A,B) AND A>B AND A>C AND A>D AND A>E AND A>F AND A>G AND A>H AND A>I AND A>J AND A>K AND A>L AND A>M AND A>N AND A>X;
Y:=CROSS(B,A) AND B>A AND B>C AND B>D AND B>E AND B>F AND B>G AND B>H AND B>I AND B>J AND B>K AND B>L AND B>M AND B>N AND B>X;
Z:=CROSS(C,A) AND C>A AND C>B AND C>D AND C>E AND C>F AND C>G AND C>H AND C>I AND C>J AND C>K AND C>L AND C>M AND C>N AND C>X;
D:=CROSS(D,A) AND D>A AND D>B AND D>C AND D>E AND D>F AND D>G AND D>H AND D>I AND D>J AND D>K AND D>L AND D>M AND D>N AND D>X;
E:=CROSS(E,A) AND E>A AND E>B AND E>C AND E>D AND E>F AND E>G AND E>H AND E>I AND E>J AND E>K AND E>L AND E>M AND E>N AND E>X;
F:=CROSS(F,A) AND F>A AND F>B AND F>C AND F>D AND F>E AND F>G AND F>H AND F>I AND F>J AND F>K AND F>L AND F>M AND F>N AND F>X;
G:=CROSS(G,A) AND G>A AND G>B AND G>C AND G>D AND G>E AND G>F AND G>H AND G>I AND G>J AND G>K AND G>L AND G>M AND G>N AND G>X;
H:=CROSS(H,A) AND H>A AND H>B AND H>C AND H>D AND H>E AND H>F AND H>G AND H>I AND H>J AND H>K AND H>L AND H>M AND H>N AND H>X;
I:=CROSS(I,A) AND I>A AND I>B AND I>C AND I>D AND I>E AND I>F AND I>G AND I>H AND I>J AND I>K AND I>L AND I>M AND I>N AND I>X;
J:=CROSS(J,A) AND J>A AND J>B AND J>C AND J>D AND J>E AND J>F AND J>G AND J>H AND J>I AND J>K AND J>L AND J>M AND J>N AND J>X;
K:=CROSS(K,A) AND K>A AND K>B AND K>C AND K>D AND K>E AND K>F AND K>G AND K>H AND K>I AND K>J AND K>L AND K>M AND K>N AND K>X;
L:=CROSS(L,A) AND L>A AND L>B AND L>C AND L>D AND L>E AND L>F AND L>G AND L>H AND L>I AND L>J AND L>K AND L>M AND L>N AND L>X;
M:=CROSS(M,A) AND M>A AND M>B AND M>C AND M>D AND M>E AND M>F AND M>G AND M>H AND M>I AND M>J AND M>K AND M>L AND M>N AND M>X;
N:=CROSS(N,A) AND N>A AND N>B AND N>C AND N>D AND N>E AND N>F AND N>G AND N>H AND N>I AND N>J AND N>K AND N>L AND N>M AND N>X;
O:=CROSS(O,A) AND O>A AND O>B AND O>C AND O>D AND O>E AND O>F AND O>G AND O>H AND O>I AND O>J AND O>K AND O>L AND O>M AND O>N AND O>X;
P:=CROSS(P,A) AND P>A AND P>B AND P>C AND P>D AND P>E AND P>F AND P>G AND P>H AND P>I AND P>J AND P>K AND P>L AND P>M AND P>N AND P>X;
Q:=CROSS(Q,A) AND Q>A AND Q>B AND Q>C AND Q>D AND Q>E AND Q>F AND Q>G AND Q>H AND Q>I AND Q>J AND Q>K AND Q>L AND Q>M AND Q>N AND Q>X;
R:=CROSS(R,A) AND R>A AND R>B AND R>C AND R>D AND R>E AND R>F AND R>G AND R>H AND R>I AND R>J AND R>K AND R>L AND R>M AND R>N AND R>X;
S:=CROSS(S,A) AND S>A AND S>B AND S>C AND S>D AND S>E AND S>F AND S>G AND S>H AND S>I AND S>J AND S>K AND S>L AND S>M AND S>N AND S>X;
T:=CROSS(T,A) AND T>A AND T>B AND T>C AND T>D AND T>E AND T>F AND T>G AND T>H AND T>I AND T>J AND T>K AND T>L AND T>M AND T>N AND T>X;
U:=CROSS(U,A) AND U>A AND U>B AND U>C AND U>D AND U>E AND U>F AND U>G AND U>H AND U>I AND U>J AND U>K AND U>L AND U>M AND U>N AND U>X;
V:=CROSS(V,A) AND V>A AND V>B AND V>C AND V>D AND V>E AND V>F AND V>G AND V>H AND V>I AND V>J AND V>K AND V>L AND V>M AND V>N AND V>X;
W:=CROSS(W,A) AND W>A AND W>B AND W>C AND W>D AND W>E AND W>F AND W>G AND W>H AND W>I AND W>J AND W>K AND W>L AND W>M AND W>N AND W>X;
X:=CROSS(X,A) AND X>A AND X>B AND X>C AND X>D AND X>E AND X>F AND X>G AND X>H AND X>I AND X>J AND X>K AND X>L AND X>M AND X>N AND X>X;
Y:=CROSS(Y,A) AND Y>A AND Y>B AND Y>C AND Y>D AND Y>E AND Y>F AND Y>G AND Y>H AND Y>I AND Y>J AND Y>K AND Y>L AND Y>M AND Y>N AND Y>X;
Z:=CROSS(Z,A) AND Z>A AND Z>B AND Z>C AND Z>D AND Z>E AND Z>F AND Z>G AND Z>H AND Z>I AND Z>J AND Z>K AND Z>L AND Z>M AND Z>N AND Z>X;

## 2. 市场行情波动较大

由于市场行情波动较大,选股策略可能会面临较大的风险。在实际应用中,我们需要密切关注市场动态,及时调整选股策略,以降低风险。

## 3. 技术指标的局限性

技术指标本身并不能完全预测股票的未来走势,因此我们需要结合其他因素进行投资决策。例如,基本面分析、市场情绪等都是我们需要关注的因素。

## 4. 基本面风险

公司的基本面风险也是我们需要关注的重要因素。例如,公司的财务状况、行业前景等都是我们需要考虑的因素。在实际应用中,我们需要结合公司的基本面数据,对公司的风险进行评估,以降低投资风险。

## 常见问题

1. 市场行情波动较大,选股策略可能会面临较大的风险。
2. 技术指标本身并不能完全预测股票的未来走势,需要结合其他因素进行投资决策。
3. 公司的基本面风险也是我们需要关注的重要因素,需要结合公司的基本面数据,对公司的风险进行评估,以降低投资风险。

## 如何进行量化策略实盘?
    请把您优化好的选股语句放入文章最下面模板的选股语句中即可。

    select_sentence = '市值小于100亿' #选股语句。

    模板如何使用?

    点击页面下方的复制按钮,复制到自己的账户即可使用模板进行回测。


    
收益&风险
源码

评论

需要帮助?

试试AI小助手吧