设为首页 收藏本站 切换语言

同一窗口显示不同货币对  

| 发表于 2020-8-3 19:00:04 | 显示全部楼层 |复制链接
  1. #property indicator_separate_window
  2. #property indicator_buffers 1
  3. #property indicator_color1 Green
  4. extern string symbol = "EURUSD";
  5. double buffer_close[];
  6. bool exit = false;
  7. string StringUCase(string str)
  8.   {
  9.    for(int i = 0; i < StringLen(str); i++)
  10.      {
  11.        int character = StringGetChar(str, i);
  12.        if((character>= 97 && character<= 122) || (character>= 224 && character<= 255))
  13.            character= character- 32;
  14.        str = StringSetChar(str, i, character);
  15.      }
  16.    return(str);
  17.   }
  18. int init()
  19.   {
  20.    symbol = StringUCase(symbol);
  21.    MarketInfo(symbol, MODE_TIME);
  22.    int last_error = GetLastError();
  23.    if(last_error == 4106) //ERR_UNKNOWN_SYMBOL
  24.      {
  25.        string msg = "QQ:1354167644" + symbol;
  26.        IndicatorShortName(msg);
  27.        Print(msg);
  28.        exit = true;
  29.      }
  30.    else
  31.      {
  32.        IndicatorShortName(symbol + ",M" + Period());
  33.        SetIndexBuffer(0, buffer_close);
  34.        SetIndexStyle(0, DRAW_LINE);
  35.        IndicatorDigits(MarketInfo(symbol, MODE_DIGITS));
  36.      }
  37.    return(0);
  38.   }
  39. int deinit()
  40.   {
  41.    return(0);
  42.   }
  43. int start()
  44.   {
  45.    if(exit)
  46.        return(0);
  47.    int counted_bars = Bars - IndicatorCounted() - 1;
  48.    for(int i = 0; i < counted_bars; i++)
  49.      {
  50.        datetime time_bar = Time[i];
  51.        int bar_no = iBarShift(symbol, Period(), time_bar, false);
  52.        buffer_close[i] = iClose(symbol, Period(), bar_no);
  53.      }
  54.    SetLevelStyle(DRAW_LINE, 1, DarkGray);
  55.    SetLevelValue(0, MarketInfo(symbol, MODE_BID));
  56.    return(0);
  57.   }
复制代码
举报

评论 使用道具

精彩评论9

latage
未及格
| 发表于 2021-4-14 12:02:22 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

yzsx2000
未及格
| 发表于 2021-4-16 20:40:53 | 显示全部楼层
非常感谢楼主的分享
举报

点赞 评论 使用道具

nanaliu
CC
| 发表于 2021-10-21 17:19:25 | 显示全部楼层
看看。。感谢分享。。。
举报

点赞 评论 使用道具

daerwushen
DD
| 发表于 2021-10-21 19:01:17 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

naowei
CCC
| 发表于 2021-10-21 20:56:33 | 显示全部楼层
谢谢0花费分享源码!源码编译2 errors,希望作者修改后编译无错再发,供有需要该指标的朋友下载使用。
举报

点赞 评论 使用道具

EA1314
D
| 发表于 2021-12-19 17:28:17 | 显示全部楼层
感謝分享
举报

点赞 评论 使用道具

交易者
DDD
| 发表于 2022-1-11 15:36:40 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

紫竹青荷
CC
| 发表于 2022-5-7 08:41:09 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

daerbushen
DD
| 发表于 2022-5-7 08:57:43 | 显示全部楼层
路过。。看看先。。
举报

点赞 评论 使用道具

发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册

简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)