金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 1808|回复: 1

TB换金字塔

[复制链接]

129

主题

213

帖子

223

积分

Rank: 7Rank: 7Rank: 7

等级: 版主

注册:
2021-5-25
曾用名:
发表于 2023-3-24 10:04 | 显示全部楼层 |阅读模式


Params
  Numeric Y1(50);
  Numeric Y2(50);
  Numeric stopLossSet(100);

  Vars
  NumericSeries a1;
  NumericSeries a2;
  Numeric MinPoint;  
  Numeric MyEntryPrice;      
  Numeric MyExitPrice;
  Numeric stopLossPoint;
  Numeric offSetDots;
  bool    cross1;
  bool    cross2;

Begin

  a1=Highest(high[1],Y1);
  a2=Lowest(low[1],Y2);

  cross1=CrossOver(high,a1);
  cross2=CrossUnder(low,a2);

if(date>20251025) return;

  If(cross1 && MarketPosition<>1)
  {
   Buy(1,a1+offSetDots);      
   }
  If(cross2 && MarketPosition<>-1)
  {
   SellShort(1,a2-offSetDots);      
   }
stopLossPoint = stopLossSet * MinMove * PriceScale;


        If(MarketPosition == 1)
        {


                myEntryPrice = AvgEntryPrice;

                 If(low <= myEntryPrice - stopLossPoint)
                {
                        myExitPrice = myEntryPrice - stopLossPoint;
                        If(open < myExitPrice) myExitPrice = open;
                        Sell(0,myExitPrice);//myExitPrice
                }
        }
        else If (MarketPosition == -1)
        {

                myEntryPrice = AvgEntryPrice;

                 If(High >= myEntryPrice + stopLossPoint)
                {
                        myExitPrice = myEntryPrice + stopLossPoint;
                        If(open > myExitPrice) myExitPrice = open;
                        BuyToCover(0,myExitPrice);  //  myExitPrice   
                }
        }


End

回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-3-24 10:41 | 显示全部楼层
因TB的和我们PEL语法规范差异太大,这种转换需要我们去查阅相关资料才能操作,需要一定处理时间。  转换后会在本帖下贴出具体代码的。

另外如果建议如果有文字的思路描述,最好以文字思路描述为准。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-6-10 04:26 , Processed in 0.114136 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表