Download MetaTrader 5
To add comments, please log in or register
Articles can help you to solidify your knowledge. Come and read them!
mikegreen
236
mikegreen 2016.01.18 14:10 

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
13597
whroeder1 2016.01.18 15:01  
Humans can't read ex4's
mikegreen
236
mikegreen 2016.01.18 18:03  
WHRoeder:
Humans can't read ex4's
sorry....see attached
Keith Watford
Moderator
7875
Keith Watford 2016.01.18 20:03  
         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
236
mikegreen 2016.01.19 13:11  

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
13597
whroeder1 2016.01.19 14:19  
mickeyferrari: Though I get these compiler errors:
So read the documentation and fix your code.
Keith Watford
Moderator
7875
Keith Watford 2016.01.19 21:49  
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
236
mikegreen 2016.01.20 10:43  
ok thanks
/
To add comments, please log in or register