Download MetaTrader 5
To add comments, please log in or register
Order a robot or an indicator for MetaTrader. The Freelance service will help you!
whroeder1
13978
whroeder1 2015.09.04 20:49  
Never to that because they are unreadable.
 if(ArrowProp="ò")ArrowNo=Down;
 if(ArrowProp="ö")ArrowNo=Sideways;
 if(ArrowProp="ñ")ArrowNo=Up;
This you can
if(ArrowProp == "\242")ArrowNo=Down;
if(ArrowProp == "\240")ArrowNo=Sideways;
if(ArrowProp == "\241")ArrowNo=Up;

// or

if(ArrowProp == "\xF2")ArrowNo=Down;
if(ArrowProp == "\xF0")ArrowNo=Sideways;
if(ArrowProp == "\xF1")ArrowNo=Up;
Character Constants - MQL4 Documentation
Or even easer
ArrowNo = StringGetCharacter(ArrowProp, 0);
StringGetCharacter - MQL4 Documentation
MikeT
232
MikeT 2015.09.05 08:21  

Thanx Roeder

That is what I was looking for....

ArrowNo = StringGetCharacter(ArrowProp, 0);

 I've also taken note of....

if(ArrowProp == "\242")ArrowNo=Down;
if(ArrowProp == "\240")ArrowNo=Sideways;
if(ArrowProp == "\241")ArrowNo=Up;

// or

if(ArrowProp == "\xF2")ArrowNo=Down;
if(ArrowProp == "\xF0")ArrowNo=Sideways;
if(ArrowProp == "\xF1")ArrowNo=Up;

 Thanx...

MikeT
232
MikeT 2015.09.05 12:47  
Mike.T:

Sorry Demos.... you were right all along with StringGetCharacter... I just wasn't using  it correctly.... I should have paid more attention...heheh

The final solution...

void OnTick()
  {
//---


//---
string ArrowProp = ObjectDescription("TrendArrowHTF"); //Get Object text value
string ArrowNo = StringGetCharacter(ArrowProp, 0);
   
   Comment("Arrow No = ",ArrowNo);
   
  }

 Easy when you know how....

Thanx Guys 

/ /12
To add comments, please log in or register