Search indicator that shows all open positions + Long / Short + Magic no. + MT4

 
 

Good evening everyone, I'm looking for an indicator that shows me all open positions + Long/Short + Magic No. in MT4. Similar to the attached image (unfortunately the indicator shown doesn't work for me). Does anyone know something like that? Would be grateful for any help ;) Thank you very much, greetings Manuel

Files:
Indicator.jpg  36 kb
 

Hi

You can do this on your own even – it’s not so difficult. Just print out  (as labels on the chart) all trades in a loop. For example:

ObjectsDeleteAll(ChartID(), "#info");

int xloc = 10;

int yloc = 20;

long chart =ChartID();

for(int i=0;i<OrdersTotal();i++) {

    if(OrderSelect(i,SELECT_BY_POS)) {

      ObjectCreate(chart,"#info"+IntegerToString(i), OBJ_LABEL, 0, 0,0);

      ObjectSetInteger(chart, "#info"+IntegerToString(i), OBJPROP_FONTSIZE,10);

      ObjectSetInteger(chart, "#info"+IntegerToString(i), OBJPROP_COLOR,clrWhite);

      ObjectSetInteger(chart, "#info"+IntegerToString(i), OBJPROP_XDISTANCE,xloc);

      ObjectSetInteger(chart, "#info"+IntegerToString(i), OBJPROP_YDISTANCE,yloc);

      ObjectSetInteger(chart, "#info"+IntegerToString(i), OBJPROP_CORNER,CORNER_LEFT_UPPER);

      //here you cen write all data you need from the trade

      string text = StringConcatenate(OrderSymbol()," #", IntegerToString(OrderTicket()), " - ", (MathMod(OrderType(),2)==0)?"Long":"Short"," - Magic[",IntegerToString(OrderMagicNumber()),"]" );

      ObjectSetString(chart, "#info"+IntegerToString(i), OBJPROP_TEXT, text);

      yloc+=15;

    }

}

You can use this function in the OnTimer function to catch all changes  - not only on new ticks from current chart.

Have a nice weekend

 

Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
          General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon.

 

Thank you very much ... i will try it in the next days.

Have a nice weekend too .... :)

And sorry for the wrong section ....

Greeting Manuel

Reason: