FXCM Forex Trading

Trend Line Helper

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Trend Line Helper

Postby Apprentice » Tue Jun 09, 2015 4:51 am

Trend Line Helper.png

Based on request.
viewtopic.php?f=27&t=62268

While you can argue this indicator does not have any practical value.
This indicator is designed to be used from within strategys.

Line is determined by two points.
Date And Level is set via indicator parameter sections.
Trend Line Helper.lua
(4.51 KiB) Downloaded 541 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17130
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Line Helper

Postby zoltanh » Wed Jun 10, 2015 2:11 pm

Thanks a lot, Apprentice!! this is exactly what i need.. i can start putting this into strategies :)
zoltanh
 
Posts: 22
Joined: Tue Aug 26, 2014 2:24 pm

Re: Trend Line Helper

Postby zoltanh » Tue Jun 16, 2015 3:15 pm

Hi Apprentice,

I seem struggling with this, I created the first strategy, which is a simple cross over/under of the line. When I want to run the strategy TS always says that the indicator cannot be found although it is imported. I think somehow the strategy cannot pull the indicator data. Could you help me having a look at this?
thanks!
zoltanh
 
Posts: 22
Joined: Tue Aug 26, 2014 2:24 pm

Re: Trend Line Helper

Postby Apprentice » Wed Jun 17, 2015 2:21 am

Try this lines.
Code: Select all
assert(core.indicators:findIndicator("TREND LINE HELPER") ~= nil, "Please, download and install Trend Line Helper.LUA indicator");
TLH = core.indicators:create("TREND LINE HELPER", Level1, Date1, Level2, Date2, Extend );   


You must use uppercase when defined indicator calls.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17130
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Line Helper

Postby zoltanh » Fri Jun 19, 2015 7:26 am

Hi Apprentice, Big thank you again for your help!!!
zoltanh
 
Posts: 22
Joined: Tue Aug 26, 2014 2:24 pm

Re: Trend Line Helper

Postby Cactus » Sat Jul 30, 2016 1:27 pm

I like this very much. The only trendline that can be used in a strategy indeed. Now, can the point level and point date be automatically definded by the past zig zag turning points?
With zig zag settings set by user also?

When zig zag turns from red (downtrend) to green (uptrend), make that point 1
When zig zag turns from green (uptrend) to red (downtrend), make that point 2
This would make an "uptrend" line, color = green

When zig zag turns from green (uptrend) to red (downtrend), make that point 1
When zig zag turns from red (downtrend) to green (uptrend), make that point 2
This would make a "downtrend" line, color = red

And to have multiple lines like this not just two, on all past zig zag points? But all independently named (up1, dn1, up2, dn2 etc)

I have something that made in Excel to detect zig zag swings from past historical data exported from marketscope "table" view with zigzag indicator applied, please see screenshot for formulas if they might be useful to help. Now the only thing is to take the date from that period too and the parameters can be populated. This indicator would gain much power this way.
Attachments
lowpoint.png
Low point
highpoint.png
High point
Never chase the money, let the money come to me
User avatar
Cactus
FXCodeBase: Graduate
 
Posts: 204
Joined: Fri Feb 19, 2016 11:46 am
Location: Errywhere

Re: Trend Line Helper

Postby Cactus » Sat Jul 30, 2016 1:36 pm

Actually apart from what I explained it might be better if it plotted those lines from low to low and high to high. Like normal trendlines should be drawn... So there is no "up" or "down" trend. Just lines plotted on high to high zigzags and low to low zigzags CHEERS
Never chase the money, let the money come to me
User avatar
Cactus
FXCodeBase: Graduate
 
Posts: 204
Joined: Fri Feb 19, 2016 11:46 am
Location: Errywhere

Re: Trend Line Helper

Postby Apprentice » Tue Aug 02, 2016 6:56 am

Your request is added to the development list, Under Id Number 3582
If someone is interested to do this or any task other from list please contact me.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17130
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Line Helper

Postby Cactus » Sat Nov 05, 2016 7:59 pm

I managed to achieve what I described in above posts using a macro to input the points and date data from Excel into multiple instances of Trend Line Helper on the chart.

The problem is, the lines will not show until sufficient candlesticks are shown on the screen. Can this be fixed to still show the lines even if date is out of range for current view?

For example, when having the chart set to 1 minute timeframe, one cannot scroll past back to year 2010 for example. So if I add a trendline that should show up today, but the points are defined back in 2010, the indicator will stay blank until it "sees" that data on chart, only then it will draw a line with "extend" set to yes... So my question is, can it still work without me having to zoom out all the chart? Sometimes it's impossible, such as with "1 minute" data... It's only possible to zoom out so far with 1m view in backtester chart. Thanks
Never chase the money, let the money come to me
User avatar
Cactus
FXCodeBase: Graduate
 
Posts: 204
Joined: Fri Feb 19, 2016 11:46 am
Location: Errywhere

Re: Trend Line Helper

Postby Apprentice » Mon Nov 07, 2016 6:13 am

Can you share excel / code.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17130
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 8 guests