DMI的EasyLanguage語法代碼分享
作者:佚名 來源:本站原創 發布時間:2016年03月31日
TradeStation語法分享(1)—DMI
input:Length(14),down(20);
Variables:DMIP(0),DMIM(0),DX(0),ADX_n(0),ADXR_n(0);
DMIP = DMIPlus(Length);
DMIM = DMIMinus(Length);
DX = DMI(Length);
ADX_n = ADX(Length);
ADXR_n = ADXR(Length);
if ADX_n > down and ADX_n > DMIM and ADX_n > DMIP then begin
if DMIP cross over DMIM then
buy next bar at market;
if DMIP cross under DMIM then
exitlong next bar at market;
end;
if ADX_n > down and ADX_n > DMIM and ADX_n > DMIP then begin
if DMIP cross over DMIM then
exitshort next bar at market;//m.kzuj.com.cn
if DMIP cross under DMIM then
sell next bar at market;
end;