Vars
? ? Array<numeric>settime([0.095800,0.105800,0.11295800,0.135800,0.145800,0.215800,0.225800]);
?? ?
?? ?Numeric Lotsold;
?? ?Numeric Lotsnew;
?? ??? ?
? ? Series<Numeric> MA3; ? ? ?? ??? ??? ?//中軌
?? ?Series<Numeric> SD ; ? ??? ??? ??? ?//通道距離
?? ?Series<Numeric> Top; ? ??? ??? ??? ?//通道高點
?? ?Series<Numeric> Bottom; ?? ?
? ? Series<Numeric> Bottomm;?? ?//通道低點
?? ?
?? ?bool cnbpk;
?? ?bool cnspk;
?? ?bool timecondition;
?? ?
Events
? ?OnBar(ArrayRef<Integer> indexs)
? ?
? ?
? ?
? ? { ??
? ? ?? ?
? ?? ?
? ? ?? ?
? ? ?? ??? ?//平移boll通道計算
? ? ? ? MA3 = Average(C,P3); ? ? ? ?
? ? ?? ?SD = StandardDev(c,p3,2)*p;
? ? ?? ?Top = ma3 + SD;
? ? ?? ?Bottom = ma3 - SD;
? ? ?? ?PlotNumeric("MA3",MA3);
? ? ?? ?PlotNumeric("Top",top);
? ? ?? ?PlotNumeric("Bottom",bottom);
? ? ?? ?lotsold=ooo;
? ? ?? ?lotsnew=nnn;
? ? ?? ?
? ? ? ? Bottomm=Highest(bottom,2);
? ? ?? ?
? ? ?? ?cnbpk=c>top;
? ? ?? ?cnspk=c<bottom;
? ? ?? ?
? ? ?? ?
? ? ?? ?
? ? ?? ? timecondition=(time==0.09 and currenttime>time+0.0210) or (time==0.12 and currenttime>time+0.0240) Or (time==0.21 and currenttime>time+0.0140);
? ? //------------------------------------------------------------?? ?
? ? ?? ?If(CNbpk==true )//分開處理,首次建倉
? ? ?? ?{
? ? ?? ??? ?
? ? ?? ??? ?if (MarketPosition==0) ?
? ? ?? ??? ?{
? ? ?? ? ?? ?Buy(lotsnew,c)
? ? ?? ??? ?;
? ? ?? ??? ?if (timecondition==True ) Alert("空空")
? ? ?? ??? ?;
? ? ?? ??? ?}
? ? ?? ??? ?
? ? ?? ?if (marketposition==-1)?
? ??
? ? ?? ? ?{
? ? ? ? ??? ?BuyToCover(lotsold,c) and Buy(lotsnew,c)?
? ? ?? ??? ?;
? ? ?? ? ? if (timecondition==True ) Alert("空空")
? ? ?? ??? ?;
? ? ?? ? ? }
? ? ?? ?
? ? ?? ? }
? ? ?? ? ??
? ? ?//---------------------------------------------------------------------------------------
? ? ?If ?( CNspk==true )//and CurrentTime>0.1045
? ? ?? ?{
? ? ?? ?
? ? ? ? ?? ?if (MarketPosition==0?? ? ? ?) ??
? ? ?? ??? ?{
? ? ?? ? ??? ?SellShort(Lotsnew,c)
? ? ?? ??? ?;
? ? ?? ??? ?if (timecondition==True ) Alert("空空")
? ? ? ? ? ?? ?;
? ? ?? ??? ?}
? ? ?? ?if (marketposition==1
? ? ?? ? ? ?) ?
? ? ?? ??? ?{
? ? ?? ??? ?sell(lotsold,c) and SellShort(Lotsnew,c)
? ? ?? ??? ?;
? ? ?? ??? ?if (timecondition==True ) Alert("空空")
? ? ?? ?;
? ? ?? ?}
? ? ?? ?
? ? ?? ?} ? ?
? ? }
? ??
? ?OnBarClose(ArrayRef<Integer> indexs)
? ?
? ?{
? ??? ?SetTriggerBarClose(settime);
? ??? ?}
一個布林通道實例,限制交易時間在每個小時k線即將結束2分鐘。
?
?來源:CXH99.COM
開發手冊就是沒有啊,具體的視頻及案例課的鏈接可以給個嗎?
?
onbarclose里不寫交易業務的代碼?寫個settrigger是什么意思?
建議再好好看看開發手冊或者學習視頻里?關于時間驅動的視頻及案例課