excuse me for this quite a long delay. I have coded V5, here it is attached.
The parameters changed a little:
a vertical line is plotted at the beginning and the end of the range, the colors are:
range_start (Green)
range_start_ext (Yellow) - explained later what it is
range_end (Red)
use_range: true: trendlines are calculated based on the range from "rfbt" (abbr. Range First Bar Time) to rfbt + "range_length" hours.
use_range: false: trendlines are calculated looking backwards in time from "fixedTLtime", the range is not used in any way. in this case only range_start line is plotted.
I added some new functionality, to help decide what may be the best range starting time.
extend_range: false: TL calculation according to the original concept.
extend_range: true: when there is no upper or lower trendline, I start extend the range backwards, until I find a swing high/low. I look back max. "extendrange_max" bars (hours) from the start.
this may cause some confusion: as time goes by from the range start and new swing high/low develops the TL may change. this extending is only calculated when there is no TL (swing H/L) in the originally defined range. the start of the extended range is plotted with yellow, "range_start_ext" color.
I am sure it is clearer when seen on the chart.
I still am not sure if it works correctly when the range ends on a different day than it starts, for example start: 22:00 end: 02:00
Meanwhile I wrote an EA of this startegy. I coded some filtering, finetuning in addition, mostly the ones discussed on this thread.
(e.g. ranging market, inside bars, too steep TL, too close S/R or pivot levels, too close SL value, 5M swing H/L entry confirmation,
main trend filtering (sma150, 200), and so on.) It is quite good so far, but still needs testing, developing. I test it on FXOpen 5 digits
ECN demo account. Unfortunately I don't have the chance to see it working every day, but the results are usually very-very good.
The EA runs on all the 18 pairs available in the demo acc, except SEK/NOK pairs (very high spread). It uses 3 type of orders,
1. next pivot target, 2. close after 3 hrs., and the 3rd is trailing. When it fails (losing trade) usually are the cases that are already
known as additional filtering, finetuning. Except from, of course, the market moving in the opposite direction

I hope you find it useful. Feel free to ask if something is not clear.
Regards,
Gyula
neil81 wrote:Hi,
i have just come accross this excellent forum.
does anybody know whether Gyula coded a version 5 of the trendline indicator as the last post i can see on here is from 3 months ago?
Many Thanks
Neil