自己寫了個指標 加入TB后會導致未響應。。。 - TradeBlazer公式 [開拓者 TB]
- 咨詢內(nèi)容:
自己寫了個顧比倒數(shù)線指標 按道理來說不應該出現(xiàn)這種情況啊
while應該不會死循環(huán)的。。。怎么出現(xiàn)了這種情況- Params
- Numeric Length(5);
- Vars
- NumericSeries CBL_High;
- NumericSeries CBL_Low;
- Numeric TmpValue;
- Numeric Hest;
- Numeric Lest;
- Numeric e;
- Begin
- Hest = Highest(High[1],Length);
- Lest = Lowest(Low[1],Length);
-
- If(CurrentBar < Length)
- {
- CBL_High = High;
- CBL_Low = Low;
- }
- Else
- {
- If(High < Hest)
- {
- CBL_High = CBL_High[1];
- }
- Else
- {
- e = 1;
- TmpValue = Low;
- While(Low[e] > TmpValue Or e < 100) e = e + 1;
- TmpValue = Low[e];
- While(Low[e] > TmpValue Or e < 100) e = e + 1;
- CBL_High = Low[e];
- }
-
- If(Low > Lest)
- {
- CBL_Low = CBL_Low[1];
- }
- Else
- {
- e = 1;
- TmpValue = High;
- While(High[e] < TmpValue Or e < 100) e = e + 1;
- TmpValue = High[e];
- While(High[e] < TmpValue Or e < 100) e = e + 1;
- CBL_Low = High[e];
- }
- }
- If(CBL_High < Close)
- {
- PlotNumeric("CBL_High",CBL_High,0,Yellow);
- PlotNumeric("CBL_Low",InvalidNumeric);
- }Else
- {
- PlotNumeric("CBL_High",InvalidNumeric);
- If(CBL_Low > Close)
- {
- PlotNumeric("CBL_Low",CBL_Low,0,Magenta);
- }Else
- {
- PlotNumeric("CBL_Low",InvalidNumeric);
- }
- }
- End
- Params
- TB技術人員:
while (e<100)
{
e=e+1;
TmpValue=IIF(TmpValue<High[e],High[e],TmpValue);
}
類似這樣改動呢? - TB客服:
唔 我那個while的目的是 找到比TmpValue大的high后記錄下e 然后退出循環(huán)
如果那么寫的話 貌似達不到這個效果吧 - 網(wǎng)友回復:
貌似就是這個意思。。。而且LZ的TmpValue也不是序列變量,這樣意思完全一樣啊
- 網(wǎng)友回復:
不 如果按照你那么改 便成了找出100個周期內(nèi)最大High 意思完全不一樣啊
相關文章
-
沒有相關內(nèi)容