Value Chart - TradeBlazer公式 [開拓者 TB]
作者:
開拓者 TB 來源:
cxh99.com 發(fā)布時(shí)間:2012年06月01日 點(diǎn)擊數(shù):
【
收藏到本網(wǎng)的會(huì)員中心】
- 咨詢內(nèi)容:
可惜 TB 沒 辦法 在 小 圖 設(shè)定 畫BarChart
//------------------------------------------------------------------------
// 簡稱: Piggy_VChart
// 名稱: Piggy_VChart_1020
// 類別: 用戶函數(shù)
// 類型: 用戶函數(shù)
// 輸出: 數(shù)值型
//------------------------------------------------------------------------
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
// 確認(rèn) 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
// 版權(quán)所有 kevin_he
// 更改聲明 TradeBlazer Software保留對(duì)TradeBlazer平臺(tái)
// 每一版本的TrabeBlazer公式修改和重寫的權(quán)利
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// 簡稱: SH_ValueChart
// 名稱: SH_ValueChart_1023
// 類別: 公式應(yīng)用
// 類型: 用戶應(yīng)用
//------------------------------------------------------------------------
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
// 版權(quán)所有 kevin_he
// 更改聲明 TradeBlazer Software保留對(duì)TradeBlazer平臺(tái)
// 每一版本的TrabeBlazer公式修改和重寫的權(quán)利
//------------------------------------------------------------------------
2011-10-26_104548.jpg
(126.87 KB, 下載次數(shù): 0)
2011-10-26 10:48:31 上傳
- TB技術(shù)人員:
回復(fù) 1# Jackcarl
將英文高開低收作為plotnumeric就可以輸出k線了
,