Page 5 of 9

Re: Auto Trend Lines

PostPosted: Sat May 16, 2015 11:28 pm
by Thumper
Is it possible for Auto Trend Lines to keep the old historical trend lines?

Re: Auto Trend Lines

PostPosted: Mon May 18, 2015 2:59 am
by Apprentice
In theory, I can add a horizontal shift.
Which will shift the focus indicator n periods ago.

As it is Indicator is not designed to provide historical data.

A completely different algorithm should be written.

Re: Auto Trend Lines

PostPosted: Mon May 18, 2015 2:22 pm
by SANTOSH
hi apprentice ,


any recent work for my previous post for zig troughs and peaks for auto trend lines start point ?


thanks ,
santosh

Re: Auto Trend Lines

PostPosted: Tue May 19, 2015 3:05 am
by Apprentice
Not at this time.

Re: Auto Trend Lines

PostPosted: Mon Jul 03, 2017 7:41 am
by Apprentice
The indicator was revised and updated.

Re: Auto Trend Lines

PostPosted: Mon Jul 03, 2017 8:58 am
by Cactus
Great work with the new version
I have a question. I really like the way the lines are drawn in this indicator.
I see it makes use of
"core.host:execute("drawLine", line_id, date1, y1, date2, y2, color,style, width);"

Would it be possible to have the same line behavior to be present in this indicator:
"CSV Lines Helper Tool" : viewtopic.php?f=17&t=64603

I have posted in that thread before describing what the problem is, the lines are moving around, but I think if they use the same drawline function like here it would be better, do you think you can edit the "CSV Lines Helper Tool" to have the lines drawn same way as they are in this indicator?

And also add an option to extend the lines x periods to the right? Currently they end before the most recent candle

Re: Auto Trend Lines

PostPosted: Tue Jul 04, 2017 8:17 am
by Apprentice
Your request is added to the development list, Under Id Number 3819
If someone is interested to do this task, please contact me.

Re: Auto Trend Lines

PostPosted: Fri Jul 07, 2017 6:57 pm
by Cactus
Nevermind that request, I got it working after some more study
Here's the code:
Code: Select all
   for key, value in pairs(lines) do
      local index_1 = core.findDate(source, value.date_1, true);
      local index_2 = core.findDate(source, value.date_2, true);
      x_1 = context:positionOfBar(index_1);
      x_2 = context:positionOfBar(index_2);
      visible, y_1 = context:pointOfPrice(value.rate_1);
      visible, y_2 = context:pointOfPrice(value.rate_2);
       
        a1, c1= math2d.lineEquation (index_1, value.rate_1, index_2, value.rate_2);       
        Y1= GetYofABCLine(size, a1, c1);
       
        core.drawLine(out, core.range(index_1, index_2), value.rate_1, index_1 , value.rate_2, index_2,core.rgb(255, 0, 0));   
        core.drawLine(out, core.range(index_2, size), value.rate_2, index_2, Y1, size,core.rgb(0, 144, 0));

Re: Auto Trend Lines

PostPosted: Mon Jul 10, 2017 4:28 pm
by Apprentice
Try this version.
CSV Lines Helper Tool.lua
(5.23 KiB) Downloaded 1386 times

Re: Auto Trend Lines

PostPosted: Mon Jul 10, 2017 11:31 pm
by Cactus
I receive error
With this data
Code: Select all
06/30/2017 00:42,84.3165,06/29/2017 21:29,86.1305,
06/30/2017 00:42,84.3165,06/29/2017 22:10,86.0405,
06/30/2017 00:42,84.3165,06/29/2017 22:55,86.0725,
06/30/2017 00:42,84.3165,06/29/2017 23:20,86.0605,
06/30/2017 00:42,84.3165,06/29/2017 23:58,86.0785,
06/30/2017 00:42,84.3165,06/30/2017 00:27,86.06,
06/30/2017 00:42,84.3165,06/30/2017 00:47,86.143,
06/30/2017 00:42,84.3165,06/30/2017 01:12,86.111,
06/30/2017 00:42,84.3165,06/30/2017 01:19,86.0975,
06/30/2017 00:42,84.3165,06/30/2017 01:49,86.053,
06/30/2017 00:42,84.3165,06/30/2017 02:10,86.0685,
06/30/2017 00:42,84.3165,06/30/2017 03:09,85.9035,
06/30/2017 00:42,84.3165,06/30/2017 03:29,85.9315,
06/30/2017 00:42,84.3165,06/30/2017 04:02,85.93,
06/30/2017 00:42,84.3165,06/30/2017 04:22,85.9505,
06/30/2017 00:42,84.3165,06/30/2017 04:55,85.851,
06/30/2017 00:42,84.3165,06/30/2017 05:24,85.8775,
06/30/2017 00:42,84.3165,06/30/2017 06:15,86.0485,
06/30/2017 00:42,84.3165,06/30/2017 06:48,86.0225,
06/30/2017 00:42,84.3165,06/30/2017 07:31,86.0525,
06/30/2017 00:42,84.3165,06/30/2017 08:04,85.9995,
06/30/2017 00:42,84.3165,06/30/2017 08:19,86.002,
06/30/2017 00:42,84.3165,06/30/2017 09:11,86.1085,
06/30/2017 00:42,84.3165,06/30/2017 10:04,86.1635,
06/30/2017 00:42,84.3165,06/30/2017 10:25,86.135,
06/30/2017 00:42,84.3165,06/30/2017 10:52,86.0865,
06/30/2017 00:42,84.3165,06/30/2017 11:19,86.164,
06/30/2017 00:42,84.3165,06/30/2017 11:50,86.2085,
06/30/2017 00:42,84.3165,06/30/2017 12:31,86.2515,
06/30/2017 00:42,84.3165,06/30/2017 12:53,86.2185,
06/30/2017 00:42,84.3165,06/30/2017 13:33,86.2995,
06/30/2017 00:42,84.3165,06/30/2017 14:04,86.3025,
06/30/2017 00:42,84.3165,06/30/2017 15:15,86.4095,
06/30/2017 00:42,84.3165,06/30/2017 15:59,86.4315,
06/30/2017 01:06,84.325,06/30/2017 01:29,84.333,
06/30/2017 01:06,84.325,06/30/2017 01:45,84.3325,
06/30/2017 01:06,84.325,06/30/2017 02:00,84.3305,
06/30/2017 01:06,84.325,06/30/2017 02:11,84.318,
06/30/2017 01:06,84.325,06/30/2017 02:35,84.3675,


Code: Select all
Symbol Strategy/Indicator Message Time AUD/JPY CSV LINES HELPER TOOL APPRENTICE VERSION(AUD/JPY) An error occurred during the calculation of the indicator 'CSV LINES HELPER TOOL APPRENTICE VERSION(AUD/JPY)'. The error details: C:/Program Files (x86)/Candleworks/FXTS2/Indicators/Custom/CSV Lines Helper Tool APPRENTICE VERSION.lua:104: The second parameter must be a number. 11/07/2017 08:36:29


On AUD/JPY m1 timeframe
I switched months with weeks in my timeframe thats why the data has month first
Code: Select all
   local _month,_day , _year, _hour, _minute = string.match(str, '(%d+)/(%d+)/(%d+)