I have a problem. I have some code that creates two horizontal lines on a chart. When it comes time to move the lines, I use the TL_SetBegin and TL_Set_End functions and supply the functions with a date, time and price. When the lines are redrawn, they are sloped vs. horizontal. It appears that the starting point jumps for some reason as both ending points are identical even though output called after the lines are drawn shows verifies the input data was correct. To complicate this further, during debugging, I decided to call the TL_New function, and draw the same two lines brand new directly after the drawing of the first too using the same input data....and they draw correctly.
Here is the code to move the upper line:
Code: Select all
value1 = tl_setbegin(tl_upper,highs_to_beat_date, highs_to_beat_time, highs_to_beat);
value2 = tl_Setend(tl_upper, highs_to_beat_date,highs_to_beat_time+line_len, highs_to_beat);
Here is the code to move the lower line:
Code: Select all
value1 = tl_setbegin(tl_lower,lows_to_beat_date,lows_to_beat_time, lows_to_beat);
value2 = tl_Setend(tl_lower, lows_to_beat_date, lows_to_beat_time+line_len,lows_to_beat);
Here is the code that draws the new lines correctly - directly after the failed attempts - using the same inputs:
Code: Select all
tl_lower = TL_New(lows_to_beat_date, lows_to_beat_time, lows_to_beat, lows_to_beat_date, lows_to_beat_time+line_len, lows_to_beat);
tl_upper = TL_New(highs_to_beat_date, highs_to_beat_time, highs_to_beat, highs_to_beat_date, highs_to_beat_time+line_len, highs_to_beat);
Here's the image. I am sure I am cross-eyed from trying to debug the code and missing something simple so set me straight.....Thanks in advance!!