Trendline lenght (after OBJPROP_RAY being false)

[Deleted]  

Hi guys,

I'm having an issue with trendlines. I can't have a short width horizontally. Please see the code:

string name1 = "barBody";
string name2 = "barClose";
int type = OBJ_TREND;
int window = 0;
datetime time1 = Time[1];
double price1 = High[1];
datetime time2 = Time[1];
double price2= Low[1];
datetime time3=0;
double price3=0;

ObjectCreate(name1, type, window, time1, price1, time2, price2, time3, price3);
ObjectSet(name1, OBJPROP_COLOR, Yellow);
ObjectSet(name1, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name1, OBJPROP_WIDTH, 2);
ObjectSet(name1, OBJPROP_RAY, False);

ObjectCreate(name2, type, window, time1, Close[1], time2+3600, Close[1], time3, price3); //Bar close
ObjectSet(name2, OBJPROP_COLOR, Red);
ObjectSet(name2, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name2, OBJPROP_WIDTH, 4);
ObjectSet(name2, OBJPROP_RAY, false); //end Bar close

The idea is to have a tick bar without the opening tick.

On the "Bar close" code block , if I change the parameter "time2+3600" to "time2+1800", or any value below 3600, it defaults to a small dot.

How can I set a shorter horizontal line?

I've seen it done already at http://www.forexfactory.com/showthread.php?t=418683, I just can't replicate it. Unfortunately, this Polomine chap doesn't provide the mql4 source code.

Thanks in advance! 

Simon Gniadkowski
17400
Simon Gniadkowski  
dquelhas:

Hi guys,

I'm having an issue with trendlines. I can't have a short width horizontally. Please see the code:

The idea is to have a tick bar without the opening tick.

On the "Bar close" code block , if I change the parameter "time2+3600" to "time2+1800", or any value below 3600, it defaults to a small dot.

How can I set a shorter horizontal line?

The line cannot be shorter than the distance from the center of one bar to the center of the next bar.
[Deleted]  
RaptorUK:
The line cannot be shorter than the distance from the center of one bar to the center of the next bar.


Many thanks for the information :)
William Roeder
25302
William Roeder  
See my Polyline code