1. 首页
  2. 易语言 - EasyLanguage
  3. 均线与动向指标的交叉EMA and DMI Cross

均线与动向指标的交叉EMA and DMI Cross

An example of this strategy code:

inputs: 
     DMILength( 14 ) , 
     EMAShortLength( 5 ) , 
     EMALongLength( 10 ) , 
     StopLossAmt( 50 ) ; 
 
variables: 
     DMIPlusval( 0 ) , 
     DMIMinusval( 0 ) , 
     EMAShortVal( 0 ) , 
     EMALongVal( 0 ) ; 
 
DMIPlusval = DMIPlus(DMILength) ; 
DMIMinusval = DMIMinus(DMILength) ; 
EMAShortVal = XAverage( Close, EMAShortLength ) ; 
EMALongVal = XAverage( Close, EMALongLength ) ;	 
 
If EMAShortVal crosses over EMALongVal and  
   DMIPlusval crosses over DMIMinusval then 
	buy next bar at market ; 
 
If EMAShortVal crosses under EMALongVal and  
   DMIPlusval crosses under DMIMinusval then 
	sellshort next bar at market ; 
 
SetStopPosition ; 
SetStopLoss( StopLossAmt ) ; 
更新于 2020年6月5日

这篇文章对您有帮助吗?

相关的话题

留言评论