以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  MC转金字塔哈  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=160493)

--  作者:gogokuer
--  发布时间:2017/12/18 11:11:30
--  MC转金字塔哈
 Inputs:lots(1),malen1(2),malen2(78),bolen(28),pp(0),pp2(0),dqsma(296);
variables:
v_AT_highest_bolen(0), v_AT_lowest_bolen(0), AV_Range(0), AV_MA1(0), AV_MA2(0),AV_DQ(0),highest_bolen(0),
AT_highest_bolen(0),lowest_bolen(0),AT_lowest_bolen(0),b_price(0),s_price(0),sell_price(0),btc_price(0),t_av_range(0);
AV_Range= AvgTrueRange(14);
AV_MA1 = Average(C, malen1); 
AV_MA2 = Average(C, malen2); 
AV_DQ = Average(C, dqsma); 
t_av_range= AV_DQ;
highest_bolen = Highest(H, bolen); 
AT_highest_bolen = AV_Range * pp + highest_bolen;
v_AT_highest_bolen= AT_highest_bolen;
lowest_bolen = Lowest(L, bolen); 
AT_lowest_bolen = lowest_bolen - AV_Range * pp2;
v_AT_lowest_bolen= AT_lowest_bolen;
if (MarketPosition= 0 and AV_MA1> AV_MA2 and Close> t_av_range)then   buy("LE") lots shares next bar at v_AT_highest_bolen stop;
if (MarketPosition= 0 and AV_MA1< AV_MA2 and Close< t_av_range) then  sellshort("SE") lots shares next bar at v_AT_lowest_bolen stop;
if (MarketPosition= 1 and AV_MA1< AV_MA2 )then  sell("SX") all shares next bar at   v_AT_lowest_bolen stop;
if (MarketPosition= -1 and AV_MA1> AV_MA2 )then buytocover("LX") lots shares next bar at v_AT_highest_bolen stop;


其实策略还蛮简单的,就是短均线大于长均线,并且收盘穿上轨做多~麻烦改一下,谢谢老师~谢谢!


--  作者:FireScript
--  发布时间:2017/12/18 11:26:14
--  
MC里面的函数和关键字 只是很模糊的懂是什么意思。 具体细节不得而知了。 你可以把上面策略详细的描述下,这样更方便我们处理。