Trend Trader code convert

Locked
grimweasel
Trader
Posts: 95
Joined: Sun Nov 20, 2011 3:48 pm

Trend Trader code convert

Post by grimweasel »

Hi folks.

A little code conversion help please. This is plots the indicator developed by Andrew Abraham in the Trading the Trend article of TASC September 1998 but in ProRealTime. Is there anyway this could be converted into Empty4/5 code enabling it's use on my FX price chart window please?

The calculation uses a 21-period weighted average of the true range, giving higher weight to the true range of the most recent bar. The final value is then multiplied by 3.
The volatility indicator is used as a stop-and-reverse method. Let's say the market has been rising, then the volatility indicator is calculated each day and subtracted from the highest close during the rising market. The highest close is always used, even if there has been a series of lower closes since the highest close. If the market closes below the volatility indicator, then for the next day, the current reading of the volatility indicator is added to the lowest close. This step is followed each day until the market closes above the trailing volatility indicator.
We now have a definition of the trend. An upward trend exists as long as the volatility indicator is below the market and a downtrend is in force if the volatility indicator is above the market.

Code: Select all

//Abrahams Trend Trade
Length =21
Multiplier = 3
avrTR = weightedaverage[Length](AverageTrueRange[1](close))
highestC = highest[Length](high)
lowestC = lowest[Length](low)
hiLimit = highestC[1]-(avrTR[1]*Multiplier)
lolimit = lowestC[1]+(avrTR[1]*Multiplier)

if(close > hiLimit AND close > loLimit) THEN
     ret = hiLimit
ELSIF (close < loLimit AND close < hiLimit) THEN
     ret = loLimit
ELSE
     ret = ret[1]
ENDIF

RETURN ret coloured(238,238,0) as "Trend Trader"
Many thanks in advance guys!

Best

Grim :mrgreen:
xrismak
Trader
Posts: 710
Joined: Tue Apr 24, 2012 9:43 pm

Trend Trader code convert

Post by xrismak »

Grimzizzy,

You like that Gizmo.... :!:


Hehehehehehehehe,

Enjoy.

xrismak ;)
grimweasel
Trader
Posts: 95
Joined: Sun Nov 20, 2011 3:48 pm

Trend Trader code convert

Post by grimweasel »

xrismak old bean. I like to use it for visual placement of vola related stops ;-)
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Trend Trader code convert

Post by SteveHopwood »

Cannot help with the programming here. Just posting in the hope that one of the Resident Coding Genius' here will notice that I have posted, will read your post and step in to help. It happens sometimes.

I hope you get sorted out.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

Trend Trader code convert

Post by renexxxx »

SteveHopwood » Wed Feb 22, 2017 8:26 am wrote:Cannot help with the programming here. Just posting in the hope that one of the Resident Coding Genius' here will notice that I have posted, will read your post and step in to help. It happens sometimes.
I attach the AbrahamTrendIndi with the following disclaimer:

1. I don't know ProRealTime code. Never heard of it, never seen it before.
2. I don't know Andrew Abraham, nor the article in the TASC September 1998.

So, I totally miss the background and context for this indicator. The attached code is my interpretation of the ProRealTime code -- it could be totally wrong, but it may inspire some other coders to correct my mistakes.

Have fun!
You do not have the required permissions to view the files attached to this post.
grimweasel
Trader
Posts: 95
Joined: Sun Nov 20, 2011 3:48 pm

Trend Trader code convert

Post by grimweasel »

Hey guys and Steve. Thanks so much for the help with this. I just wanted to forward test this as it came up in a book I was reading about trends.

I have a VERY good and accurate Support and Resistance (SR) Indicator (TLB - Three Line Break) attached but I was wondering if a KIND coder would be able to add another SR line so that it shows x2 for each TF?

This Indy gives the next SR levels for 'y' time frame on your chart, but as I use limit orders in my trading I need 2 levels for each TF on my charts allowing for stop placement. Does the code allow for this? Currently it will show say H1 and H4 levels nearest price but I wanted it to show the next level, so two levels above and below price for each chart?

Thanks kindly in advance. :clap:
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Trend Trader code convert

Post by milanese »

De-compiled code is strictly prohibited to post in our forum, you should now this rule, I have deleted your attachments.

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Locked

Return to “Coders Hangout”