Download MetaTrader 5

How to Limit Number of Lines Displayed by This Indicator?

To add comments, please log in or register
grrbear
397
grrbear  
hi i use this simple vertical line indicator to mark ny open and close times but i don't want an infinite number of lines on the chart, rather only have 3 or 4 lines at any given time. what can be added to the code to allow me to choose how many lines will be shown? thanks
Files:
Aleksei Beliakov
28458
Aleksei Beliakov  
hi buddy you need to add limit in you for operator
grrbear
397
grrbear  
goverkms:
hi buddy you need to add limit in you for operator
thanks for the reply, i am not a coder so i would need some help with the code
Vladimir Karputov
Moderator
61329
Vladimir Karputov  
grrbear :
thanks for the reply, i am not a coder so i would need some help with the code
Will be drawn four pairs of lines. The number of pairs of lines = 4.
Files:
grrbear
397
grrbear  
barabashkakvn:
Will be drawn four pairs of lines. The number of pairs of lines = 4.
thanks! i need lines for ny open and close though
Vladimir Karputov
Moderator
61329
Vladimir Karputov  
grrbear :
thanks! i need lines for ny open and close though
You can determine the time - in the indicator settings.
grrbear
397
grrbear  
barabashkakvn:
You can determine the time - in the indicator settings.

thanks again. it was showing 10 lines when both open and close were used, i'm guessing 8 plus 2. i changed this line of code from 8 to 2 and now it shows 4 lines(2 + 2):

if(count_lines>2)  // (the number of pairs of lines)*2

the problem now is when i change to lower time frames there are too many lines again, until i change time frames again. this would require me to change the time frame twice in order to get rid of the extra lines each time

To add comments, please log in or register