您需要 登录 才可以下载或查看,没有帐号?注册
本帖最后由 killnight 于 2015-6-28 16:15 编辑
我看到很多人的代码中都有print到底如何才能看到print打出的东西。软件帮助文档里说的不是很清楚。这对我很重要如果您知道,或者知道谁会请一定告诉我。
挂了好几天终于找到print的方法了。
http://ea.whyhui.com/thread-11923-1-1.html
请参考taylor的帖子
但是这种方法已经过时。print的内容还是会在哪里显示,不过有条件。
于是我做了个测试EA//+------------------------------------------------------------------+
//| testEA.mq4 |
//| Killnight a coder on breadline |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright Killnight a coder on breadline
#property link https://www.mql5.com
#property version 1.00
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int onInit()
{
//--- create timer
EventSetTimer(60);
Print( hello onInit
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void onDeinit(const int reason)
{
Print( hello onDeinit
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void onTick()
{
//---
Print( hello ontick
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void onTimer()
{
//---
Print( hello onTimer
}
//+------------------------------------------------------------------+
//| Tester function |
//+------------------------------------------------------------------+
double onTester()
{
//---
double ret=0.0;
Print( hello onTester
//---
//---
return(ret);
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void onChartEvent(const int id,
const long lparam,
const double dparam,
const string sparam)
{
//---
Print( hello onCharEvent
}
//+------------------------------------------------------------------+
int start()
{
Print( hello start
return(0);
}
复制代码结论:有4个部分的print 可以显示
1. onInit 2.onDeinit 3.onTimer 4.OnChartEvent
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!