View Single Post
  #4 (permalink)  
Old 02-28-2008, 09:06 AM
fxbs fxbs is offline
Senior Member
 
Join Date: Jan 2007
Location: not so remote
Posts: 1,812
fxbs is on a distinguished road
Thank you, Michel!
I'll try!
let me show how it was done with indi above:

before:
PHP Code:
string objname=WindowExpertName()+","+Symbol()+","+Period();
        if(
ObjectFind(objname)<0)
    
ObjectCreate(objname,OBJ_TEXT,
    
WindowFind(WindowExpertName()+" ("+FastEMA+","+SlowEMA+","+SignalSMA+")"),
                     
Time[0]+Period()*60,MacdBuffer[0]/2);
    
                
    else
        
ObjectMove(objname,0,Time[0]+Period()*60,MacdBuffer[0]/2);
        
    if(
pips!=0)
        
ObjectSetText(objname,DoubleToStr(pips,0),FontSize,"Courier",FontColor);
    else
        
ObjectSetText(objname,"",FontSize,"Courier",FontColor);


//---- done
   
return(0);

after:
PHP Code:

   string objname    
ShortName;
   
int    window     WindowFind(ShortName);
   
int    labelShift = -5;

  if(
ObjectFind(objname)<0)
   
ObjectCreate(objname,OBJ_TEXT,window,customTime(labelShift),MacdBuffer[0]/2);
   else  
ObjectMove(objname,0     ,customTime(labelShift),MacdBuffer[0]/2);

    if(
pips!=0)
       
ObjectSetText(objname,DoubleToStr(pips,0),FontSize,"Courier",FontColor);
  else 
ObjectSetText(objname," "    ,FontSize,"Courier",FontColor);


//---- done
   
return(0);
}
//+------------------------------------------------------------------+

int customTime(int a)
{
   if(
a<0)
         return(
Time[0]+Period()*60*MathAbs(a));
   else  return(
Time[a]);   

Attached Images
File Type: gif lable shift test.gif (12.2 KB, 56 views)
Attached Files
File Type: mq4 MACD_Colored_v102M1.mq4 (5.9 KB, 3 views)

Last edited by fxbs; 02-28-2008 at 09:25 AM.
Reply With Quote