|
新增一個指標,命名MACD2
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;
Plot1( var0, "MACD" ) ;
Plot2( var1, "MACDAvg" ) ;
//Plot3( var2, "MACDDiff" ) ;
Plot4( 0, "ZeroLine" ) ;
condition1 = var2 crosses over 0 ;
if condition1 then
Alert( "Bullish alert" )
else
begin
condition1 = var2 crosses under 0 ;
if condition1 then
Alert( "Bearish alert" ) ;
end;
if var2>0 then begin;
if var2<var2[1] then begin;
Plot7( var2, "Short" ) ;
end else begin;
Plot5( var2, "MACDDiff>0" ) ;
end;
end;
if var2<0 then begin;
if var2>var2[1] then begin;
Plot7( var2, "Short" ) ;
end else begin;
Plot6( var2, "MACDDiff<0" ) ;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
叫出MACD2指標,設定指標樣式,MACD>0設紅色,MACD<0設綠色,Short設灰色,三個類型都要"選柱狀圖",調整一下粗細,看看是不是你要ㄉ~
|
評分
-
查看全部評分
|