solrv / 发布
论坛
bug???
void OnChartEvent ( const int id, const long &lparam, const double &dparam, const string &sparam) { double a= 0.07142859999999999 ; double b= NormalizeDouble (a, 3 ); Print ( "b=" ,b); } 结果是 b=0.07099999999999999 这不科学
各位使用环形缓存时产生的积累误差,是忽视还是关键点修正
关于环形缓存: https://www.mql5.com/zh/articles/3047 我测得大概每隔100个bar 会有10E-18误差。来个几万bar 误差就明显了 bar越少越好。
写了个小模块,用来提高程序性能,喜欢就拿去,欢迎反馈。
string sname; ENUM_TIMEFRAMES pname; sname=Symbol(); pname=Period(); int allBarCount; allBarCount=Bars(sname,pname); if(allBarCount<0) return; static datetime ti2[],tmp[1]; long vol[]; //datetime ti[]; int res=0; if(allBarCount<=0) return; static int start=0,nowbar=999; int codd; for(int i=start;
在mt5上遇到了个错误(除非你们不复用函数),他的函数不能根据入口点重新开辟内存空间?当同一个函数重复使用时,很容易出现错误。
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnTick () { int allBarCount; allBarCount= Bars ( _Symbol , _Period );
在EA中用Bars()这个函数要小心了,有些情况下返回值不正确,用在for循环遍历所有bar取数据时候,很容易让人抓狂
(我的帖子突然没了,可能是我的网络时断时续造成刷新不畅,写了很多内容却被我在着急刷新的过程中点错删除了) void CheckBarNumber() { double c[]; int allBarCount; allBarCount= Bars ( Symbol (), Period ()); Print (""); Print ("------------------------------------------------------------"); CopyClose ( Symbol (), Period (), 0 ,allBarCount,c);
mql5里面使用canvas画rectangle时候,当鼠标拖动k线的时候想让画出的rectangle随着k线移动
mql5里面使用canvas画rectangle时候,当鼠标拖动k线的时候想让画出的rectangle随着k线移动, 发现canvas是当前屏幕,并不跟随k线 我现在能想到的是局部刷新.但是效率很低 很卡. 有其他的办法解决跟随移动的问题吗? 谢谢