金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 184|回复: 3

老师这个指标能改成金字塔吗?

[复制链接]

61

主题

220

帖子

220

积分

Rank: 2

等级: 标准版

注册:
2025-5-28
曾用名:
发表于 2025-9-22 15:14 | 显示全部楼层 |阅读模式
#property copyright "Copyright ?2012, Dean Malone"
#property link      "http://www.synergyprotrader.com"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 DodgerBlue
#property indicator_color2 Red
#property indicator_color3 Yellow
#property indicator_color4 Yellow
#property indicator_color5 Gray
#property indicator_color6 Gray
#property indicator_color7 Red
#property indicator_color8 DodgerBlue

#import "CompassFX.dll"
   string gGrab(string a0, string a1);
#import "synergy_pro.dll"
   string returnReg(string a0, string a1);
#import

int g_file_76;
bool gi_80 = FALSE;
string gs_unused_84;
double gd_unused_92 = 1.1;
extern string Custom_Indicator = "Synergy Pro Average Price Bars";
extern string Copyright = "?2012, Dean Malone";
extern string Web_Address = "www.www.synergyprotrader.com";
extern string Label1 = "=== Bar Width setting ===";
extern int Bar_Width = 3;
extern string Label2 = "=== Color settings ===";
extern color APB_Long_Color = DodgerBlue;
extern color APB_Short_Color = Red;
extern color PAC_Color = Yellow;
double gd_156 = 3.0;
double gd_164 = 4.75;
double gd_172 = 3.75;
double g_ibuf_180[];
double g_ibuf_184[];
double g_ibuf_188[];
double g_ibuf_192[];
double g_ibuf_196[];
double g_ibuf_200[];
double g_ima_204;
double g_ima_212;
double g_ibuf_220[];
double g_ibuf_224[];

int f0_1() {
   int str2int_0;
   bool li_4;
   int li_8;
   g_file_76 = FileOpen("synergy_d.bin", FILE_CSV|FILE_READ);
   if (g_file_76 < 1) li_4 = FALSE;
   else {
      str2int_0 = StrToInteger(FileReadString(g_file_76));
      FileClose(g_file_76);
      li_4 = TRUE;
   }
   if (TimeLocal() - str2int_0 >= 86400 || li_4 == FALSE) {
      li_8 = f0_0();
      switch (li_8) {
      case 0:
         g_file_76 = FileOpen("synergy_d.bin", FILE_WRITE, 8);
         if (g_file_76 < 1) {
            Print("Cannot open password cache!");
            return (0);
         }
         FileWrite(g_file_76, TimeLocal());
         FileClose(g_file_76);
         break;
      case 1:
         Alert("Invalid software key provided!! Please re-install the software with the correct key.");
         gi_80 = TRUE;
         break;
      case 4:
         Alert("Your account has been disabled! Please contact support@compassfx.com");
         gi_80 = TRUE;
         break;
      case 5:
         Alert("Server error!! Please make sure you are connected to the Internet and try again.");
         gi_80 = TRUE;
         break;
      case 6:
         Alert("No key found in your registry (could be a bad installation)! Please re-install Synergy.");
         gi_80 = TRUE;
      }
   }
   return (0);
}

int f0_0() {
   string ls_unused_0;
   string ls_unused_8;
   string ls_unused_16;
   string ls_24 = returnReg("Software\\CompassFX\\Synergy", "key");
   if (ls_24 == "") return (6);
   string ls_32 = "key=" + ls_24;
   string ls_40 = gGrab("http://www.compassfx.com/synergy_scripts/s_login.php", ls_32);
   Print("Result -- ", ls_40);
   if (StringSubstr(ls_40, 0, 1) == "0") {
      gs_unused_84 = ls_40;
      return (0);
   }
   if (StringSubstr(ls_40, 0, 1) == "1") return (1);
   if (StringSubstr(ls_40, 0, 1) == "4") return (4);
   return (5);
}

int init() {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 1, APB_Long_Color);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 1, APB_Short_Color);
   SetIndexStyle(2, DRAW_NONE, STYLE_SOLID, 1, PAC_Color);
   SetIndexStyle(3, DRAW_NONE, STYLE_SOLID, 1, PAC_Color);
   SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 1);
   SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, 1);
   SetIndexStyle(6, DRAW_HISTOGRAM, STYLE_SOLID, Bar_Width, APB_Short_Color);
   SetIndexStyle(7, DRAW_HISTOGRAM, STYLE_SOLID, Bar_Width, APB_Long_Color);
   SetIndexBuffer(0, g_ibuf_180);
   SetIndexBuffer(1, g_ibuf_184);
   SetIndexBuffer(2, g_ibuf_224);
   SetIndexBuffer(3, g_ibuf_220);
   SetIndexBuffer(4, g_ibuf_188);
   SetIndexBuffer(5, g_ibuf_192);
   SetIndexBuffer(6, g_ibuf_196);
   SetIndexBuffer(7, g_ibuf_200);
   string ls_0 = "APB";
   IndicatorShortName(ls_0);
   SetIndexLabel(0, NULL);
   SetIndexLabel(1, NULL);
   SetIndexLabel(2, "PAC High");
   SetIndexLabel(3, "PAC Low");
   SetIndexLabel(4, NULL);
   SetIndexLabel(5, NULL);
   SetIndexLabel(6, "HA_Open");
   SetIndexLabel(7, "HA_Close");
   SetIndexDrawBegin(0, 10);
   SetIndexDrawBegin(1, 10);
   SetIndexDrawBegin(2, 10);
   SetIndexDrawBegin(3, 10);
   SetIndexDrawBegin(4, 10);
   SetIndexDrawBegin(5, 10);
   SetIndexDrawBegin(6, 10);
   SetIndexDrawBegin(7, 10);
   //f0_1();
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double ld_12;
   double ld_20;
   if (gi_80) return (0);
   int li_0 = IndicatorCounted();
   if (li_0 == 0) li_0 = 10;
   int li_4 = Bars - li_0;
   for (int li_8 = li_4; li_8 >= 0; li_8--) {
      g_ima_204 = iMA(NULL, 0, 9, 1, MODE_EMA, PRICE_LOW, li_8);
      g_ima_212 = iMA(NULL, 0, 9, 1, MODE_EMA, PRICE_HIGH, li_8);
      g_ibuf_220[li_8] = (g_ima_212 - g_ima_204) / gd_164 + g_ima_204;
      g_ibuf_224[li_8] = gd_156 * (g_ima_212 - g_ima_204) / gd_172 + g_ima_204;
      if (Close[li_8] > g_ibuf_224[li_8]) {
         g_ibuf_180[li_8] = High[li_8];
         g_ibuf_184[li_8] = Low[li_8];
      } else {
         if (Close[li_8] < g_ibuf_220[li_8]) {
            g_ibuf_184[li_8] = High[li_8];
            g_ibuf_180[li_8] = Low[li_8];
         } else {
            if (Close[li_8] < g_ibuf_224[li_8] && Close[li_8] > g_ibuf_220[li_8]) {
               g_ibuf_188[li_8] = High[li_8];
               g_ibuf_192[li_8] = Low[li_8];
            }
         }
      }
   }
   if (Bars <= 10) return (0);
   if (li_0 < 0) return (-1);
   if (li_0 > 0) li_0--;
   for (int li_28 = Bars - li_0 - 1; li_28 >= 0; li_28--) {
      ld_20 = NormalizeDouble((Open[li_28] + High[li_28] + Low[li_28] + Close[li_28]) / 4.0, Digits);
      ld_20 = (ld_20 + Close[li_28]) / 2.0;
      ld_12 = (g_ibuf_196[li_28 + 1] + (g_ibuf_200[li_28 + 1])) / 2.0;
      g_ibuf_196[li_28] = ld_12;
      g_ibuf_200[li_28] = ld_20;
   }
   return (0);
}
老师这个指标能改成金字塔吗?

回复

使用道具 举报

44

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
发表于 2025-9-22 15:15 | 显示全部楼层
建议给出具体中文描述,光看代码是没办法直接转的
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

61

主题

220

帖子

220

积分

Rank: 2

等级: 标准版

注册:
2025-5-28
曾用名:
 楼主| 发表于 2025-9-22 15:31 | 显示全部楼层
我知道加载的样子,但是我看不懂代码
回复

使用道具 举报

44

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
发表于 2025-9-22 15:53 | 显示全部楼层
这个没办法的,这个代码和金字塔完全没法用,需要完整重新写的,
则时候必须有中文需求描述才行,只看代码和看图是不行的
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-10-9 12:47 , Processed in 0.121287 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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