金字塔對應平倉示例[金字塔模型]
相關標簽:外匯交易mt4如何平倉,平倉交易,交易開拓者 平倉效率,貴金屬交易平倉是什么,內海直子迅雷原創專區,晚中晚bt原創專區,原創專區,網賺原創教程專區,惠比特交易和配種專區,
開倉條件為A對應平倉條件A1。開倉條件為B的話對應平倉條件為B1。
模型策略源碼:
VARIABLE:aa=0;
VARIABLE:bb=0;
if holding=0 then aa:=0;
if holding=0 then bb:=0;
h20:ref(hhv(h,20),1);
l20:ref(llv(l,20),1);
ma2:ma(c,30);
A:=cross(c,h20);
A1:=cross(l20,c);
B:=cross(c,ma2);
B1:=cross(ma2,c);
if aa=1 and holding>0 and A1 then sell(1,holding,limitr,c);
if bb=1 and holding>0 and B1 then sell(1,holding,limitr,c);
if A and holding=0 then
begin
buy(1,1,limitr,c);
IF A and holding>0 THEN aa:=1;
end
if B and holding=0 then
begin
buy(1,1,limitr,c);
IF B and holding>0 THEN bb:=1;
end
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容