[求助]為何這段代碼編譯通不過請高手幫忙改改看看問題在哪 [金字塔]
- 咨詢內容:
last_high_0:=EXTGBDATA('last_high');
last_low_0:=EXTGBDATA('last_low');
kc_price_0:=EXTGBDATA('kc_price');
tx_holding_0:=EXTGBDATA('tx_holding');high_0:=high;
close_0:=close;
low_0:=low;
if tx_holding_0>0 and high_0>last_high_0 then EXTGBDATASET('last_high',high_0);
if tx_holding_0<0 and low_0<last_low_0 then EXTGBDATASET('last_low',low_0);
if last_high_0=kc_price_0 then last_high_0:=last_high_0+50;
if last_low_0 =kc_price_0 then last_low_0 :=last_low_0-50;開多倉后最高漲幅:=(last_high_0-kc_price_0)/kc_price_0;
開多漲回撤比例限制:=1/sqrt(開多倉后最高漲幅*100+止贏系數);
開多漲回撤幅度限制:=(last_high_0-kc_price_0)*開多漲回撤比例限制;
開多漲回撤價格限制:=last_high_0-開多漲回撤幅度限制;
if 開多倉后最高漲幅<1.5% then 開多漲回撤價格限制:=last_high_0*(1-止損百分比);pd_tj_多頭止損:=tx_holding_0>0 and ( close_0<kc_price_0*(1-止損百分比) );
pd_tj_多頭止贏:=tx_holding_0>0 and ( close_0<開多漲回撤價格限制 );
開空倉后最大跌幅:=(kc_price_0-last_low_0)/kc_price_0;
開空跌回撤比例限制:=1/sqrt(開空倉后最大跌幅*100+止贏系數);
開空跌回撤幅度限制:=(kc_price_0-last_low_0)*開空跌回撤比例限制;
開空跌回撤價格限制:=last_low_0+開空跌回撤幅度限制;
if 開空倉后最大跌幅<1.5% then 開空跌回撤價格限制:=last_low_0*(1+止損百分比);
pk_tj_空頭止損:=tx_holding_0<0 and ( close_0>kc_price_0*(1+止損百分比) );
pk_tj_空頭止贏:=tx_holding_0<0 and ( close_0>開空跌回撤價格限制 );{平多}EXITLONG: pd_tj_多頭止損 or pd_tj_多頭止贏 ,ORDERQUEUE ; { ,TFILTER; }
{平空}EXITSHORT: pk_tj_空頭止損 or pk_tj_空頭止贏 ,ORDERQUEUE ; { ,TFILTER; }
{開多}ENTERLONG: KD_TJ ,ORDERQUEUE ; { ,TFILTER; }
{開空}ENTERSHORT: KK_TJ ,ORDERQUEUE ; { ,TFILTER; }// 開多 保存全局變量
if ( KD_TJ and tx_holding_0<1 ) then
begin EXTGBDATASET('last_high',high_0);
EXTGBDATASET('last_low',low_0);
EXTGBDATASET('tx_holding',1);
EXTGBDATASET('kc_price',close_0);
end
// 開空 保存全局變量
if ( KK_TJ and tx_holding_0>-1 ) then
begin EXTGBDATASET('last_high',high_0);
EXTGBDATASET('last_low',low_0);
EXTGBDATASET('tx_holding',-1);
EXTGBDATASET('kc_price',close_0);
end
// 平多倉后保存全局變量
if (( pd_tj_多頭止損 or pd_tj_多頭止贏 ) and tx_holding_0>0 ) then
begin EXTGBDATASET('last_high',1);
EXTGBDATASET('last_low',1);
EXTGBDATASET('tx_holding',0);
EXTGBDATASET('kc_price',1);
end// 平空倉后保存全局變量
if (( pk_tj_空頭止損 or pk_tj_空頭止贏 ) and tx_holding_0<0 ) then
begin EXTGBDATASET('last_high',1);
EXTGBDATASET('last_low',1);
EXTGBDATASET('tx_holding',0);
EXTGBDATASET('kc_price',1);
end - 金字塔客服:
這段公式代碼不是完整的代碼,而只是一段偽代碼,里面很多地方需要用戶自己填寫自己的交易設置的。
如果你看不懂這些代碼,請用戶認真的先從金字塔的最基礎的地方開始學起,不要急躁
《金字塔決策交易系統公式編程》(基礎篇)
下載地址:http://www.weistock.com/download/FormulaHelp1.rar
《金字塔程式化交易設計指南》(高級篇)
下載地址:http://www.weistock.com/download/FormulaHelp2.rar
- 用戶回復:
代碼不全。
KD_TJ 沒有定義。 KD_TJ 就是開多倉的條件
KK_TJ 開空條件沒有定義
- 網友回復: 1.5% 要改成0.015
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容