Change iExposure indicator view from sub window to chart window - page 2

 
Elpidius:


[...]It seems impossible.

so give it to someone else to do it

I'll give you a hint

name="Head_"+col;
 
qjol:

so give it to someone else to do it

I'll give you a hint

I don't necessarily need anyone to do it for me. Just to let me know the code, and I can apply it myself. Thanks for the suggestion though.

I've tried to apply the code from i-Breakeven.mq4 - which is based off of the iExposure.mq4 indicator - (posted earlier in this thread). The i-Breakeven.mq4 indicator, when deleted, only deletes objects created by the i-Breakeven indicator, which is a perfect example. However, when I applied the code to the iExposure indicator, it hasn't worked. I've applied your hint, which was quite vague, but I still appreciate any help I can get. :)

I added this at the top:

string prefix = "capital_";
I changed this:
void deinit() 
{
  string name;
  int obj_total = ObjectsTotal();
  for (int i=obj_total-1; i>=0; i--)
  {
    name = ObjectName(i);
    if (StringFind(name, prefix) == 0) ObjectDelete(name);
  }
}

And I applied your hint here:

         name=prefix+"Head_"+col;
         if(ObjectFind(name) == -1) {
         ObjectCreate(name,OBJ_LABEL,windex,0,0);
         }
           {
            ObjectSet(name,OBJPROP_XDISTANCE,ExtShifts[col]);
            ObjectSet(name,OBJPROP_YDISTANCE,ExtVertShift);
            ObjectSetText(name,ExtCols[col],9,"Arial",ExtColor);
           }

I even applied that same format everywhere I saw:

name="Objectname_"+line+"_"+col;

But it still didn't work. There is also another modification of the i-Breakeven.mq4 indicator, which is also based off of the iExposure.mq4 indicator. This FXPT_TradeConditionDashboard.mq4 indicator also deletes all the objects that have only been created by the indicator.

Could you please let me know whereabouts to apply the correct code, and I'll do it. I hope I'm not sounding rude, I mean no disrespect when asking this. Just some help.

Thanks,

Elpidius

 

Nevermind. I fixed the problem. I had to change the deinitialization code.

Thank you for the hint qjol, despite the vagueness.

Reason: