找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
首页论坛EAHub 外汇论坛
查看: 22|回复: 0

同一窗口显示不同货币对

[复制链接]

4万

主题

54

回帖

4万

积分

管理员

积分
45954
发表于 2026-8-27 22:45:00 | 显示全部楼层 |阅读模式
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Green
extern string symbol = "EURUSD";
double buffer_close[];
bool exit = false;
string StringUCase(string str)
  {
   for(int i = 0; i < StringLen(str); i++)
     {
       int character = StringGetChar(str, i);
       if((character>= 97 && character<= 122) || (character>= 224 && character<= 255))
           character= character- 32;
       str = StringSetChar(str, i, character);
     }
   return(str);
  }
int init()
  {
   symbol = StringUCase(symbol);
   MarketInfo(symbol, MODE_TIME);
   int last_error = GetLastError();
   if(last_error == 4106) //ERR_UNKNOWN_SYMBOL
     {
       string msg = "QQ:1354167644" + symbol;
       IndicatorShortName(msg);
       Print(msg);
       exit = true;
     }
   else
     {
       IndicatorShortName(symbol + ",M" + Period());
       SetIndexBuffer(0, buffer_close);
       SetIndexStyle(0, DRAW_LINE);
       IndicatorDigits(MarketInfo(symbol, MODE_DIGITS));
     }
   return(0);
  }
int deinit()
  {
   return(0);
  }
int start()
  {
   if(exit)
       return(0);
   int counted_bars = Bars - IndicatorCounted() - 1;
   for(int i = 0; i < counted_bars; i++)
     {
       datetime time_bar = Time;
       int bar_no = iBarShift(symbol, Period(), time_bar, false);
       buffer_close = iClose(symbol, Period(), bar_no);
     }
   SetLevelStyle(DRAW_LINE, 1, DarkGray);
   SetLevelValue(0, MarketInfo(symbol, MODE_BID));
   return(0);
  }复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|EAHub外汇论坛

GMT+8, 2026-10-9 15:30 , Processed in 0.101445 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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