Download MetaTrader 5

TrendLine Indicator.

To add comments, please log in or register
mikegreen
285
mikegreen  

Hi,

 

please help !

can somebody tell me why I can not get an up arrow to draw as per logic. See attached file.

Hope you can help me !? 

whroeder1
15598
whroeder1  
Humans can't read ex4's
mikegreen
285
mikegreen  
WHRoeder:
Humans can't read ex4's
sorry....see attached
Keith Watford
Moderator
10569
Keith Watford  
         if(High[i+1]>BolUpper)
           {
            //flag=DrawLine("Line_"+(string)i,Time[i+1],High[i+1],Time[i],High[i]);
            flag=DrawLine("Line_"+TimeToStr(Time[i],Time[i+1],High[i+1],Time[i],High[i]);
           }

Don't use a bar index to name an object, use time instead

      if(PriceMedianBack<flag && PriceMedian>flag)
        {
         UpArrow[i]=Open[i];
        }

 

 flag is a boolean, it makes no sense to compare with a price. The if condition is extremely unlikely to be true

mikegreen
285
mikegreen  

ok i think I understand !

Though I get these compiler errors:

'TimeToStr' - wrong parameters count TrendLine_ObjectDelete.mq4 103 35

implicit conversion from 'number' to 'string' TrendLine_ObjectDelete.mq4 103 35

'DrawLine' - wrong parameters count TrendLine_ObjectDelete.mq4 103 18

whroeder1
15598
whroeder1  
mickeyferrari: Though I get these compiler errors:
So read the documentation and fix your code.
Keith Watford
Moderator
10569
Keith Watford  
mickeyferrari:

ok i think I understand !

Though I get these compiler errors:

'TimeToStr' - wrong parameters count TrendLine_ObjectDelete.mq4 103 35

implicit conversion from 'number' to 'string' TrendLine_ObjectDelete.mq4 103 35

'DrawLine' - wrong parameters count TrendLine_ObjectDelete.mq4 103 18

 

            flag=DrawLine("Line_"+TimeToStr(Time[i]),Time[i+1],High[i+1],Time[i],High[i]);
There was a typo in my suggestion, I missed a closing bracket
mikegreen
285
mikegreen  
ok thanks
To add comments, please log in or register