為什么變量不滿足條件程序卻執行了命令
作者:開拓者 TB 來源:cxh99.com 發布時間:2016年03月30日
- 咨詢內容:
- Params
- Numeric Length1(12);
- Numeric Length2(26);
- Numeric LengthSignal(9);
- Numeric X(0.25);
- Vars
- NumericSeries MACD;
- NumericSeries Signal;
- NumericSeries Histogram;
- Numeric i;
- Numeric j;
- Numeric DeltaH;
- Begin
- MACD = XAverage( Close,Length1 ) - XAverage( Close,Length2 );
- Signal = XAverage( MACD,LengthSignal );
- Histogram = MACD[0] - Signal[0];
-
- If( Histogram < 0 )
- {
- While( Histogram[i] < 0 )
- {
- i = i + 1;
- }
- DeltaH = Histogram[0] - Lowest( Histogram,i );
- If( DeltaH >= X && MarketPosition <> 1 );
- {
- Buy( 1,Close );
- }
- }
- If( Histogram > 0 )
- {
- While( Histogram[j] > 0 )
- {
- j = j + 1;
- }
- DeltaH = Highest( Histogram,j ) - Histogram[0];
- If( DeltaH >= X && MarketPosition <> -1 );
- {
- SellShort( 1,Close );
- }
- }
- Commentary( "histogram:"+Text(Histogram) );
- Commentary( "highesthistogram:"+Text(Highest( Histogram,j )) );
- Commentary( "lowesthistogram:"+Text(Lowest( Histogram,i )) );
- Commentary( "delta:"+Text(DeltaH) );
- Commentary("狀態:"+Text(MarketPosition));
- End
- TB技術人員:
我找到問題了。。。。。。。。
非常不好意思。。。。
- TB客服:
能問一下,是什么問題嗎,看不出來.
- 網友回復:
smalltown 發表于 2016-2-4 16:07
能問一下,是什么問題嗎,看不出來.
額。。。if那一句后面不能加分號。。。加了分號這個條件就沒有用上了。