3分钟跨60分钟KDJ, - TradeBlazer公式 [开拓者 TB]
作者:
开拓者 TB 来源:
cxh99.com 发布时间:2012年06月22日 点击数:
【
收藏到本网的会员中心】
- 咨询内容:
30分钟引用60分钟的kdj,老是不对,管理员帮帮忙,谢谢哈,看看有啥错误。
//------------------------------------------------------------------------
// 简称: KD0330
// 名称: KD0330
// 类别: 技术指标
// 类型: 振荡类
// 输出:
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// 简称: KDTRADER
// 名称: KDTRADER
// 类别: 交易指令
// 类型: 多头建仓
// 输出:
//------------------------------------------------------------------------
Params
Numeric Length(9);
Numeric SlowLength(3);
Numeric SmoothLength(3);
Vars
NumericSeries wvol1;
NumericSeries MyOpen;
NumericSeries MyHigh;
NumericSeries MyLow;
NumericSeries MyClose;
NumericSeries HighestValue2 ;
NumericSeries LowestValue2;
NumericSeries Dvalue2;
NumericSeries KValue2;
NumericSeries Value1;
NumericSeries Value2;
NumericSeries Value3;
NumericSeries Value4;
NumericSeries i;
Begin
MyHigh = DataConvert(High,"min",60,"High");
MyLow = DataConvert(Low,"min",60,"Low");
MyClose = DataConvert(Close,"min",60,"Close");
For i =SlowLength-1 DownTo 0
{
Value2 = TransMinsData(MyHigh,60,i);
Value3 = TransMinsData(MyLow,60,i);
Value4 = TransMinsData(MyClose,60,i);
HighestValue2 = HighestFC(Value2,Length);
LowestValue2 = LowestFC(Value3 , Length);
}
KValue2 = SMA((Value4 -Value3)/(Value2- Value3),SlowLength,1)*100;
DValue2 = SMA(KValue2,SmoothLength,1);
PlotNumeric("KValue2 ",KValue2 );
PlotNumeric("DValue2",DValue2);
End
- TB技术人员:
咋就没人回复呢,
- TB客服:
又写了一个,好像还是不对。
Params
Numeric Length(9);
Numeric SlowLength(3);
Numeric SmoothLength(3);
Numeric nMinSet(60);
Vars
NumericSeries MyClose;
NumericSeries MyHigh;
NumericSeries MyLow;
NumericSeries CloseValue;
NumericSeries HighestValue;
NumericSeries LowestValue;
NumericSeries RSV;
NumericSeries KValue;
NumericSeries DValue;
Numeric i;
Numeric j;
Begin
MyClose = DataConvert(Close,"min",nMinSet,"Close");
MyHigh = DataConvert(High,"min",nMinSet,"High");
MyLow = DataConvert(Low,"min",nMinSet,"Low");
LowestValue = MyLow; HighestValue = MyHigh;
For j = 0 To Length-1
{
LowestValue = Min(TransMinsData(MyLow,nMinSet,j),LowestValue);
HighestValue = Max(TransMinsData(MyHigh,nMinSet,j),HighestValue);
}
RSV = 100*(MyClose-LowestValue)/(HighestValue-LowestValue);
if (CurrentBar == 0 || KValue[1] == InvalidNumeric || DValue[1] == InvalidNumeric )
{
KValue = RSV; DValue = RSV;
}
Else
{
//For j = 1 To SlowLength
KValue = 1/SlowLength*RSV + (SlowLength-1)/SlowLength*TransMinsData(KValue,nMinSet,1);
DValue = 1/SmoothLength*KValue + (SmoothLength-1)/SmoothLength*TransMinsData(DValue,nMinSet,1);
}
//PlotNumeric("MyMinsK",KValue);
//PlotNumeric("MyMinsD",DValue);
//PlotNumeric("MyMinsRSV",RSV);
PlotNumeric("HighestValue",HighestValue);
PlotNumeric("LowestValue ",LowestValue);
End
- 网友回复:
能不能说一下这个指标的原理啊