以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  怎么截取盘中最高盈利值?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=147955)

--  作者:a383623133
--  发布时间:2017/2/20 11:18:30
--  怎么截取盘中最高盈利值?
如题所问。
--  作者:jinzhe
--  发布时间:2017/2/20 11:26:53
--  

a1:=ref(asset,todaybar);

最高盈利:hhv(asset-a1,todaybar);


--  作者:a383623133
--  发布时间:2017/2/20 11:39:51
--  
我想要的是实际账户的盘中浮盈最高值
--  作者:jinzhe
--  发布时间:2017/2/20 13:14:35
--  

if taccount(4)>extgbdata(\'fy\') then extgbdataset(\'fy\',taccount(4));

 

if time=closetime(0) then extgbdataset(\'fy\',taccount(4));

 

 

extgbdata(\'fy\')为所求值

不能用在图表交易里


--  作者:a383623133
--  发布时间:2017/2/20 14:07:44
--  

想做到最高浮盈超过1000回撤到800就平仓,改怎么使用?


--  作者:jinzhe
--  发布时间:2017/2/20 14:15:52
--  

if taccount(4)>extgbdata(\'fy\') then extgbdataset(\'fy\',taccount(4));

if taccount(4)<=extgbdata(\'fy\')-200 then begin

   tsell(1,0,mkt);

   tsellshort(1,0,mkt);

end

 

if time=closetime(0) then extgbdataset(\'fy\',taccount(4));


--  作者:a383623133
--  发布时间:2017/2/20 15:38:04
--  
extgbdataset(\'fy\',taccount(4));里的FY是不是只最高浮盈金额?如果是1000就是extgbdataset(\'1000\',taccount(4));?
--  作者:jinzhe
--  发布时间:2017/2/20 15:55:42
--  
以下是引用jinzhe在2017-2-20 13:14:35的发言:

if taccount(4)>extgbdata(\'fy\') then extgbdataset(\'fy\',taccount(4));

 

if time=closetime(0) then extgbdataset(\'fy\',taccount(4));

 

 

extgbdata(\'fy\')为所求值

不能用在图表交易里

extgbdata(\'fy\')是最高值,如果最高盈利是1000那么extgbdata(\'fy\')为1000