TB跨周期、跨品种调用数据实现方法.pptx
文本预览下载声明
TB跨周期、跨品种调用数据的实现方法;关于跨周期;写公式信息文件;图表1;跨周期举例(一);操作步骤一;操作步骤二;操作步骤三;Vars
NumericSeries DayMAValue;
StringSeries strKey;
string strValue;
Begin
If(Date!=Date[1])
{
strKey = DateToString(Date[1]);
}Else
{
strKey = strKey[1];
}
strValue = GetTBProfileString(DayMA,strKey);
If(strValue != InvalidString)
{
DayMAValue = Value(strValue);
}Else
{
DayMAValue = DayMAValue[1];
}
PlotNumeric(DayMA,DayMAValue);
End;跨周期例子(一);跨品种、跨周期例子(二);操作步骤一;操作步骤二;操作步骤三;Params
Numeric length(10);
Numeric length1(10);
Numeric length2(20);
Vars
Numeric MA1;
Numeric MA2;
string strkeyDate;
Begin
MA1 = AverageFC(Close,length1);
MA2 = AverageFC(Close,length2);
strKeyDate = DateToString(Date)+:+Text(Hour);
SetTBProfileString(Symbol,HourMA1:+strKeyDate,Text(MA1));
SetTBProfileString(Symbol,HourMA2:+strKeyDate,Text(MA2));
PlotNumeric(HourMA1,MA1);
PlotNumeric(HourMA2,MA2);
End;操作步骤四;Vars
NumericSeries DayMA1;
NumericSeries DayMA2;
NumericSeries HourMA1;
NumericSeries HourMA2;
StringSeries strKeyDate;
StringSeries strKeyHour;
string DayValue1;
string DayValue2;
string HourValue1;
string HourValue2;
Begin
If(Date!=Date[1])
strKeyDate = DateToString(Date);
Else
strKeyDate = strKeyDate[1];
If(Hour!=Hour[1])
strKeyHour = DateToString(Date)+:+Text(Hour);
Else
strKeyHour = strKeyHour[1];
; //读取日线
DayValue1 = GetTBProfileString(“If000,DayMA1:+strKeyDate);
DayValue2 = GetTBProfileString(“If000,DayMA2:+strKeyDate);
//读取小时线
HourValue1 = GetTBProfileString(“If000,HourMA1:+strKeyHour);
HourValue2 = GetTBProfileString(“If000,HourMA2:+strKeyHour);
DayMA1 = Value(DayValue1);
DayMA2 = Value(DayValue2);
HourMA1 = Value(HourValue1);
HourMA2 = Value(HourValue2);
//输出
PlotNumeric(DayMA1,DayMA
显示全部