指标把当前交易品种价格简单的放大显示在图表上。
 

//+------------------------------------------------------------------+
//|                                       Magnified_Market_Price.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots   0
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
const bool   Bid_Ask_Colors=true;
color  FontColor=clrRed;
const int    FontSize=24;
const string FontType="Comic Sans MS";
const ENUM_BASE_CORNER  Corner=CORNER_LEFT_LOWER;
const double            angle=0.0;               
const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_LOWER;
const bool              back=false;              
const bool              selection=false;         
const bool              hidden=true;              
const long              z_order=0;
double        Old_Price;
int OnInit()
  {
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
   IndicatorSetString(INDICATOR_SHORTNAME,"Magnified_Market_Price");
   return( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,   
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double& high[],    
                const double& low[],     
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[]
                )
  {
   double Bid = SymbolInfoDouble(Symbol(),SYMBOL_BID);
//---
   if (Bid_Ask_Colors==true)
   {
      if (Bid > Old_Price) FontColor=clrLawnGreen;
      if (Bid < Old_Price) FontColor=clrRed;
      Old_Price=Bid;
   }
   string Market_Price=DoubleToString(Bid, _Digits);
//----  
   ObjectCreate(0,"Market_Price_Label", OBJ_LABEL, 0, 0, 0);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_XDISTANCE,1);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_YDISTANCE,1);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_CORNER,Corner);
   ObjectSetString(0,"Market_Price_Label",OBJPROP_TEXT,Market_Price);
   ObjectSetString(0,"Market_Price_Label",OBJPROP_FONT,FontType);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_FONTSIZE,FontSize);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_COLOR,FontColor);
   ObjectSetDouble(0,"Market_Price_Label",OBJPROP_ANGLE,angle); 
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_ANCHOR,anchor);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_BACK,back);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_SELECTED,selection);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_HIDDEN,hidden);
   ObjectSetInteger(0,"Market_Price_Label",OBJPROP_ZORDER,z_order);
   return(rates_total);
  }
//+------------------------------------------------------------------+

void OnDeinit(const int reason)
  {
   ObjectDelete(0,"Market_Price_Label");
  }

MT5:放大市场价格指标的更多相关文章

  1. 趋势型指标——MACD

    1.简要介绍▪ 计算方法▪ DIFF▪ DEA▪ MACD▪ 构造原理▪ 缺点2.实战技巧3.运用技巧▪ 应用原理▪ 经典用法▪ 实战战法▪ 捕捉卖点▪ 买卖策略▪ 短线实战4.组合指标运用5.一般研 ...

  2. 高频交易算法研发心得--MACD指标算法及应用

    凤鸾宝帐景非常,尽是泥金巧样妆. 曲曲远山飞翠色:翩翩舞袖映霞裳. 梨花带雨争娇艳:芍药笼烟骋媚妆. 但得妖娆能举动,取回长乐侍君王. [摘自<封神演义>纣王在女娲宫上香时题的诗] 一首定 ...

  3. 牛皮市和猴市的好工具和指标:BOLL

    (转贴)布林线BOLL用法 布林线是股市中经常用到的技术指标之一,它反映了股价的波动状况.山版软件指标图中的布林线由三条组成,上边的白线(up)是阻力线,下边的黄线(down)是支撑线,中间的粉红线( ...

  4. Python交互K线工具 K线核心功能+指标切换

    Python交互K线工具 K线核心功能+指标切换 aiqtt团队量化研究,用vn.py回测和研究策略.基于vnpy开源代码,刚开始接触pyqt,开发界面还是很痛苦,找了很多案例参考,但并不能完全满足我 ...

  5. 图像质量评价方法PSNR+SSIM&&评估指标SROCC,PLCC

    update:2018-04-07 今天发现ssim的计算里面有高斯模糊,为了快速计算,先对每个小块进行计算,然后计算所有块的平均值.可以参考源代码实现,而且代码实现有近似的在里面!matlab中中图 ...

  6. L230 RF可靠性测试-RF指标

    最近调试Zigbee 和2.4G产品时需要做一些认证,查找到常用的RF指标. ----------http://www.52rd.com/S_TXT/2016_5/TXT83303.htm------ ...

  7. AJPFX简评:MT5平台

    MetaTrader 5全面改进的图表和扩展的功能 MetaTrader软件开发商在MT4获得全球交易商全面好评之后,又再次研发推出了更为先进的MT5交易软件.   MT5的主要特征●改进的图表和即时 ...

  8. talib 中文文档(八): Momentum Indicator Functions 动量指标

    Momentum Indicator Functions ADX - Average Directional Movement Index 函数名:ADX 名称:平均趋向指数 简介:使用ADX指标,指 ...

  9. DVB数字电视常见信号指标解释

    1. 平均功率与峰值电平       峰值电平在模拟电视广播时用于表征频道信号电平强弱. 模拟电视信号是单极性.不对称的,即电视信号有一个固定黑色参考电平,比黑色亮的信号处在黑色电平线一边,同步脉冲处 ...

随机推荐

  1. Codeforces Round #342 (Div. 2)-A. Guest From the Past

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  2. flume+sparkStreaming实例 实时监控文件demo

    1,flume所在的节点不和spark同一个集群  v50和 10-15节点 flume在v50里面 flume-agent.conf spark是开的work节点,就是单点计算节点,不涉及到mast ...

  3. Android性能分析之TraceView的使用

    TraceView简介 TraceView是AndroidSDK里面自带的工具,用于对Android的应用程序以及Framework层的代码进行性能分析. TraceView是图形化的工具,最终它会产 ...

  4. 【前端】CoffeeScript

    es6中的双箭头函数可以省略小括号,coffee中不可以 es6: (x) => x * x // 可以 x => x * x // 可以 coffee: (x) => x * x ...

  5. js 、jsdoc生成33

    ============== js 点击事件后没方法名,调用有方法名 document.getElementById('lind').onclick=abc;//传统的id选择器 中没有# 哦 fun ...

  6. 手机响应式js轮播基础

    onmousedown --->ontuchstart onmousemove --->ontouchmove onmouseup --->ontouchend ontuchstar ...

  7. 使用xfire工具搭建webservice

    一个简单的项目,下载下来导入可以直接使用 https://yunpan.cn/cY8ANUAYLgy7s  访问密码 99e3

  8. 微信小程序-基础内容组件

    icon 图标 示例: <view class="group"> <block wx:for="{{iconSize}}"> <i ...

  9. python 中的 try/except/else/finally语句

    1.python中try/except/else/finally正常的语句是这样的: try: normal excute block except A: Except A handle except ...

  10. git备份sublime插件及配置

    github备份sublime配置 sublime使用的时间长了,渐渐的就积累了一些有用甚至离不开的插件.但是有时候系统会出点问题,或者换电脑什么的,这时候要想在找回那个曾经的sublime就不那么容 ...