直接进入主题
第一步,下载IDE,下载地址
http://files.metaquotes.net/metaquotes.software.corp/mt5/mt5setup.exe
第二步,安装IDE,双击就好了
第三步,测试IDE安装成功与否
双击程序打开以后,按F4,进入IDE编辑器
Ctrl + N创建一个新文件
选择第一个选项,下一步
名称随便叫一个吧,例如Hello_world
然后下一步,下一步,完成
贴入以下代码、
//+------------------------------------------------------------------+
//| hello_world.mq5 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int Count=0;
int OnInit()
{
//---
Alert ("Funct. init() triggered at start");
//---
return(0);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
Alert ("Funct. deinit() triggered at exit");
return;
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
Print("hello world !");
double Price = 1000;
Count++;
Alert("New tick ",Count," Price = ",Price);
return;
}
//+------------------------------------------------------------------+
接下来保存
按F7编译
按F5执行
如果有一个弹窗,就是你成功了
代码需要我解释吗?
下一节解释