分析家公式网,提供指标公式,股票软件 用户登录  |  用户 注册

软件名称:[B]独特的思路,开拓者抛物线转向交易系统源码分享[/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2013-03-18 02:43:03
软件简介:

  • 思路内容: 刚才看到群里讨论了会SAR,很多人也想写一个SAR系统,最近比较忙,利用午饭时间写了个SAR系统,大家拿去扩充吧
  •  原创作品,转载注明出处  作者 穿堂风
    1. //------------------------------------------------------------------------
       
    2. // 简称: SAR_system
       
    3. // 名称:
       
    4. // 类别: 公式应用
       
    5. // 类型: 用户应用
       
    6. // 输出: 穿堂风{程序化交易}
       
    7. //------------------------------------------------------------------------
       
    8.  
       
    9. Params
       
    10.         Numeric AfStep(0.02);
       
    11.         Numeric AfLimit(0.2) ;
       
    12.         Numeric malen(120);
       
    13.         Numeric stopLoss(1);
       
    14.         Numeric BuyLots(1);
       
    15.         Numeric offset(0);
       
    16. Vars
       
    17.         Numeric oParCl( 0 );
       
    18.         Numeric oParOp( 0 );
       
    19.         Numeric oPosition( 0 );
       
    20.         Numeric oTransition( 0 );
       
    21.         NumericSeries oParOp_s;
       
    22.         Numeric oParOp_p;
       
    23.         Numeric i_offset;
       
    24.         Numeric ma;
       
    25.         Bool bUpline;
       
    26.         string strkey;
       
    27.         string strValue;
       
    28.         Numeric i_stopLoss;
       
    29.        
       
    30. Begin
       
    31.  
       
    32.         ma = Average(Open,malen);
       
    33.         bUpline = Open>= ma;
       
    34.         ParabolicSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition ) ;
       
    35.         oParOp_s = oParOp;
       
    36.         oParOp_p = oParOp_s[1];
       
    37.         i_offset = offset*MinMove*PriceScale;
       
    38.         i_stopLoss = stopLoss*(OpenD(0)/100);
       
    39.        
       
    40.         Commentary("oParOp:"+Text(oParOp));
       
    41.         Commentary("oTransition:"+Text(oTransition));
       
    42.         Commentary("oPosition:"+Text(oPosition));
       
    43. If(CurrentBar>malen)
       
    44. {
       
    45.         PlotNumeric("oParCl",oParCl);
       
    46.         If(malen != 0)
       
    47.         {
       
    48.                 PlotNumeric("ma",ma);
       
    49.         }
       
    50.  
       
    51.  
       
    52.         If(MarketPosition == 0)
       
    53.         {
       
    54.                 If(malen == 0)
       
    55.                 {
       
    56.                         bUpline = True;
       
    57.                 }
       
    58.  
       
    59.                 If(oTransition == 1 and bUpline)
       
    60.                 {
       
    61.                         Buy(BuyLots,Max(Open,oParOp_p)+i_offset);
       
    62.                         Return;
       
    63.                 }
       
    64.                
       
    65.                 If(malen == 0)
       
    66.                 {
       
    67.                         bUpline = False;
       
    68.                 }
       
    69.  
       
    70.                 If(oTransition == -1 and bUpline==False)
       
    71.                 {
       
    72.                         SellShort(BuyLots,Min(Open,oParOp_p)-i_offset);
       
    73.                         Return;
       
    74.                 }
       
    75.         }
       
    76.  
       
    77.         If(MarketPosition == 1)
       
    78.         {
       
    79.                 If(malen == 0)
       
    80.                 {
       
    81.                         bUpline = False;
       
    82.                 }
       
    83.                
       
    84.                 If(LastEntryPrice-Low>=i_stopLoss)
      [url=http://www.70822.com/soft/sort013/sort083/down-59383.html]独特的思路,开拓者抛物线转向交易系统源码分享[/url]

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