以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  [求助]外生全局变量初始化的问题~  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=9111)

--  作者: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


--  作者:阿火
--  发布时间: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编辑过]

--  作者: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呢?
--  作者:fly
--  发布时间:2011/11/24 11:10:45
--  
2楼的,把extgbdataset(\'AAC1_hold\',0);-----里面的变量改为自己的变量即可-----extgbdataset(\'t\',0);
--  作者: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编辑过]

--  作者: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


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


--  作者:fly
--  发布时间:2011/11/24 13:49:08
--  
是的
--  作者: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);

 

 


--  作者:fly
--  发布时间:2011/11/25 8:55:05
--  

是,三个的话依次类推.