Rss & SiteMap

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

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

标题:[求助]外生全局变量初始化的问题~

1楼
bbking 发表于:2011/11/23 22:10:17

 

if islastbar and dynainfo(207)<92500 then begin
extgbdataset('AAC1_hold',0);
end

 

这个是时间段初始化~

有无办法在我运行这个程序的时候无论什么时间段都可以初始化那个变量为0呢?

就是我运行这个程序的2秒内自动帮我赋值为0~之后就不用管了...由其他语句赋值~

仅仅在我运行这个程序的第一秒...

 

if islastbar and 本程序运行时间<2秒 then begin
extgbdataset('AAC1_hold',0);
end

2楼
阿火 发表于:2011/11/23 22:36:03

globalvariable:aa=0;

 ……

if not(islastbar) then exit;

aa:=aa+1;

if aa<3 then extgbdataset('AAC1_hold',0);

[此贴子已经被作者于2011-11-23 22:37:56编辑过]
3楼
patrickauqq 发表于:2011/11/24 10:49:42
 if ((CROSS(CBLP,C) AND CBLC>C) OR (CBLP>C AND CROSS(CBLC,C))) AND DD1 and islastbar and barpos>extgbdata('t') then begin//condition蜊峈眈茼腔沭璃
 playsound(1,'C:\Weisoft Stock\BW-DOWN.wav');
 extgbdataset('t',barpos);
 end
請問有无办法在我运行这个程序't'变量的时候无论什么时间段都可以初始化那个变量为0呢?
4楼
fly 发表于:2011/11/24 11:10:45
2楼的,把extgbdataset('AAC1_hold',0);-----里面的变量改为自己的变量即可-----extgbdataset('t',0);
5楼
patrickauqq 发表于:2011/11/24 12:29:51
以下是引用fly在2011-11-24 11:10:45的发言:
2楼的,把extgbdataset('AAC1_hold',0);-----里面的变量改为自己的变量即可-----extgbdataset('t',0);

globalvariable:aa=0;

if not(islastbar) then exit;

aa:=aa+1;

if aa<3 then extgbdataset('t',0);

if ((CROSS(CBLP,C) AND CBLC>C) OR (CBLP>C AND CROSS(CBLC,C))) AND DD1 and islastbar and barpos>extgbdata('t') then begin//condition改為相應的條件

playsound(1,'C:\Weisoft Stock\BW-DOWN.wav');
extgbdataset('t',barpos);
end


是否这樣更改,对不对呀!

[此贴子已经被作者于2011-11-24 12:40:10编辑过]
6楼
patrickauqq 发表于:2011/11/24 13:46:47
以下是引用fly在2011-11-24 11:10:45的发言:
2楼的,把extgbdataset('AAC1_hold',0);-----里面的变量改为自己的变量即可-----extgbdataset('t',0);

globalvariable:aa=0;

if not(islastbar) then exit;

aa:=aa+1;

if aa<3 then extgbdataset('t',0);

if ((CROSS(CBLP,C) AND CBLC>C) OR (CBLP>C AND CROSS(CBLC,C))) AND DD1 and islastbar and barpos>extgbdata('t') then begin//condition改為相應的條件

playsound(1,'C:\Weisoft Stock\BW-DOWN.wav');
extgbdataset('t',barpos);
end


是否这樣更改,对不对呀!

7楼
fly 发表于:2011/11/24 13:49:08
是的
8楼
patrickauqq 发表于:2011/11/25 7:40:26

再問多一些,若有两個变量是否这樣写???

globalvariable:aa=0;

if not(islastbar) then exit;

aa:=aa+1;

if aa<3 then extgbdataset('t',0);

if aa<3 then extgbdataset('tt',0);

 

 

9楼
fly 发表于:2011/11/25 8:55:05

是,三个的话依次类推.

共9 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02051 s, 2 queries.