自編一個實現顯示分鐘線周期k線走完剩余時間的指標,顯示不正確,請版主幫助修正一下
作者:開拓者 TB 來源:cxh99.com 發布時間:2015年06月22日
- 咨詢內容:
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技術人員:
能應用在股指上就行,我的思路是定義該周期的總共時間秒數totm,然后減去當前時間和k線時間標記time差值得到剩余時間,轉化字符并顯示。 Time()>=0.0900 and Time()<=0.1129和Time()>=0.1300 and Time()<=0.1514主要是想界定交易時間和非交易時間,有沒有一個函數可以直接返回開市交易狀態的,有這樣的函數更方便一些。