TA的每日心情 | 衰 2021-11-28 16:26 |
---|
签到天数: 18 天 [LV.4]偶尔看看III
|
(通达信) 代码片段:
BUY:= 你的买进信号;
SELL:= 你的卖出信号;
B2:=BARSLAST(BUY);
S2:=BARSLAST(SELL);
FBUY:=CROSS(S2,B2);
FSELL:=CROSS(B2,S2);
过滤后的买进信号:= BUY AND FBUY;
过滤后的卖出信号:= SELL AND FSELL;
示例代码:
过滤前:C;
BUY:= C>REF(C,1)*1.05;
SELL:= C<REF(C,1)*0.97;
B2:=BARSLAST(BUY);
S2:=BARSLAST(SELL);
FBUY:=CROSS(S2,B2);
FSELL:=CROSS(B2,S2);
BUYNEW:= BUY AND FBUY;
SELLNEW:= SELL AND FSELL;
过滤后: 过滤前+5;
DRAWICON(BUYNEW,过滤后,1);
DRAWICON(SELLNEW,过滤后,2);
DRAWICON(BUY, 过滤前,1);
DRAWICON(SELL, 过滤前,2);
|
| |
|
|