Help positioning text - page 2

 
No its
  double price_lev=0.0;
I also tried
price_lev=SymbolInfoDouble(_Symbol, SYMBOL_BID) - 0.0001;

and works too in mantaining the line at a fixed distance from the bid line but when I do

price_lev=DoubleToString(SymbolInfoDouble(_Symbol, SYMBOL_BID) - 0.0001);
price_lev=(price_lev + 0.45);
to make some adjustment for graphic reasons the distance is no longer constant but goes up and down
 
danerstizz #:
No its I also tried

and works too in mantaining the line at a fixed distance from the bid line but when I do

to make some adjustment for graphic reasons the distance is no longer constant but goes up and down

I see , but why are you turning it to a string though ?


 
Ahaha you're right, but do you have an explanation?
 
danerstizz #:
Ahaha you're right, but do you have an explanation?

it actually returns a price ... hmm that is not it 

void OnTick()
  {
//---
  double price_lev=DoubleToString(SymbolInfoDouble(_Symbol, SYMBOL_BID) - 0.0001);
  price_lev=(price_lev + 0.45); 
  Print("BID("+SymbolInfoDouble(_Symbol, SYMBOL_BID)+") price_lev("+price_lev+")");
  }

try this : 

string obj_tag="TextTrail_";
double distance=0.0;
int OnInit()
  {
//---
  ObjectsDeleteAll(ChartID(),obj_tag);
  //create text trail 
    ObjectCreate(ChartID(),obj_tag+"01",OBJ_TEXT,0,0,0);
    //distance of the texts anchor point in points 
      distance=NormalizeDouble(((45)*_Point),_Digits);
    //anchor point 
      ObjectSetInteger(ChartID(),obj_tag+"01",OBJPROP_ANCHOR,ANCHOR_LOWER);
//---
   return(INIT_SUCCEEDED);
  }
void OnTick()
  {
//---
  ResetLastError();
  double price=SymbolInfoDouble(_Symbol,SYMBOL_BID);
  if(GetLastError()==0){
    ObjectSetDouble(ChartID(),obj_tag+"01",OBJPROP_PRICE,price+distance);
    ObjectSetInteger(ChartID(),obj_tag+"01",OBJPROP_TIME,iTime(_Symbol,_Period,0));
    ObjectSetString(ChartID(),obj_tag+"01",OBJPROP_TEXT,DoubleToString(price,_Digits));
    ChartRedraw();
    }
  }
 
Your code version is working Lorentzos Roussos! Many, many thanks for your help. A good day.
 
danerstizz #:
Your code version is working Lorentzos Roussos! Many, many thanks for your help. A good day.

Awesome 


Reason: