開拓者 TB Extremes 函數(shù)的問題
作者:開拓者 TB 來源:cxh99.com 發(fā)布時(shí)間:2013年04月14日
- 咨詢內(nèi)容: Params
NumericSeries Price(1);
Numeric Length(10);
Bool bMax(True);
NumericRef ExtremeBar;
Vars
NumericSeries MyVal;
NumericSeries MyBar;
Numeric i;
Begin
MyVal = Price;
MyBar = 0;
If ( CurrentBar <= Length - 1 || MyBar[1] == Length - 1)
{
for i = 1 to Length - 1
{
If (bMax )
{
If ( Price[i] > MyVal)
{
MyVal = Price[i];
MyBar = i;
}
}Else
{
If ( Price[i] < MyVal)
{
MyVal = Price[i];
MyBar = i;
}
}
}
}Else
{
If ( bMax )
{
If ( Price >= MyVal[1])
{
MyVal = Price;
MyBar = 0;
}Else
{
MyVal = MyVal[1];
MyBar = MyBar[1] + 1;
}
}Else
{
If ( Price <= MyVal[1])
{
MyVal = Price;
MyBar = 0;
}Else
{
MyVal = MyVal[1];
MyBar = MyBar[1] + 1;
}
}
}
ExtremeBar = MyBar;
Return MyVal;
End
If ( CurrentBar <= Length - 1 || MyBar[1] == Length - 1)代表的是圖表里是否數(shù)據(jù)足夠的一種判斷?else后面是圖標(biāo)的K線比你參數(shù)的多的時(shí)候的一種判斷?
If ( Price >= MyVal[1])
{
MyVal = Price;
MyBar = 0;
這句話其實(shí)就是和前一個(gè)在比較,怎么能算極值呢?
還有對于Bmax的要求 表達(dá)式是否是肯定是一個(gè)極端,否定就是另外一個(gè)極端?
- TB技術(shù)人員: 再頂下 求回答··