谢谢 bonnyshi ! 我后面输入: ObjectSetText("Period", P, font_size, font_face, font_color); 但是在指定的位置没有任何内容,不知道是为什么?
Code: #property indicator_chart_window extern color font_color = Yellow; extern int font_size = 12; extern string font_face = "Arial"; extern int corner = 1; //0 - for top-left corner, 1 - top-right, 2 - bottom-left, 3 - bottom-right extern int CandleTime_distance_x = 5; extern int CandleTime_distance_y = 60; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ //---- buffers double s1[]; int init() { //---- indicators ObjectCreate("CandleTime", OBJ_LABEL, 0, 0, 0); ObjectSet("CandleTime", OBJPROP_CORNER, corner); ObjectSet("CandleTime", OBJPROP_XDISTANCE, CandleTime_distance_x); ObjectSet("CandleTime", OBJPROP_YDISTANCE, CandleTime_distance_y); ObjectCreate("Period", OBJ_LABEL, 0, 0, 0); ObjectSet("Period", OBJPROP_CORNER, corner); ObjectSet("Period", OBJPROP_XDISTANCE, CandleTime_distance_x); ObjectSet("Period", OBJPROP_YDISTANCE, CandleTime_distance_y-20); } return(0); int deinit() { //---- ObjectDelete("Period"); ObjectDelete("CandleTime"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double i; int m,s,k; m=Time[0]+Period()*60-CurTime(); i=m/60.0; s=m%60; m=(m-m%60)/60; int P = Period(); RefreshRates(); //---- ObjectSetText("Period", P, font_size, font_face, font_color); //显示当前周期 ObjectSetText("CandleTime", ( m + " m " + s + " s"), font_size, font_face, font_color); return(0); }
上次回帖,不是说了要注意类型变换问题?没有测试么?可以解决的呀。 解决: ObjectSetText("Period", ""+P, font_size, font_face, font_color); //显示当前周期 或者 ObjectSetText("Period", DoubleToStr(P,0), font_size, font_face, font_color);
惭愧,一点编程背景都没有,想少看别人的自己多撞撞墙一点一点解决问题,但是太费时间。 非常感谢你的耐心,祝你交易顺利! 看来你MT4用了很久了,不知你手头有没有这样的指标: http://www.forexfactory.com/showthread.php?t=211555&page=2 图中MT4右上角的,指标和周期的矩阵,可以变颜色。 如果能给我一个类似的让我自己慢慢改造,那就太太太感激了! 我的邮箱:iamhappytrader@gmail.com
回复了一些话,猫咪跑过来踩了一下F5!!! 我很久不做主观交易了,很少用到这些,MT4只用来接数据啦。刚才心血来潮买了半年c5玩玩,近半年可以尝试一下主观交易吧 他这个,应该就是一个MULTI TIMEFRAME 的预警,这个MT4官网好像见过的。。。其他的 算SPREAD PIPVALUE 自己加上去好了,也没必要那么华丽。当然还有更华丽的东西,MT4 ROSH专门有个贴,好多华丽的东西,到官网挖一下看看? http://forum.mql4.com/ http://forum.mql4.com/6130 你可以用第七楼那图来改 另外还有个资源网站,很多免费的东西这里都收藏有 http://www.forexmt4.com http://www.forexmt4.com/_MT4_Indicators/ http://www.forexmt4.com/_MT4_Indicators/MultiTimeFrame/