NexusFi: Find Your Edge


Home Menu

 





Tradestation Relative Strength


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,286 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 2 attachments




 
Search this Thread

Tradestation Relative Strength

  #1 (permalink)
worswick
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
Click image for larger version

Name:	RS.JPG
Views:	195
Size:	134.5 KB
ID:	150029  
Attached Files
Elite Membership required to download: Relative Strength.doc
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


Derek,

what is the origin of the code? Did you try to translate it from a different language?

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #4 (permalink)
worswick
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     ------------------------------------------------------------

Reply With Quote
  #5 (permalink)
worswick
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

Reply With Quote




Last Updated on June 30, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts