求問 sma指標寫法
//sma 5-60inputs:len1(5),len2(60);
vars:ma1(0),ma2(0);
ma1=Xaverage(close,len1);
ma2=Xaverage(close,len2);
plot1(ma1);
plot2(ma2);
if ma1 > ma2 then begin
ma1=arw_new_self (date,time,high+10,true);
arw_setcolor(ma1,green);
end;
if ma2 < ma1 then begin
ma2=arw_new_self (date,time,low-10,false);
arw_setcolor(ma2,red);
end;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
我希望是 黃金交叉底下有個紅色箭頭標示往上
死亡交叉 上面有個綠色箭頭標示往下
請問如何改寫呢
if ma1 Cross under ma2 then begin
ma1=arw_new_self (date,time,high+10,true);
arw_setcolor(ma1,green);
end;
if ma1 Cross over ma2 then begin
ma2=arw_new_self (date,time,low-10,false);
arw_setcolor(ma2,red);
end; 萬分感謝粉紅豹 大大 3qQQQQQQQQQQQQQQQQQQQQQQQQQQ easytrader788 發表於 20-8-2 21:26
if ma1 Cross under ma2 then begin
ma1=arw_new_self (date,time,high+10,true);
arw_setcolor(ma1,green) ...
豹大大太強了~
.............
謝謝大大的分享
新手有需要多看,多想一些基本的寫法。
頁:
[1]