- 精华
- 11
- 在线时间
- 3540 小时
- UID
- 1
- 积分
- 25132
- 帖子
- 6291
- 阅读权限
- 255
- 注册时间
- 2007-7-20
- 最后登录
- 2024-4-22
- 精华
- 11
- UID
- 1
- 积分
- 25132
- 帖子
- 6291
- 主题
- 149
- 阅读权限
- 255
- 注册时间
- 2007-7-20
- 最后登录
- 2024-4-22
|
- //------------------------------------------------------------------------
- // 简称: SARTrader
- // 名称: 抛物线交易系统
- // 类别: 交易指令
- // 类型: 多头建仓
- // 输出:
- //------------------------------------------------------------------------
- Params
- Numeric AfStep( 0.02);
- Numeric AfLimit( 0.2 );
- Numeric StopPoint(6);
- Vars
- NumericSeries SARValue;
- Numeric MyPrice;
- Numeric oParCl( 0 );
- Numeric oParOp( 0 );
- Numeric oPosition( 0 );
- Numeric oTransition( 0 );
- Begin
- ParabolicSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition );
- SARValue = oParCl;
- If(MarketPosition!=0)
- {
- If(Time >= 0.1458 && Time < 0.1500)
- {
- Sell(1,Close);
- BuyToCover(1,Close);
- Return;
- }
-
- If(MarketPosition == 1 && Low <= AvgEntryPrice-StopPoint*MinMove*PriceScale)
- {
- MyPrice = AvgEntryPrice-StopPoint*MinMove*PriceScale;
- Sell(1,MyPrice);
- }
-
- If(MarketPosition == -1 && High >= AvgEntryPrice+StopPoint*MinMove*PriceScale)
- {
- MyPrice = AvgEntryPrice+StopPoint*MinMove*PriceScale;
- BuyToCover(1,MyPrice);
- }
- }
-
- If(MarketPosition !=1 && CrossOver(Close,SARValue))
- {
- Buy(1,Close);
- }
-
- If(MarketPosition !=-1 && CrossUnder(Close,SARValue))
- {
- SellShort(1,Close);
- }
- End
- //------------------------------------------------------------------------
- // 编译版本 GS2004.06.12
- // 用户版本 2008/02/15 15:59
- // 版权所有 tradeblazer
- // 更改声明 TradeBlazer Software保留对TradeBlazer平台
- // 每一版本的TrabeBlazer公式修改和重写的权利
- //------------------------------------------------------------------------
复制代码 |
|