我想將標題的三個項目合併成一個示警監控,如下方式,不曉得程式上有沒有問題呢?
settotalbar(5);
{判斷狀況}
condition1= ( open[1] - close[1] ) >(high[1] -low[1])*0.75 ;//狀況1: 前期出長黑K棒
condition2= close[1] < close[2] - high[2]-low[2] ;//狀況2: 前期呈波動放大下跌
condition3= ( close - open ) >(high -low) * 0.75 ;//狀況3: 當期紅棒
condition4= high < high[1] ;//狀況4: 高不過昨高
condition5= low>low[1] ;//狀況5: 低不破昨低
// RSI短天期往上穿越長天期
//
input: ShortLength(2), LongLength(12);
settotalbar(maxlist(ShortLength,LongLength,6) * 8 + 8);
SetInputName(1, "短期期數");
SetInputName(2, "長期期數");
// RSI短天期往上穿越長天期
input: Length(5), RSVt(3), Kt(3), lowBound(25);
SetTotalBar(maxlist(Length,6) * 3 + 8);
SetInputName(1, "計算期數");
SetInputName(2, "RSVt權數");
SetInputName(3, "Kt權數");
setInputName(4, "低檔區");
variable: rsv(0), k(0), _d(0);
Stochastic(Length, RSVt, Kt, rsv, k, _d);
{結果判斷}
IF k<lowBound
and k crosses under _d
and RSI(Close, ShortLength) Crosses Above RSI(Close, LongLength)
and condition1
and condition2
and condition3
and condition4
and condition5
THENRET=1;
8 評論