TrendLine Indicator.

Back to topics list To post a new topic, please log in or register
avatar
44
mickeyferrari 2016.01.18 15: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 !? 

Attached files:
  trendline_objectdelete.ex4  (11.25 KB)
avatar
13010
WHRoeder 2016.01.18 16:01 #
 
Humans can't read ex4's
avatar
44
mickeyferrari 2016.01.18 19:03 #
 
WHRoeder:
Humans can't read ex4's
sorry....see attached
Attached files:
  trendline_objectdelete.mq4  (4.35 KB)
avatar
Moderator
3427
GumRai 2016.01.18 21: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

avatar
44
mickeyferrari 2016.01.19 14: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

 

avatar
13010
WHRoeder 2016.01.19 15:19 #
 
mickeyferrari: Though I get these compiler errors:
So read the documentation and fix your code.
avatar
Moderator
3427
GumRai 2016.01.19 22: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
avatar
44
mickeyferrari 2016.01.20 11:43 #
 
ok thanks
Back to topics list  

To add comments, please log in or register