自編一個(gè)實(shí)現(xiàn)顯示分鐘線周期k線走完剩余時(shí)間的指標(biāo),顯示不正確,請(qǐng)版主幫助修正一下
作者:開(kāi)拓者 TB 來(lái)源:cxh99.com 發(fā)布時(shí)間:2015年06月22日
- 咨詢內(nèi)容:
Vars
NumericSeries extm;
NumericSeries retm;
NumericSeries totm;
Begin
If(bartype()<>1)
Return;
If(Time()==0.1510 and BarType()==1 and BarInterval()==10)
totm=5*60;
Else
totm=BarInterval()*60;
If(BarStatus()==2 and Time()>=0.0900 and Time()<=0.1129 or BarStatus()==2 and Time()>=0.1300 and Time()<=0.1514)
{
retm=totm-TimeDiff(Time(),CurrentTime());
PlotString("Retm",text(retm),0);
}
Else
Return;
End
- TB技術(shù)人員:
能應(yīng)用在股指上就行,我的思路是定義該周期的總共時(shí)間秒數(shù)totm,然后減去當(dāng)前時(shí)間和k線時(shí)間標(biāo)記time差值得到剩余時(shí)間,轉(zhuǎn)化字符并顯示。 Time()>=0.0900 and Time()<=0.1129和Time()>=0.1300 and Time()<=0.1514主要是想界定交易時(shí)間和非交易時(shí)間,有沒(méi)有一個(gè)函數(shù)可以直接返回開(kāi)市交易狀態(tài)的,有這樣的函數(shù)更方便一些。