我使用版友寫的範例,想做出跟內建指標完全一模一樣的多空轉換時機。
綠轉紅
input: Length(12);
variable: _Index(0), HV(0), LV(0);
settotalbar(200);
HV = Close[1];
LV = Close[1];
for _Index = 2 to Length + 1
begin
if HV <= Close[_Index] then HV = Close[_Index];
if LV >= Close[_Index] then LV = Close[_Index];
end;
if Close[1] < LV[1] and Close > HV then ret=1;
紅轉綠
input: Length(12);
variable: _Index(0), HV(0), LV(0);
settotalbar(200);
HV = Close[1];
LV = Close[1];
for _Index = 2 to Length + 1
begin
if HV <= Close[_Index] then HV = Close[_Index];
if LV >= Close[_Index] then LV = Close[_Index];
end;
if Close[1] > HV[1] and Close < LV then ret=1;
我使用1分K來做警示訊號,商品是台指期,2個各為1個訊號,但實測沒有依照XQ內建的紅綠轉換時間,而且誤差很多,請問要如何設定才能跟XQ內建的指標多空轉換時間完全一模一樣?
2 評論