You can write the text into one or multiple Edit or Text objects as Anton suggests, the exact function is ObjectSetString. Or on a canvas put as background. Canvas will probably be easier.
https://www.mql5.com/en/docs/standardlibrary/canvasgraphics/ccanvas
double RoundDown (double number,int digit) { return(MathFloor(number*MathPow(10,digit))/MathPow(10,digit)); } //----------------------------------------------------------------------------------------- void GetIndy() { ExtZigzagBuffer=iCustom(NULL,0,"ZigZag",InpDepth,0,shift); ExtHighBuffer=iCustom(NULL,0,"ZigZag",InpDepth,1,shift); ExtLowBuffer=iCustom(NULL,0,"ZigZag",InpDepth,2,shift); EMA25=iMA(NULL,0,25,0,MODE_EMA,PRICE_CLOSE,0); EMA50=iMA(NULL,0,50,0,MODE_EMA,PRICE_CLOSE,0); } void checkEMA () { EMAS = (RoundDown(EMA25,2)); EMAL = (RoundDown(EMA50,2)); AB = (RoundDown((AccountBalance()*10/10),2)); AE = (RoundDown((AccountEquity()*10/10),2)); AF = (RoundDown((AccountFreeMargin()*10/10),2)); AP = (RoundDown((AccountProfit()*10/10),2)); Zone1 = (RoundDown((p1*10/10),2)); Zone2 = (RoundDown((p2*10/10),2)); Zone3 = (RoundDown((p3*10/10),2)); Zone4 = (RoundDown((p4*10/10),2)); if(EMA25>EMA50) { T =(EMA25-EMA50)*100; } if(EMA50>EMA25) { T =(EMA50-EMA25)*100; } T = (RoundDown(T,2)); } void information() { string com; com="\n========================="; com=com+"\n 3ZoneHG-ZZ_TrailingStop++"; com=com+"\n By:Krudit Modify: 05-07-2018"; com=com+"\n========================="; com=com+"\n [SWING HIGH_LOW VALUE]"; com=com+"\n========================="; com=com+"\n-Price SWING_HIGH : = "+(string)Zone1; com=com+"\n-Price ZONE H1 : = "+(string)Zone2; com=com+"\n-Price ZONE L1 : = "+(string)Zone3; com=com+"\n-Price SWING_LOW : = "+(string)Zone4; com=com+"\n========================="; com=com+"\n[CUSTOM SETTING VALUE][HEDGING]"; com=com+"\n========================="; com=com+"\n-LotSize Groub1:= "+(string)(_LOT_Group1); com=com+"\n-LotSize Groub2:= "+(string)(_LOT_Group2); com=com+"\n-DistanceOrder:= "+(string)(_DIS_ORDER*100); com=com+"\nTP:= "+(string)(_TP) +" ,SL:= "+(string)(_SL); com=com+"\n========================="; com=com+"\n [BUY&SELL]"; com=com+"\n========================="; com=com+"\nLot:= "+(string)(_Number_Input_3) +" ,SL:= "+(string)(_Number_Input_5) +" ,TP:= "+(string)(_Number_Input_4) +"\nTrailingStop:= "+(string)(_TrailingStop); com=com+"\n========================="; com=com+"\n [ZIGZAG ZONE VALUE]"; com=com+"\n========================="; com=com+"\n-Zigzag :="+(string)ExtZigzagBuffer +" ,High :="+(string)ExtHighBuffer +" ,Low :="+(string)ExtLowBuffer; com=com+"\n========================="; com=com+"\n [EMA25 EMA50 VALUE]"; com=com+"\n========================="; com=com+"\nEMA25/50: = "+(string)EMAS +"/"+(string)EMAL +"\n Dis-EMA : = "+(string)T; com=com+"\n========================="; com=com+"\n [ACCOUNT VALUE]"; com=com+"\n========================="; com=com+"\n-BALANCE: = "+(string)AB; com=com+"\n-EQUITY: = "+(string)AE; com=com+"\n-MARGIN: = "+(string)AF; com=com+"\n-PROFIT: = "+(string)AP; com=com+"\n========================="; com=com+"\n [ORDERS AND LOT VALUE]"; com=com+"\n========================="; com=com+"\n-LOTS TOTAL: = "+(string)_Lots; com=com+"\n-ORDERS TOTAL: = "+(string)OrdersTotal(); com=com+"\n-ORDERS HISTORY: = "+(string)OrdersHistoryTotal(); com=com+"\n========================="; Comment (com); }
pradit thongget:
please use Object. example
double KarZararToplam=0; double KarZararLot=0; double KarZararNet=0; color KarZararRenk=Yellow; if(TP>0) KarZararRenk=Blue; if(TP<0) KarZararRenk=Red; double KapatmaHedefi=(TotalHedefKar-TP); ObjectDelete("Bilgi_1");ObjectDelete("Bilgi_3"); ObjectDelete("Bilgi_3");ObjectDelete("Bilgi_4"); // string Islem=DoubleToStr(TP,2)+" Kar/Zarar :"+DoubleToStr(OTP,2)+" Lot"+" Kalan :"+DoubleToStr(KapatmaHedefi,2)+" ";; //"Hesap Durumu :" string Islem="Kar/Zarar :"+DoubleToStr(TP,2)+" ";; ObjectCreate("Bilgi_1", OBJ_LABEL, 0, 0, 0); ObjectSetText("Bilgi_1",Islem, 13,"Arial", KarZararRenk); // ObjectSet("Bilgi_1", OBJPROP_CORNER, 2); ObjectSet("Bilgi_1", OBJPROP_XDISTANCE, 1); ObjectSet("Bilgi_1", OBJPROP_YDISTANCE, 15); // // "Hesap Durumu :" Islem="Net Lot :"+DoubleToStr(OTP,2)+" ";; ObjectCreate("Bilgi_2", OBJ_LABEL, 0, 0, 0); ObjectSetText("Bilgi_2",Islem, 13,"Arial", Yellow); // ObjectSet("Bilgi_2", OBJPROP_CORNER, 2); ObjectSet("Bilgi_2", OBJPROP_XDISTANCE, 1); ObjectSet("Bilgi_2", OBJPROP_YDISTANCE, 45); // "Hesap Durumu :" Islem="Hedef Kar :"+DoubleToStr(KapatmaHedefi,2)+" ";; ObjectCreate("Bilgi_3", OBJ_LABEL, 0, 0, 0); ObjectSetText("Bilgi_3",Islem, 13,"Arial", Yellow); // ObjectSet("Bilgi_3", OBJPROP_CORNER, 2); ObjectSet("Bilgi_3", OBJPROP_XDISTANCE, 1); ObjectSet("Bilgi_3", OBJPROP_YDISTANCE, 75); Islem="Hesap Durumu :"+DoubleToStr(AccountEquity(),2)+" ";; ObjectCreate("Bilgi_4", OBJ_LABEL, 0, 0, 0); ObjectSetText("Bilgi_4",Islem, 13,"Arial", KarZararRenk); // ObjectSet("Bilgi_4", OBJPROP_CORNER, 2); ObjectSet("Bilgi_4", OBJPROP_XDISTANCE, 1); ObjectSet("Bilgi_4", OBJPROP_YDISTANCE,105);
Forum on trading, automated trading systems and testing trading strategies
I want to move the EA comment from left to right corner ?
pradit thongget, 2018.07.10 03:49
void information() { string com; com="\n========================="; com=com+"\n 3ZoneHG-ZZ_TrailingStop++"; com=com+"\n By:Krudit Modify: 05-07-2018"; com=com+"\n========================="; com=com+"\n [SWING HIGH_LOW VALUE]"; com=com+"\n========================="; com=com+"\n-Price SWING_HIGH : = "+(string)Zone1; com=com+"\n-Price ZONE H1 : = "+(string)Zone2; com=com+"\n-Price ZONE L1 : = "+(string)Zone3; com=com+"\n-Price SWING_LOW : = "+(string)Zone4; com=com+"\n========================="; com=com+"\n[CUSTOM SETTING VALUE][HEDGING]"; com=com+"\n========================="; com=com+"\n-LotSize Groub1:= "+(string)(_LOT_Group1); com=com+"\n-LotSize Groub2:= "+(string)(_LOT_Group2); com=com+"\n-DistanceOrder:= "+(string)(_DIS_ORDER*100); com=com+"\nTP:= "+(string)(_TP) +" ,SL:= "+(string)(_SL); com=com+"\n========================="; com=com+"\n [BUY&SELL]"; com=com+"\n========================="; com=com+"\nLot:= "+(string)(_Number_Input_3) +" ,SL:= "+(string)(_Number_Input_5) +" ,TP:= "+(string)(_Number_Input_4) +"\nTrailingStop:= "+(string)(_TrailingStop); com=com+"\n========================="; com=com+"\n [ZIGZAG ZONE VALUE]"; com=com+"\n========================="; com=com+"\n-Zigzag :="+(string)ExtZigzagBuffer +" ,High :="+(string)ExtHighBuffer +" ,Low :="+(string)ExtLowBuffer; com=com+"\n========================="; com=com+"\n [EMA25 EMA50 VALUE]"; com=com+"\n========================="; com=com+"\nEMA25/50: = "+(string)EMAS +"/"+(string)EMAL +"\n Dis-EMA : = "+(string)T; com=com+"\n========================="; com=com+"\n [ACCOUNT VALUE]"; com=com+"\n========================="; com=com+"\n-BALANCE: = "+(string)AB; com=com+"\n-EQUITY: = "+(string)AE; com=com+"\n-MARGIN: = "+(string)AF; com=com+"\n-PROFIT: = "+(string)AP; com=com+"\n========================="; com=com+"\n [ORDERS AND LOT VALUE]"; com=com+"\n========================="; com=com+"\n-LOTS TOTAL: = "+(string)_Lots; com=com+"\n-ORDERS TOTAL: = "+(string)OrdersTotal(); com=com+"\n-ORDERS HISTORY: = "+(string)OrdersHistoryTotal(); com=com+"\n========================="; CommentXY (com, 250); }
// Вывод комментария по примерным координатам void CommentXY( string Str, const uint X = 0, const uint Y = 0 ) { string Shift = NULL; StringInit(Shift, X >> 2, ' '); if (StringLen(Shift)) { StringReplace(Str, "\n", "\n" + Shift); Str = Shift + Str; } if (Y) { StringInit(Shift, Y / 14, '\n'); Str = Shift + Str; } Comment(Str); }
PS Run this
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Особенности языка mql4, тонкости и приёмы работы
fxsaber, 2018.07.10 15:24
void OnStart() { const uint Height = 200; const uint Width = 200; while (!IsStopped()) { CommentXY("Hello World!\nCommentXY", MathRand() * Width / SHORT_MAX, MathRand() * Height / SHORT_MAX); Sleep(200); } }
You agree to website policy and terms of use
I want to move the EA comment from left to right corner ? Ask for advice as well. Get help