MA144:EMA(CLOSE,144),LINETHICK2;
MA169:EMA(CLOSE,169),LINETHICK2;
B:EMA(CLOSE,12);
我想把这个维加斯隧道改成一个交易模型。B上穿144,169二根线时,平空开多。B下穿144,169二根线时,平多开空。
看看行不行。
MA144:EMA(CLOSE,144),LINETHICK2;
MA169:EMA(CLOSE,169),LINETHICK2;
B:EMA(CLOSE,12);
EXITSHORT:B>ma144 and B>ma169;
ENTERLONG:B>ma144 and B>ma169;
EXITLONG:B<ma144 and B<ma169;
ENTERSHORT:B<ma144 and B<ma169;
ENTERLONG:cross(b,ma144) and cross(b,ma169);
EXITLONG:cross(ma144,b) and cross(ma169,b);
ENTERSHORT:cross(ma144,b) and cross(ma169,b);
EXITSHORT:cross(b,ma144) and cross(b,ma169);
这样写没任何信号呀。
EXITSHORT:B>ma144 and B>ma169;
ENTERLONG:ma144<B and ma169<B;
EXITLONG:B<ma144 and B<ma169;
ENTERSHORT:ma144>B and ma169>B;
这样写所有的信号都堆在上面。我只要第一个就行了。
这二种写法都有问题。
MA144:EMA(CLOSE,144),LINETHICK2;
MA169:EMA(CLOSE,169),LINETHICK2;
B:EMA(CLOSE,12);
if cross(B,MA144) and cross(B,MA169) then begin
sellshort(holding<0,0,thisclose);
buy(1,1,thisclose);
end
if cross(MA144,b) and cross(MA169,b) then begin
sell(holding>0,0,thisclose);
buyshort(1,1,thisclose);
end
这样的信号就不重复了
MA144:EMA(CLOSE,144),LINETHICK2;
MA169:EMA(CLOSE,169),LINETHICK2;
B:EMA(CLOSE,12);
EXITSHORT:B>ma144 and B>ma169,TFILTER;
ENTERLONG:ma144<B and ma169<B,TFILTER;
EXITLONG:B<ma144 and B<ma169,TFILTER;
ENTERSHORT:ma144>B and ma169>B,TFILTER;
这样表达对了。
用CORSS表达叉二根线时,要同时叉二根才执行。在隧道里面就不行了。