请大神帮忙写个MACD的策略 [MC]
-
MC用户求助:
开多:15分钟macd的diff大于dea,且3分钟macd,diff上穿dea开多,dea下穿diff平多
开空:15分钟macd的dea大于diff,且3分钟macd,dea下穿diff开孔,diff上穿dea平空
-
MC回复讨论一:
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: diff1( 0,data1 ), diff2(0,data2), dea1( 0, data1 ), dea2(0, data2);
diff1 = MACD( Close, FastLength, SlowLength ) data1 ;
dea1 = XAverage( diff1, MACDLength ) data1;
diff2 = MACD( Close, FastLength, SlowLength ) data2 ;
dea2 = XAverage( diff2, MACDLength ) data2;
if diff2>dea2 and diff1 cross over dea1 then
buy next bar at market;
if diff2>dea2 and marketposition=1 and dea1 cross under diff1 then
sell next bar at market;
if dea2>diff2 and dea1 cross under diff1 then
sellshort next bar at market;
if dea2>diff2 and marketposition=-1 and diff1 cross over dea1 then
buytocover next bar at market;
您需要打开一个3分钟周期的商品合约,另外再插入一个15分钟周期的商品合约
-
MC回复讨论二:
谢谢管理员,但是和我想的不一样,平单后还自动同方向开单,没有空仓期
-
MC回复讨论三:
按照您的策略来写的,您可以自己再进一步修改完善!
-
MC回复讨论四:
按照您的策略来写的,您可以自己再进一步修改完善!
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容