How can I hide a part of the chart on the left window side?

 

Hi Forum,

I wanted to print some comments on the left side of the chart but the chart is sometimes overlapping the text and make it unreadable. Therefore I wanted to hide a part of the chart by using a black object. I tried it with a rectangle but it seems to be that the rectangle is always transparent. Then I tried it with a Label-Object but that doesn't start in the very top left corner. Is there another possibility to do that?

Here is the attempt with the rectangle:

int start()
  {
//----
      double   top      = WindowPriceMax();
      double   bottom   = WindowPriceMin();
      datetime left     = Time[WindowFirstVisibleBar()];

      int right_bound = MathFloor((WindowBarsPerChart()/8)*7);
      if(right_bound<0) right_bound=0;
      datetime right=Time[right_bound]+Period()*60;
      ObjectCreate("Padding_rect",OBJ_RECTANGLE,0,left,top,right,bottom);
      ObjectSet("Padding_rect",OBJPROP_BACK,true);
      ObjectSet("Padding_rect",OBJPROP_COLOR,Red);
      WindowRedraw();
//----
   return(0);
  }

And this is the test with the Label object:

int start()
  {
//----
      ObjectCreate("test",OBJ_LABEL,0,0,0);
      ObjectSet("test", OBJPROP_CORNER, 0);
      ObjectSet("test",OBJPROP_XDISTANCE,0);
      ObjectSet("test",OBJPROP_YDISTANCE,0);
      ObjectSetText("test",CharToStr(110), 200, "WingDings", Black);
      WindowRedraw();
//----
   return(0);
  }

And in the charts you can see the results of both... Combining them would be the solution..


 

You need smaller boxes. The WingDings font have invincible borders which pads it from the lift and top. This causes it to shift while it gets bigger. Here's a script that I've made.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#property show_inputs
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extern int      userColum=11;
extern int      userRolls=20;
extern int      userInden=0;
extern color    userColor=Black;
extern string   userOName="~BackShadow";
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void start(){
    DeleteUserOName();
    for(int x=0; x<userColum; x++){
        for(int y=0; y<userRolls; y++){
            ObjectCreate(userOName+x+"_"+y,OBJ_LABEL,0,0,0,0,0);
            ObjectSet(userOName+x+"_"+y,OBJPROP_XDISTANCE,x*10+userInden);
            ObjectSet(userOName+x+"_"+y,OBJPROP_YDISTANCE,y*10+userInden);
            ObjectSetText(userOName+x+"_"+y,CharToStr(110),20,"Wingdings",userColor);
    }   }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void DeleteUserOName(){
    for(int i=ObjectsTotal()-1; i>=0; i--){
        string ObjName=ObjectName(i);
        if(StringFind(ObjName,userOName)>-1) ObjectDelete(ObjName);
    }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Great, thanks!!
 
mar:

Hey ubzen,

I just finished a small indicator which shows some data like Spread, ADR(7) and some other things. Additionally it displays Pips for the initial Stoploss and the corresponding lot-size. What I don't understand is, why the Stoploss-Area is only updated when I change the timeframe. When I open the MetaTrader the Stoploss-Area shows only zeros. I think it has to do with the fact that I use an array which is initialized in the init(). Or is it another issue? What can I do that the indicator starts normally without changing timeframes to update?

It is not a big thing but I would like to know why it is like it is.

What does this have to do with . . . "How can I hide a part of the chart on the left window side?" ? if it doesn't you are off topic, if you want to specifically talk to Ubzen you can PM him . . .
 

OK, Raptor... then tell me what a BIOS issue has to do with populating an array? ;)

Come on, why so strict? I spoke with ubzen about hiding the chart on the left side to print some information over it in another thread. But that thread became too long and contained too many different topics.

 
mar:

OK, Raptor... then tell me what a BIOS issue has to do with populating an array? ;)

Come on, why so strict? I spoke with ubzen about hiding the chart on the left side to print some information over it in another thread. But that thread became too long and contained too many different topics.

  • Forum isn't only for you. When you open a topic, you get replies from other people on that topic. If you mix all themes on the same thread it becomes impossible for people searching answer to find it.
  • About BIOS, when you will get more than 12 000 posts, you can probably get more freedom about what you post.
  • Please create a new topic when you begin to ask question on other subject.
 

The BIOS-thing should be a joke..



PS Let's delete the last postings, so everybody is happy. I ask ubzen in another thread, ok?

 
mar:

OK, Raptor... then tell me what a BIOS issue has to do with populating an array? ;)

Come on, why so strict? I spoke with ubzen about hiding the chart on the left side to print some information over it in another thread. But that thread became too long and contained too many different topics.

Nothing, and yes you are correct my posts about my keyboard issues were off topic . . . and will be removed. My mistakes do not allow you to make the same mistakes . . . and yes I saw the smiley

We all have to follow common sense and the Forum rules . . . off topic posting makes no sense and makes it hard to find stuff just when you need to find it. Please start a new thread unless you already have a thread along similar lines to your question.

 
mar: The BIOS-thing should be a joke.. PS Let's delete the last postings, so everybody is happy. I ask ubzen in another thread, ok?

Yeah the Moderators are correct here. Staying on topic makes my job easier for Searching. This means you get help faster. Also means other people can find it easier. No big-deal...... just create a new post.

Also, If I'm not around for days or weeks. Why wait? Get help for someone else. I sometimes make mistakes and the other guys will help to correct bad advice or codes I'm providing ... Another good reason to post instead of pm.

Lastly, you do-not need to put your hard earned codes upon the forum. A little snippet here and there to understand a particular concept will do. Also, you're not obligated to give your codes to anyone upon this forum ... Period. If you're working with someone in pm and want to provide codes to them ... thats your call to make.

 
OK, guys... I got the point and will do that from now on. I just wanted to avoid spamming this Forum by opening too many threads because as a beginner I have so many questions..
 
mar:
OK, guys... I got the point and will do that from now on. I just wanted to avoid spamming this Forum by opening too many threads because as a beginner I have so many questions..
If questions are relevant, there is no problem to open a new topic for each one. But I suggest you to search the forum before
Reason: