Przeglądaj źródła

# 符合底分型形态,且第2、3根k线是阳线

Daniel 2 lat temu
rodzic
commit
6922fe0b55
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      QMT/qmt_get_indicators.py

+ 5 - 2
QMT/qmt_get_indicators.py

@@ -114,8 +114,11 @@ def get_hlfx(data):
         for x in range(2, len(df_day.index)):
             m = x - 1
             # 底
-            if ((df_day.loc[x, 'high'] > df_day.loc[x - 1, 'high']) and (
-                    df_day.loc[x - 2, 'high'] > df_day.loc[x - 1, 'high'])):
+            # 符合底分型形态,且第2、3根k线是阳线
+            if ((df_day.loc[x, 'high'] > df_day.loc[x - 1, 'high']) and
+                (df_day.loc[x - 2, 'high'] > df_day.loc[x - 1, 'high'])) and \
+                    df_day.loc[x, 'close'] > df_day.loc[x, 'open'] and \
+                    df_day.loc[x - 1, 'close'] > df_day.loc[x - 1, 'open']:
 
                 df_day.loc[x, 'HL'] = 'L*'
                 while m: