Value Chart - TradeBlazer公式 [开拓者 TB]
作者:
开拓者 TB 来源:
cxh99.com 发布时间:2012年06月01日 点击数:
【
收藏到本网的会员中心】
- 咨询内容:
可惜 TB 没 办法 在 小 图 设定 画BarChart
//------------------------------------------------------------------------
// 简称: Piggy_VChart
// 名称: Piggy_VChart_1020
// 类别: 用户函数
// 类型: 用户函数
// 输出: 数值型
//------------------------------------------------------------------------
Params
Numeric NumBars(5);
NumericSeries Price(1);
Vars
Numeric VarNumBars(0);
Numeric Var0(0);
Numeric LRange(0);
Numeric YDiv(0);
Numeric RanVar4(0);
Numeric VOpen(0);
Numeric VHigh(0);
Numeric VLow(0);
Numeric VClose(0);
Numeric VarA(0);
Numeric VarB(0);
Numeric VarC(0);
Numeric VarD(0);
Numeric VarE(0);
Numeric VarP(0);
Numeric VarR1(0);
Numeric VarR2(0);
Numeric VarR3(0);
Numeric VarR4(0);
Numeric VarR5(0);
Numeric Piggy_VChart_1020(0);
NumericSeries HighH(0);
NumericSeries LowL(0);
Begin
// 確認 NumBars 落在 2 到 10000 之間
If (NumBars < 2) VarNumBars = 2;
If (NumBars > 1000) VarNumBars = 1000;
If (NumBars >= 2 and NumBars <= 1000) VarNumBars = NumBars;
VarP = Round(VarNumBars / 5, 0);
HighH = Highest(High, VarP);
LowL = Lowest(Low, VarP);
If (VarNumBars > 7)
{
VarA = HighH - LowL;
If (VarA == 0 and VarP == 1)
{
VarR1 = Abs(Close - Close[VarP]);
} Else
{
VarR1 = VarA;
}
VarB = HighH[VarP + 1] - LowL[VarP];
If (VarB == 0 and VarP == 1)
{
VarR2 = Abs(Close[VarP] - Close[VarP * 2]);
}Else
{
VarR2 = VarB;
}
VarC = HighH[VarP * 2] - LowL[VarP * 2];
If (VarC == 0 and VarP == 1)
{
VarR3 = Abs(Close[VarP * 2] - Close[VarP * 3]);
}Else
{
VarR3 = VarC;
}
VarD = HighH[VarP * 3] - LowL[VarP * 3];
If (VarD == 0 and VarP == 1)
{
VarR4 = Abs(Close[VarP * 3] - Close[VarP * 4]);
}Else
{
VarR4 = VarD;
}
VarE = HighH[VarP * 4] - LowL[VarP * 4];
If (VarE == 0 and VarP == 1)
{
VarR5 = Abs(Close[VarP * 4] - Close[VarP * 5]);
}Else
{
VarR5 = VarE;
}
LRange = (VarR1 + VarR2 + VarR3 + VarR4 + VarR5) / 5 * 0.2;
}
If (VarNumBars <= 7)
{
If (Abs(Close - Close[1]) > High - Low)
{
Var0 = Abs(Close - Close[1]);
}Else
{
Var0 = High - Low;
}
If (High == Low)
{
Var0 = Abs(Close - Close[1]);
}
LRange = Average(Var0, 5) * 0.2;
}
If (LRange > 0)
{
If (Price == Open) Return Piggy_VChart_1020 = ((Open - Average((High + Low) / 2, VarNumBars))) / LRange;
If (Price == High) Return Piggy_VChart_1020 = ((High - Average((High + Low) / 2, VarNumBars))) / LRange;
If (Price == Low) Return Piggy_VChart_1020 = ((Low - Average((High + Low) / 2, VarNumBars))) / LRange;
If (Price == Close) Return Piggy_VChart_1020 = ((Close - Average((High + Low) / 2, VarNumBars))) / LRange;
}
End
//------------------------------------------------------------------------
// 编译版本 GS2010.12.08
// 用户版本 2011/10/21 01:34
// 版权所有 kevin_he
// 更改声明 TradeBlazer Software保留对TradeBlazer平台
// 每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// 简称: SH_ValueChart
// 名称: SH_ValueChart_1023
// 类别: 公式应用
// 类型: 用户应用
//------------------------------------------------------------------------
Params
Numeric NumBars(5);
Vars
NumericSeries VOpen(0);
NumericSeries VHigh(0);
NumericSeries VLow(0);
NumericSeries VClose(0);
Begin
VOpen = Piggy_VChart(NumBars, Open);
VHigh = Piggy_VChart(NumBars, High);
VLow = Piggy_VChart(NumBars, Low);
VClose = Piggy_VChart(NumBars, Close);
PlotNumeric("VOpen", Vopen);
PlotNumeric("VHigh", VHigh);
PlotNumeric("VLow", VLow);
PlotNumeric("VClose", VClose);
PlotNumeric("8", 8);
PlotNumeric("4", 4);
PlotNumeric("-4", -4);
PlotNumeric("-8", -8);
PlotNumeric("0", 0);
End
//------------------------------------------------------------------------
// 编译版本 GS2010.12.08
// 用户版本 2011/10/23 00:38
// 版权所有 kevin_he
// 更改声明 TradeBlazer Software保留对TradeBlazer平台
// 每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------
2011-10-26_104548.jpg
(126.87 KB, 下载次数: 0)
2011-10-26 10:48:31 上传
- TB技术人员:
回复 1# Jackcarl
将英文高开低收作为plotnumeric就可以输出k线了
,