Trend Risk Indicator

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 Risk Indicator

Postby Apprentice » Fri Aug 01, 2014 4:13 am

Trend Risk Indicator.png

T3Trend Bands Indicator Spin-off
viewtopic.php?f=17&t=3128&p=7347&hilit=t3+trendbands#p7347
Based on request
viewtopic.php?f=27&t=60979

Will indicate N consecutive closing Over Top line
Under The Bottom Line or Within channel.
TrendRisk indicator.lua
(4.92 KiB) Downloaded 1394 times


The indicator was revised and updated
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36474
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Risk Indicator

Postby Fx4mt.com » Sun Aug 03, 2014 11:06 am

Thanks a bunch Apprentice!! Excellent work. I really, really appreciate it!

I made a couple minor tweaks to get it set up most like the actual TrendRisk indicator. I will attach for those that are interested.

TrendRisk = count of bars 12
Deviation 1.8

Thanks a bunch!!
Attachments
TrendRisk indicator123.lua
(4.92 KiB) Downloaded 978 times
Fx4mt.com
 
Posts: 36
Joined: Tue Jan 15, 2013 1:19 pm

Re: Trend Risk Indicator

Postby Fx4mt.com » Tue Aug 12, 2014 7:04 pm

Would it be possible to have a candlestick wick color option? For example, top side wick red, bottom side wick green? This referring to wicks only, not the actual candle. Is this possible?

Thanks a bunch
Fx4mt.com
 
Posts: 36
Joined: Tue Jan 15, 2013 1:19 pm

Re: Trend Risk Indicator

Postby Apprentice » Wed Aug 13, 2014 6:13 am

You can simply paint the entire candle.
open:setColor(period, Color);

Dyeing of wicks is possible.
But it is a bit tricky and advanced programming requirements.
U can draw two vertical lines.
First from math.max (open,close) to High
Second From math.min (open,close) to Low
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36474
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Risk Indicator

Postby amine.dechemi » Fri Aug 15, 2014 5:52 pm

Hello
can i have a formula please ;
amine.dechemi
 
Posts: 8
Joined: Fri Aug 15, 2014 5:06 pm

Re: Trend Risk Indicator

Postby Apprentice » Wed Aug 20, 2014 1:16 pm

Code: Select all
SmoothPrice[period]=(SmoothPrice[period-1]*(BandBars-1)+source.close[period])/BandBars;
    SmoothRange[period]=(SmoothRange[period-1]*(BandBars-1)+source.high[period]-source.low[period])/BandBars;
 
    Top[period]=SmoothPrice[period]+SmoothRange[period]*Deviation;
    Bottom[period]=SmoothPrice[period]-SmoothRange[period]*Deviation;

if source.close[i]< Top[i] then Color[i] = Up;
if source.close[i]> Bottom[i] then Color[i] = Down
else  Color = Neutral



This is a simplified version.
The complete algorithm is available within Indicator Code.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36474
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trend Risk Indicator

Postby amine.dechemi » Sat Aug 23, 2014 1:24 pm

very good
merci
amine.dechemi
 
Posts: 8
Joined: Fri Aug 15, 2014 5:06 pm


Re: Trend Risk Indicator

Postby Thumper » Mon Jul 27, 2015 9:34 pm

Apprentice can you please create a third line for Trendrisk123 that is exactly between the two existing lines. Also can you make it that the user can choose a dotted line for this new middle line and have at the same time a full line for the top and bottom existing lines? Also the user can choose a different colour for each of the 3 lines. Thanks mate! Rob
Thumper
 
Posts: 11
Joined: Sun Feb 05, 2012 5:19 pm


Next

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot] and 81 guests