|
Params
Numeric Length(1);
Vars
Numeric newDate;
Numeric DayOffset;
Numeric dow;
Begin
If(BarType==0||BarType==4||BarType==5)//日线,周线,月线
{
newDate = Date[Length];
}Else
{
//18点以后算下一个交易日
DayOffset = 0;
dow = Weekday(Length);
If(Hour[Length]>=18)
{
If(dow==Friday) // 周五晚上
{
DayOffset = 3;
}Else If(dow==Saturday)//周六晚上
{
DayOffset = 2;
}Else
{
DayOffset = 1;
}
}Else
{
If(dow==Saturday)// 周六
{
DayOffset = 2;
}Else If(dow==Sunday)//周日
{
DayOffset = 1;
}
}
newDate = DateAdd(Date[Length],DayOffset);
}
Return newDate;
End
这是我从TB拷贝过来的一个函数,但是不能通过编译,请版主出手给予帮助,谢谢
|
|