這是教程的程序。問題 [金字塔]
- 咨詢內容:
簡單的說明:源碼
//中間變量
input:NS(5,0,60,1);
Price:=AVGENTERPRICE;//持倉價位
//交易條件
開多平空條件:=CROSS(MA(c,16),MA(c,5));
開空平多條件:=CROSS(MA(c,5),MA(c,16));
//交易系統
SELLSHORT(開多平空條件 and HOLDING<0,1,market);
SELLSHORT(HOLDING<0,1,Stopr,Price+NS); //止損
BUY(開多平空條件 and HOLDING=0,30%,market);
SELL(開空平多條件 and HOLDING>0,1,market);
SELL(HOLDING>0,1,Stopr,Price-NS);//止損
BUYSHORT(開空平多條件 and HOLDING=0,30%,market);//其他
資產:asset,noaxis,colorgreen,LINETHICK0;
持從:HOLDING,LINETHICK0;
總次數: TOTALTRADE,LINETHICK0;
盈刟:NUMWINTRADE,LINETHICK0;
此主題相關圖片如下:未命名.jpg
- 金字塔客服:
問題:1、沒有信號就是三角符號?沒有開倉新號吧! 2、SELLSHORT(HOLDING<0,1,Stopr,Price+NS); //止損;這里價格PRICE+NS指的是哪個價格,直接使用開倉價格:enterprice+ns可以嗎?3、如果空單是開倉價+ns止損,止盈就是 開倉價-ns;麻煩給寫一下吧;多單正好與之相反;4、我上午已經購買3年使用,今后要經常麻煩你們了;主要是把程序搞得好點;
5、圖中使用的源碼
( stopprice):=ma(c,20);
做多:=。。。。。
多空:。。。。。
//開多
IF ( stopprice)<做多THEN
BEGIN
SELLSHORT( HOLDING<0,HOLDING,market); //平空操作
BUY( HOLDING=0,1,market);//開多操作
maxprofit:=0;
END
//平倉
SELL((stopprice)>做空hand HOLDING>0,HOLDING,market);//平多
BUYSHORT((stopprice)>做空 and HOLDING=0,1,market); //開空操作//多頭為例回撤K3平倉
if enterbars>=3 then begin
if c>o and holding>0 then sell(1,holding,market);
if c<o then buy(holding>0,1,market);
end//空頭為例
if enterbars>=3 then begin
if c>o and holding<0 then sell(1,holding,market);
if c<o then buy(holding<0,1,market);
end給試試,要求就是第3根K線的處理:比如下跌趨勢,開倉成立;第3根K線,c>o,平倉止盈;之后,繼續按原反方向開倉,直到方向翻轉為止;
此主題相關圖片如下:未命名.jpg
- 用戶回復:
此主題相關圖片如下:未命名.jpg
- 網友回復:
//開多
IF ( stopprice)<l THEN
BEGIN
SELLSHORT( HOLDING<0,HOLDING,market); //平空操作
BUY( HOLDING=0,1,market);//開多操作
maxprofit:=0;
END
//平倉
SELL((stopprice)>h and HOLDING>0,HOLDING,market);//平多
BUYSHORT((stopprice)>hand HOLDING=0,1,market); //開空操作//多頭為例回撤K3平倉
if enterbars>=3 then begin
if c>o and holding>0 then sell(1,holding,market);
if c<o then buy(holding>0,1,market);
end//空頭為例
if enterbars>=3 then begin
if c>o and holding<0 then sell(1,holding,market);
if c<o then buy(holding<0,1,market);
end - 網友回復:
1.白色三角箭頭,表示這里有信號但是因為你指定的價格不能成交,所以變成不算作是信號
2.你指定的價格,PRICE是你自己定義的,是什么價格自己應該清除。想要用什么價格根據自己的需求來沒有固定的規矩
3.所謂止損不是指你要下止損單。這個是兩個意思,直接限價下單
sellshort(holding<0,0,limitr,enterprice-ns);
sell(holding>0,0,limitr,enterprice+ns);
4.ok
5.
if enterbars>=3 then begin
if c>o and holding>0 then sell(1,holding,market);
if c<o and type(1)= 2 then buy(holding>=0,1,market);
end//空頭為例
if enterbars>=3 then begin
if c>o and holding<0 then sellshort(1,holding,market);
if c<o and type(1)=4 then buyshort(holding<=0,1,market);
end
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容