今天的主題是三星,這種型態非常罕見,所以出現時先檢查資料看有無錯誤.型態結構內的跳空缺口,假如連影線也沒重疊,反轉意涵更強.
input:pmode_entry(1),pmode_exit(2),pexit(4),sl(130),tar(340),pp1(1),pp2(1),
TradeProfit(0.069),TradeStopLoss(0.012);
vars: daycount(0),mp(0),isBalanceDay(false),pf(0),pl(0);
input: Leeway(0.1), GapPrice1(Close), GapPrice2(Close),
TrendPrice(Open[1]), TrendFilter(Lowest(open[1],5));
Var: NShares(1),
TotalEquity(0),
TradeRisk(0),beforenetprofit(0);
if DAYofMonth(Date next bar) > 14 and DAYofMonth(Date next bar) < 22 and DAYofWeek(Date next bar)= 3 then isBalanceDay = True else isBalanceDay =False ;
mp=marketposition;
pf = AvgPrice*TradeProfit ;
pl = AvgPrice*TradeStopLoss ;
condition99=csbulltristar(leeway,GapPrice1,gapprice2,trendprice,trendfilter);
if condition99[1]
then buy("b1")NShares contract next bar at market;
if pmode_exit=2 then begin
if mp=1 then sell("s l") next bar at lowest(l,4) stop;
if mp=1 and barssinceentry=pexit then sell("ex L") next bar at market;
end;
setstopcontract;
setstoploss((pl*bigpointvalue));
setprofittarget((pf*bigpointvalue));
函數名稱 csbulltristar
input: Leeway(numericsimple), GapPrice1(numericseries), GapPrice2(numericseries),
TrendPrice(numericseries), TrendFilter(numericseries);
var: cs(0), body(0), doji(0);
cs=0;
doji=0;
if c>o then body=c-o else body=o-c;
if c>=o and c<=o*((100+leeway)/100) then doji=1;
if c<=o and c>=o*((100-leeway)/100) then doji=1;
condition1= doji=1 and doji[1]=1 and doji[2]=1;
condition2= gapprice2[1]<gapprice1[2] and gapprice2[1]<gapprice1;
condition3= trendprice<=trendfilter;
csbulltristar= condition1 and condition2 and condition3 ;
後記:
按照原始的定義在TXF只出現過2次,都是在2013年,EXF.FXF.印度A50都沒出現過,所以書上的定義是嚴謹的,接下來我們要試著把條件放寬,觀察結果..............................待續
沒有留言:
張貼留言