分析家公式网,提供股票公式,股票软件用户登录  |  用户 注册
金字塔fs2交易系统[金字塔模型]
  • 软件大小:0 Bytes
  • 推荐星级:
  • 更新时间:2013-03-10 00:42:18
  • 软件类别: 国产软件 / 金字塔公式
  • 软件语言:简体中文
  • 授权方式: 共享软件
  • 联系方式:暂无联系方式
  • 官方主页: Home Page
  • 点击大图:  【一键转帖到论坛】
  • 插件情况:
  • 运行环境:Win2000/WinXP/Win2003/WinVista
  • 相关Tags:金字塔公式  fs2交易  
  • (0)0%
    (0)0%

软件介绍

金字塔公式 金字塔模型策略源码:runmode:0;

input:unitoftime(15,5,15,5),length(4,1,6,1);
input:initialstop(2,2,6,1),trailingstop(4,2,6,1);
input:startdate(1110104,1,9999999,1),intraday(1,0,1,1);
input:money(0,0,10,1);
input:slippage(0,0,2,1);
input:debug(2,0,2,1);

variable:costprice=0,stopline=0;
variable:myasset=50000,mycurve=0;

if initialstop>trailingstop then exit;
if startdate>1 and date<startdate then exit;

database(\'provider=microsoft.jet.oledb.4.0;data source=e:\\Trade\\Report\\Report.mdb\');

begin
 if stricmp(marketlabel,\'sq\')=0 then
  label:=strleft(stklabel,2);
  
 if stricmp(marketlabel,\'dq\')=0 then
  label:=strleft(stklabel,1);
 
 if stricmp(marketlabel,\'zq\')=0 then
  label:=strleft(stklabel,2);
 
 if stricmp(marketlabel,\'zj\')=0 then
  label:=strleft(stklabel,2);
 
 if stricmp(label,\'cf\')=0 then begin
  marginratio:=0.17;
  commission:=12;
  tradeable:=true;
 end
 
 if stricmp(label,\'sr\')=0 then begin
  marginratio:=0.16;
  commission:=6;
  tradeable:=true;
 end
 
 if not(tradeable) then exit;
end         

begin  
 entertime1:=t0totime(timetot0(opentime(1))+60*(unitoftime+2));
 entertime2:=t0totime(timetot0(closetime(0))-60);
 exittime1:=t0totime(timetot0(closetime(0)));

 entertime:=time>=entertime1 and time<=entertime2;
 exittime:=time>=exittime1;
 
 cond:=day<>ref(day,1) or barpos=1;
 n:=barpos-valuewhen(cond,barpos)+1;
 settlementprice:=trimprice(sum(amount,n)/sum(vol,n)/multiplier);
 
 period:=unitoftime*length;
 
 atr:=trimprice(ref(ma(tr,unitoftime),1)+mindiff);
 
 initialstopnum:=atr*initialstop;
 trailingstopnum:=atr*trailingstop;
 slippagenum:=slippage*mindiff;
 
 topband:=ref(hhv(high,period),1)+mindiff;
 botband:=ref(llv(low,period),1)-mindiff;
 
 longcond:=barpos>=period and entertime and high>=topband;
 longprice:=max(topband,open);
 
 shortcond:=barpos>=period and entertime and low<=botband;
 shortprice:=min(botband,open);
 
 enterhour:=ref(hour,enterbars);
 enterminute:=ref(minute,enterbars);
end

if debug=1 and ((startdate=1 and barpos=1) or date=startdate) then begin
 dbexecute(\'drop table 设置\');
 dbexecute(\'drop table 权益\');
 dbexecute(\'drop table 交易明细\');
 dbexecute(\'drop table 账户\');

 dbexecute(\'create table 设置(品种 text,周期 text,时间 text,初始资金 number,保证金率 number,佣金滑点 text)\');
 dbexecute(\'create table 权益(日期 datetime,权益 number,平仓盈亏 number,累计盈亏 number)\');
 dbexecute(\'create table 交易明细(开仓日期 datetime,合约名称 text,开仓时间 datetime,开仓价咯 number,交易类型 text,平仓时间 datetime,平仓价咯 number,盈亏点数 number,交易手数 number,总手续费 number,平仓盈亏 number)\'); 
 
 if commission>1 then
  comm:=numtostr(commission,0);
 else
  comm:=numtostr(commission*10000,2)+\'%%\';
 
 dwdate:=date[datacount];
 nyear:=intpart(dwdate/10000+1900);
 nmonth:=intpart(dwdate/99.99%100);
 nday:=intpart(dwdate%100); 
 ndate:=numtostr(year,0)+\'/\'+numtostr(month,0)+\'/\'+numtostr(day,0)+\'-\'+numtostr(nyear,0)+\'/\'+numtostr(nmonth,0)+\'/\'+numtostr(nday,0);

 dbexecute(\'insert into 设置(品种,周期,时间,初始资金,保证金率,佣金滑点) values("\'+stkname+\'","1分钟","\'+ndate+\'",500000,\'+numtostr(marginratio,2)+\',"\'+comm+\' & \'+numtostr(slippage,0)+\'")\'); 
end

if holding=0 then begin
 costprice:=0;
 stopline:=0;
end

if holding=0 then begin
 price:=0;
 lots:=0;
 
 if longcond then
  price:=longprice;
 
 if price>0 then begin 
  mycash:=cash(0);
 
  lots1:=intpart(mycash/(price*multiplier*marginratio));  
 
  if money=0 then begin
   lots:=lots1;
  end else begin
   lots2:=intpart(mycash*0.01*money/(initialstopnum*multiplier));
   lots:=min(lots1,lots2);
  end
 end 
 
 if lots>=1 then
  buy(1,lots,limitr,price+slippagenum);
end

if holding=0 then begin
 price:=0;
 lots:=0;
 
 if shortcond then
  price:=shortprice;
 
 if price>0 then begin 
  mycash:=cash(0);
 
  lots1:=intpart(mycash/(price*multiplier*marginratio)); 
 
  if money=0 then begin
   lots:=lots1;
  end else begin
   lots2:=intpart(mycash*0.01*money/(initialstopnum*multiplier));
   lots:=min(lots1,lots2);
  end
 end 
  
 if lots>=1 then
  buyshort(1,lots,limitr,price-slippagenum);
end

if holding>0 then begin
 price:=0;
 lots:=holding;
 
 if exittime then begin
  if intraday=0 then begin
   price:=open;
  end else begin
   if costprice<settlementprice and settlementprice<stopline then
    exit;
   else
    price:=close;
  end
 end  
   
 begin
  if stopline>0 and low<=stopline then
   price:=min(stopline,open);
  
  if stopline=0 then begin
   if commission>1 then
    costprice:=trimprice(enterprice+2*commission/multiplier)+mindiff;
   else
    costprice:=trimprice(enterprice*(1+commission)/(1-commission))+mindiff;
  
   stopline:=costprice-initialstopnum;
  end
  
  if stopline<costprice and high-initialstopnum>=costprice then
   stopline:=costprice; 
 
  if stopline>=costprice and high-trailingstopnum>stopline then
   stopline:=high-trailingstopnum; 
 end
 
 if price>0 then begin
  sell(1,lots,limitr,price-slippagenum);
 
  if debug=1 then begin
   if commission>1 then
    commission:=2*commission*lots;
   else
    commission:=(enterprice+exitprice)*multiplier*commission*lots;
                      
   sql:=\'insert into 交易明细(开仓日期,合约名称,开仓时间,开仓价咯,交易类型,平仓时间,平仓价咯,盈亏点数,交易手数,总手续费,平仓盈亏) values("\'+
 &n

软件评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论

说明

* 使用方法:点击上面蓝色块,打开新页面按照提示进行

* 本网站提供的各种股票软件,例如大智慧软件,通达信软件,同花顺软件,东方财富通等等,和各种股票公式指标,例如大智慧公式,通达信公式,同花顺公式,文华公式,博易大师公式,股票价格计算公式等等公式指标等,都来源网上公开来源收集

本网提供的公式文件说明:
* alg格式飞狐股票公式,可以用飞狐交易师或者交易师软件导入;
* fnc格式大智慧新一代公式指标,可以用大智慧股票软件使用,少部分可以用分析家股票软件引入使用;
* exp格式大智慧经典版股票公式,仅可以用大智慧经典版股票软件引入使用;
* tni和tnc格式通达信股票公式,仅可以用通达信新引入使用,例如可以用通达信股票软件引入使用;
* tne,tn6格式通达信公式,可以用通达信公式编辑器5.0版导入,推荐通达信金融终端版本;
* hxf格式同花顺股票公式,仅可以用同花顺股票软件引入使用。
以上的各种软件都可以在本网股票软件栏目找到!

* 关于股票公式时间限制,如果在引入大智慧公式,交易师公式或者飞狐公式的时候,发现公式名称栏是空白的,这时候调整电脑时间到1997年,又能出现公式名称,并且能正常显示,可能是公式使用期限已过。
* 关于还原公式源码如果你忘记了自己编写的大智慧公式,通达信公式,同花顺公式,操盘手公式,飞狐公式,博易大师公式,金字塔公式,文华公式和交易师公式等等公式的密码,本网可帮恢复源码,有.偿.服.务无意勿扰,点击在线咨询联系我。

* 关于股票公式源码编辑
本网提供的源码,一般都可以编辑成公式,如果不明白公式的编辑,在本页右侧教程录像可参考,或者找公式教程资料学习,请搜索:教程

* 如果您发现软件内容或者链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含源码均是由网上搜集,若侵犯了你的版权利益,请联系通知我们!

关于本站 | 网站帮助 | 广告合作 | 声明 | 友情连接 | 网站地图 |
分析家公式网声明:本站所有股票公式软件资料均网上公开收集,如侵权请联系删帖。站内所有广告,均与本站无关!
Copyright © 2003-2022 fxjgsw.Com. All Rights Reserved .
页面执行时间:6,578.12500 毫秒