怎樣實(shí)現(xiàn)圖表交易 [金字塔]
- 咨詢內(nèi)容:
ma10:=ma(c,10);
orderc:=extgbdata('1');
if cross(ma5,ma10) then
tbuy(tholding=0,100,mkt);//5日均線上穿10日的時(shí)候開倉(cāng)
if c>=TAVGENTERPRICE*1.05 then tsell(tholding>0,0,mkt);//上漲5%后平倉(cāng),也就是現(xiàn)價(jià)是持倉(cāng)均價(jià)的1.05%時(shí)平倉(cāng)
if topenprofit<0 and cross(ma5,ma10) then begin
tbuy(tholding>0,100,mkt);
orderc:=orderc+1;
extgbdataset('orderc',orderc);
end //當(dāng)虧損的時(shí)候持有接著補(bǔ),orderc記錄補(bǔ)倉(cāng)次數(shù)
msgout(tholding<>ref(tholding,1),orderc)//當(dāng)倉(cāng)位發(fā)生變化時(shí)輸出記錄的倉(cāng)位值
-----怎樣實(shí)現(xiàn)圖表交易
- 金字塔客服:
樓主粘貼這段代碼是什么意思,要實(shí)現(xiàn)怎樣的圖表交易?
- 用戶回復(fù):
if cross(ma5,ma10) and b1=0 then begin
buy(holding=0,1,market);
b1:=1;
end
//5日均線上穿10日的時(shí)候開倉(cāng)if c>=AVGENTERPRICE*1.05 then sell(holding>0,0,market);//上漲5%后平倉(cāng),也就是現(xiàn)價(jià)是持倉(cāng)均價(jià)的1.05%時(shí)平倉(cāng)
if openprofit<0 and cross(ma5,ma10) and holding>0 and b1=1 then begin
buy(1,1,market);
a1:=a1+1;
end //當(dāng)虧損的時(shí)候持有接著補(bǔ),記錄補(bǔ)倉(cāng)次數(shù)s1:=numtostr(a1,1);
msgout(islastbar and holding<>ref(holding,1) ,s1); - 網(wǎng)友回復(fù):
ma5:=ma(c,5);
ma10:=ma(c,10);
variable:a1=0,b1=0;if cross(ma5,ma10) and b1=0 then begin
buy(holding=0,1,market);
b1:=1;
end
//5日均線上穿10日的時(shí)候開倉(cāng)if c>=AVGENTERPRICE*1.05 then sell(holding>0,0,market);//上漲5%后平倉(cāng),也就是現(xiàn)價(jià)是持倉(cāng)均價(jià)的1.05%時(shí)平倉(cāng)
if openprofit<0 and cross(ma5,ma10) and holding>0 and b1=1 then begin
buy(1,1,market);
a1:=a1+1;
end //當(dāng)虧損的時(shí)候持有接著補(bǔ),記錄補(bǔ)倉(cāng)次數(shù)s1:=numtostr(a1,1);
msgout(islastbar and holding<>ref(holding,1) ,s1);發(fā)現(xiàn)少了幾句,開頭少了。。。
如果以上指標(biāo)公式不適用于您常用的行情軟件
或者您想改編成選股公式,以便快速選出某種形態(tài)個(gè)股的話,
相關(guān)文章
-
指定的模型還沒有相關(guān)內(nèi)容!