Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated June 30, 2014
trending_up
3,441 views
thumb_up
0 thanks given
group
2 followers
forum
4 posts
attach_file
2 attachments
June 29th, 2014, 04:09 PM
United Kingdom
Posts: 4 since Jun 2014
Thanks Given: 1
Thanks Received: 0
Relative Strength
Hi,
I an new to TradeStation Easylanguage code.
Could you please correct the code below?
I do not know how to use the Array function in formulas
Or should this me a Function
I have attached MS Word copy of this note in case it gets corrupted in the internet
Also a screenshot to show what the Indicator should look like
Hoping you can oblige.
Thank you in advance
Derek
----------------------------*Code*-----------------------------------
Input: Period(20);
Vars:
f88(0), f90(0), f0(0),v4(0),v8 (0), vC(0), v10(0), v14(0), v18(0), v20(0),
f8(0), f10(0), f18 (0), f20(0), f28(0), f30(0), f38(0), f48(0), v1C(0),
f50(0), f58(0), f60(0), f68(0), f70(0), f78(0), f80(0), f40(0);
f90 = 1.0;
f0 = 0.0;
{
if ( Period-1 >= 5 )
f88 = Period-1.0;
else f88 = 5.0;
f8 = 100.0 * ((H[0]+L[0]+Close[0])/3);
f18 = 3.0 / (Period + 2.0);
f20 = 1.0 - f18;
//for ( i = 1; i < BarCount; i++ )
for i = 1 to 21
begin
{
if (f88 <= f90) f90 = f88 + 1; else f90 = f90 + 1;
f10 = f8;
f8 = 100*Close[i];
f8 = 100.0*((H[i]+L[i]+C[i])/3);
v8 = f8 - f10;
f28 = f20 * f28 + f18 * v8;
f30 = f18 * f28 + f20 * f30;
vC = f28 * 1.5 - f30 * 0.5;
f38 = f20 * f38 + f18 * vC;
f40 = f18 * f38 + f20 * f40;
v10 = f38 * 1.5 - f40 * 0.5;
f48 = f20 * f48 + f18 * v10;
f50 = f18 * f48 + f20 * f50;
v14 = f48 * 1.5 - f50 * 0.5;
f58 = f20 * f58 + f18 * abs (v8);
f60 = f18 * f58 + f20 * f60;
v18 = f58 * 1.5 - f60 * 0.5;
f68 = f20 * f68 + f18 * v18;
f70 = f18 * f68 + f20 * f70;
v1C = f68 * 1.5 - f70 * 0.5;
f78 = f20 * f78 + f18 * v1C;
f80 = f18 * f78 + f20 * f80;
v20 = f78 * 1.5 - f80 * 0.5;
if ((f88 >= f90) && (f8 != f10)) f0 = 1.0;
if ((f88 == f90) && (f0 == 0.0)) f90 = 0.0;
if ((f88 < f90) && (v20 > 0.0000000001))
v4 = (v14 / v20 + 1.0) * 50.0;
if (v4 > 100.0) v4 = 100.0;
if (v4 < 0.0) v4 = 0.0;
}
else
{
v4 = 50.0;
}
rsx[i] = v4;
}
// return rsx;
//}
// Plot1( rsx, "rsx", RED, default, 2 ) ;
--------------------------------------------------- */Code*-----------------------------------------------------------------------
Attached Thumbnails
Attached Files
Elite Membership required to download: Relative Strength.doc
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
June 29th, 2014, 06:41 PM
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639
Derek,
what is the origin of the code? Did you try to translate it from a different language?
Regards,
ABCTG
June 30th, 2014, 03:20 AM
United Kingdom
Posts: 4 since Jun 2014
Thanks Given: 1
Thanks Received: 0
Hello,
Thank you for your reply to my question.
The code was originally posted as Amibroker Code on the wisestocktrader...
There is a paste and copy friendly tab on the wisestocktrader web site
( I do not know how to add the Blue tag "Code " in to put the code into a panel. _
Thank you for your help,
Best regards,
Derek
Code
----------------- Original Amibroker Code ------------------------------------------------------------
/*
Turbo_JRSX : a better RSI ?
*/
SetChartOptions (0, 0, chartGrid20 | chartGrid50 | chartGrid80);
Len = Param ( "Periods", 12, 1, 200, 1 );
function JRSX ( Period )
{
f88 = 0; f90 = 0; f0 = 0; v4 = 0; v8 = 0; vC = 0; v10 = 0; v14 = 0; v18 = 0; v20 = 0;
f8 = 0; f10 = 0; f18 = 0; f20 = 0; f28 = 0; f30 = 0; f38 = 0; f48 = 0; v1C = 0;
f50 = 0; f58 = 0; f60 = 0; f68 = 0; f70 = 0; f78 = 0; f80 = 0; f40 = 0;
f90 = 1.0;
f0 = 0.0;
if ( Period-1 >= 5 )
f88 = Period-1.0;
else
f88 = 5.0;
f8 = 100.0 * ((H[0]+L[0]+Close[0])/3);
f18 = 3.0 / (Period + 2.0);
f20 = 1.0 - f18;
for ( i = 1; i < BarCount; i++ )
{
if (f88 <= f90) f90 = f88 + 1; else f90 = f90 + 1;
f10 = f8;
// f8 = 100*Close[i];
f8 = 100.0*((H[i]+L[i]+C[i])/3);
v8 = f8 - f10;
f28 = f20 * f28 + f18 * v8;
f30 = f18 * f28 + f20 * f30;
vC = f28 * 1.5 - f30 * 0.5;
f38 = f20 * f38 + f18 * vC;
f40 = f18 * f38 + f20 * f40;
v10 = f38 * 1.5 - f40 * 0.5;
f48 = f20 * f48 + f18 * v10;
f50 = f18 * f48 + f20 * f50;
v14 = f48 * 1.5 - f50 * 0.5;
f58 = f20 * f58 + f18 * abs (v8);
f60 = f18 * f58 + f20 * f60;
v18 = f58 * 1.5 - f60 * 0.5;
f68 = f20 * f68 + f18 * v18;
f70 = f18 * f68 + f20 * f70;
v1C = f68 * 1.5 - f70 * 0.5;
f78 = f20 * f78 + f18 * v1C;
f80 = f18 * f78 + f20 * f80;
v20 = f78 * 1.5 - f80 * 0.5;
if ((f88 >= f90) && (f8 != f10)) f0 = 1.0;
if ((f88 == f90) && (f0 == 0.0)) f90 = 0.0;
if ((f88 < f90) && (v20 > 0.0000000001))
{
v4 = (v14 / v20 + 1.0) * 50.0;
if (v4 > 100.0) v4 = 100.0;
if (v4 < 0.0) v4 = 0.0;
}
else
{
v4 = 50.0;
}
rsx[i] = v4;
}
return rsx;
}
Plot ( JRSX(Len), "Turbo JRSX", ParamColor ( "Color", colorCycle ), ParamStyle ("Style"), 0, 100 );
------------------------ End of Code ------------------------------------------------------------
June 30th, 2014, 03:25 AM
United Kingdom
Posts: 4 since Jun 2014
Thanks Given: 1
Thanks Received: 0
Hello,
I was not allowed to post the HTTP link as I had insufficient previous posts ( less than 5 posts)
Best regards
Derek
Last Updated on June 30, 2014