Rss & SiteMap

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

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

标题:控制语句下赋值为何无法改变变量?

1楼
gongxiangban 发表于:2015/5/18 11:14:28
控制语句下赋值为何无法改变变量?

我好几个IF下赋值变量step

第一层是 step :=1;

接着是 step:=2.

等等。

为什么输出出来变量只有一个值?


2楼
gongxiangban 发表于:2015/5/18 11:15:37
if time=opentime(0) then begin
   step:=0;
end

   
if ( close - enterprice<30*MINDIFF and step <= 1) then 
begin 
stopBuyLine:= enterprice - max(50*MINDIFF*atr,50*MINDIFF),nodraw;
step: = 1,nodraw;
end;
else 
 if  (close - enterprice>=30*MINDIFF and close - enterprice<昨收*0.01
 and ( step=1 or step=2 ) ) then 
begin 
    stopBuyLine:= enterprice + 10*MINDIFF;
    step: = 2,nodraw;
end;
else 
if (close - enterprice>=昨收*0.01 and close - enterprice<昨收*0.02 
 and ( step=2 or step=3 ) ) then 
begin 
stopBuyLine:=  enterprice + (close - enterprice)*0.5 ,nodraw;
step:=3,nodraw;
end;
else 
if (close - enterprice > 昨收*0.02  and ( step=3 or step=4 )) then 
begin 
stopBuyLine:=  enterprice + (close - enterprice)*0.65 ,nodraw;
step:=4,nodraw;
end;
end;
3楼
gongxiangban 发表于:2015/5/18 11:16:05
最后输出出来step永远都是4.
4楼
jinzhe 发表于:2015/5/18 11:29:56
请问step的初始定义是如何定义的?
5楼
gongxiangban 发表于:2015/5/18 11:31:50
初始语句是这段代码
if time=opentime(0) then begin
   step:=0;
end
6楼
gongxiangban 发表于:2015/5/18 11:32:07
运行在5分钟图标上,股指300
7楼
gongxiangban 发表于:2015/5/18 11:32:24

1、多单移动止损:当价格往成本上方移动30跳(6个点),将止损移至成本上方10跳。当价格往上移动1%,移动止损移至保护利润的50%,当价格往上移动2%以上,移动止损移至保护利润的65%

8楼
gongxiangban 发表于:2015/5/18 11:57:10
求版主大人明鉴。
9楼
jinzhe 发表于:2015/5/18 13:17:07
 variable:step=0;
if ( close - enterprice<30*MINDIFF and step <= 1) then 
begin 
stopBuyLine:= enterprice - max(50*MINDIFF*atr,50*MINDIFF),nodraw;
step: = 1,nodraw;
end;
else 
 if  (close - enterprice>=30*MINDIFF and close - enterprice<昨收*0.01
 and ( step=1 or step=2 ) ) then 
begin 
    stopBuyLine:= enterprice + 10*MINDIFF;
    step: = 2,nodraw;
end;
else 
if (close - enterprice>=昨收*0.01 and close - enterprice<昨收*0.02 
 and ( step=2 or step=3 ) ) then 
begin 
stopBuyLine:=  enterprice + (close - enterprice)*0.5 ,nodraw;
step:=3,nodraw;
end;
else 
if (close - enterprice > 昨收*0.02  and ( step=3 or step=4 )) then 
begin 
stopBuyLine:=  enterprice + (close - enterprice)*0.65 ,nodraw;
step:=4,nodraw;
end;
end;
10楼
gongxiangban 发表于:2015/5/18 13:43:25
谢谢,感觉可能是其他原因。
共14 条记录, 每页显示 10 条, 页签: [1] [2]


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