小幫手您好 以下程式碼主要是抓取高低點 目前所計算出之5日均價線為當天之數據 請問如何抓取當下要抓k棒位置的5日均價線數據 謝謝~~
input:shortlenghth(5);
settotalBar(30);
variable:shortaverage(0);
shortaverage = average(close,shortlenghth);
value1 = swingHigh(h,50,2,2,1); //第一頭最高點
value2 = swingHigh(h,50,2,2,2); //第一頭收盤價
value3 = swingLow(l,50,2,2,1); //第一底最低價
value4 = swingLow(l,50,2,2,2); //第一底收盤價
//value5 = swingLow(l,20,2,2,3);
value6 = shortaverage;
condition1 = value1>value2;//頭頭高
condition2 = value3 > value4;//底底高
condition3 = (close[1]<shortaverage) and (open[1]>close[1]) and (close > open) and (close >high[1]) ;//and(close>close[1]) and (close > open)
if condition1 and condition2 and condition3 then ret =1;
1 評論