請教出現array bounds wrong index value 處理方法
我抄別人的程式碼,抄完結果發現array bounds wrong index value,該怎樣解決,有朋友試過嗎??陣列錯誤
檢查陣列 var: ID(-1),oo(0),windows_high(0),windows_low(0),direction(0),z(0);
arrays: high1(0),low1(0);
//recording the highand low
oo=oo+1;
high1 = high;
high1 = Time;
high1 = Date;
low1 = low;
low1 = Time;
low1 = Date;
//confirm high and low signal indicator
value1 = Average(high,20);
value2 = Average(low,20);
//plot the high and low chart
condition1 = close > value2 and close < value2; //bear signal
condition2 = close < value1 and close > value1; //bull signal
if condition1 then windows_high = 0;
if close > value1 then windows_high = windows_high+1; //calculate high windows for searching
if condition2 then windows_low = 0;
if close < value2 then windows_low = windows_low+1; //calculate low windows for searching
if windows_high = 0 and windows_high<>0 then
value3 = highest(high,windows_high); //find the highest price during the windows
if windows_low = 0 and windows_low<>0 then
value4 = lowest(low,windows_low); //find the lowest price during the windows
if windows_high = 0 and windows_high<>0 then begin
for z = oo-windows_high to oo begin
if high1>value1 and high1 = value3 then begin
ID = text_new(high1,high1,high1, "HIGH");
text_setcolor(id,white);
break;
end;
end;
end;
if windows_low = 0 and windows_low<>0 then begin
for z = oo-windows_low to oo begin
if low1<value2 and low1 = value4 then begin
ID = text_new(low1,low1,low1, "LOW");
text_setcolor(id,white);
break;
end;
end;
end;
jason666 發表於 20-10-27 15:30
陣列錯誤
檢查陣列
附上程式碼了,能教教我怎麼改嗎? 疑?我貼上去
----- 已成功編譯------
沒有錯阿,很眼熟,
我有看也有打,是 Better Trading 的高低點標註
他給的是
Arrays: high1(0), Low1(0);
不過一樣
----- 已成功編譯------
我也不知道為何你會錯誤?? jason666 發表於 20-10-29 22:45
他給的是
Arrays: high1(0), Low1(0);
對,better trading的,是成功編輯了,但是要在放上圖的時候出現這個字
本帖最後由 jason666 於 20-10-30 21:22 編輯
我的是可以,你看看
我是新手,
也不知道你是那邊問題出現錯誤訊息
我非人 發表於 20-10-30 01:05
對,better trading的,是成功編輯了,但是要在放上圖的時候出現這個字
arrays: high1(0),low1(0);
你的arrays只有15000個元素, 你的圖超過15000支bar, 放不下了,
改為 arrays: high1(0),low1(0);
或限制你的圖只看15000支bar
SALLY 發表於 20-10-30 23:02
arrays: high1(0),low1(0);
你的arrays只有15000個元素, 你的圖超過15000支bar, 放不 ...
多謝前輩,真是一言驚醒夢中人啊,換成日線圖來看是成功了
原來如此,有收穫,謝謝 SALLY
頁:
[1]