Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:不知道问题在哪里,总说我end语句不完整

1楼
tonybig 发表于:2011/10/31 9:04:26

实在找不到 ,请大神帮忙

 

if holding=0 then begin
    if A1 then
    BUY(A1 ,1,limitr,A3+2*mindiff);
 end

if holding=0 then begin
    if A2 then
    buyshort(A2,1,limitr,A4-2*mindiff);
end

if holding>0 then begin
    if low>=enterprice-2*atr then
    sell(1,holding,limitr,atr));
   
    if A2 then
    sell(A2,holding,limitr,A4-2*mindiff);
    buyshort(A2,1,limitr,A4-3*mindiff);
end


if holding<0 then begin
    if high>=enterprice+2*atr then begin
    sellshort(1,holding,limitr,atr);
   
    if A1 then
    sellshort(A1,holding,limitr,A3+2*mindiff);
    buy(A1,1,limitr,A3+3*mindiff);
   
end//

//盈亏:asset-500000,noaxis,coloryellow,linethick2;

[此贴子已经被作者于2011-10-31 9:05:36编辑过]
2楼
just 发表于:2011/10/31 9:12:06

if holding=0 then begin
if A1 then BUY(A1 ,1,limitr,A3+2*mindiff); end
if holding=0 then begin
if A2 then buyshort(A2,1,limitr,A4-2*mindiff); end
if holding>0 then begin
if low>=enterprice-2*atr then sell(1,holding,limitr,atr);
if A2 then sell(A2,holding,limitr,A4-2*mindiff);
buyshort(A2,1,limitr,A4-3*mindiff); end
if holding<0 then begin
if high >=enterprice+2*atr then begin
sellshort(1,holding,limitr,atr); end
if A1 then sellshort(A1,holding,limitr,A3+2*mindiff);
 buy(A1,1,limitr,A3+3*mindiff); end// 

这里有两个BEGIN

[此贴子已经被作者于2011-10-31 9:15:02编辑过]
3楼
tonybig 发表于:2011/10/31 10:35:24

已修改,但仍然还是同样问题
if holding=0 then begin
    if A1 then
    BUY(A1 ,1,limitr,A3+2*mindiff);
 end

if holding=0 then begin
    if A2 then
    buyshort(A2,1,limitr,A4-2*mindiff);
end

if holding>0 then begin
    if low>=enterprice-2*atr then
    sell(1,holding,limitr,atr));
    if A2 then
    sell(A2,holding,limitr,A4-2*mindiff);
    buyshort(A2,1,limitr,A4-3*mindiff);
   
end


if holding<0 then begin
    if high>=enterprice+2*atr then
    sellshort(1,holding,limitr,atr);
    if A1 then
    sellshort(A1,holding,limitr,A3+2*mindiff);
    buy(A1,1,limitr,A3+3*mindiff);
end//

4楼
jinzhe 发表于:2011/10/31 10:50:20

很多条件是无用而且重复的,给你修改了下。

 

 

if a1 then  BUY(holding=0 ,1,limitr,A3+2*mindiff);


if a2 then buyshort(holding=0,1,limitr,A4-2*mindiff);

 

if low>=enterprice-2*atr then sell(holding>0,holding,limitr,atr);
if A2 then begin
    sell(holding>0,holding,limitr,A4-2*mindiff);
    buyshort(holding=0,1,limitr,A4-3*mindiff);
   
end

 

if high>=enterprice+2*atr then  sellshort(holding<0,holding,limitr,atr);
if A1 then begin
    sellshort(holding<0,holding,limitr,A3+2*mindiff);
    buy(holding=0,1,limitr,A3+3*mindiff);
end

 

5楼
just 发表于:2011/10/31 10:51:56
以下是引用tonybig在2011-10-31 10:35:24的发言:

已修改,但仍然还是同样问题
if holding=0 then begin
    if A1 then
    BUY(A1 ,1,limitr,A3+2*mindiff);
 end

if holding=0 then begin
    if A2 then
    buyshort(A2,1,limitr,A4-2*mindiff);
end

if holding>0 then begin
    if low>=enterprice-2*atr then
    sell(1,holding,limitr,atr));
    if A2 then
    sell(A2,holding,limitr,A4-2*mindiff);
    buyshort(A2,1,limitr,A4-3*mindiff);
   
end


if holding<0 then begin
    if high>=enterprice+2*atr then
    sellshort(1,holding,limitr,atr);
    if A1 then
    sellshort(A1,holding,limitr,A3+2*mindiff);
    buy(A1,1,limitr,A3+3*mindiff);
end//

 

多一个括号 , 去掉这个括号我这里编译通过。

6楼
tonybig 发表于:2011/10/31 12:42:40
好的 感谢楼上两位
共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.04004 s, 3 queries.