OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Professional Forum
OmniScripts
Sell Relative Strength Index (SRSI)
Last Activity 1/25/2019 7:52 AM
10 replies, 253 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
THOMAS HELGET

Legend
500
Posts: 524

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : Sell Relative Strength Index (SRSI)
Posted : 1/23/2019 9:54 PM
Post #30259

Fellow coders:

Attached please find the translated TradeStation EasyLanguage (ELS) code for the Sell Relative Strength Index (SRSI) from the February, 2019 "Technical Analysis of Stocks & Commodities" article, Sell Relative Strength Index" by Howard Wang, pp. 36 - 38.

To verify its programming please compare this screen shot of it with the Nirvana RSI on QQQ as shown on page 38 of the article:



One note of interest - this took me a while to figure out as the original TradeStation code calls for the use of Absolute Values in the calculation of Value1 and Value2. Doing so in OmniLanguage produces only positive values of these variables so that no negative SRSI can be calculated. Removing the ABS yields the correct interpretation of the coding.

Also please note that the screen shot above uses a Length of 7 as opposed to the coding default of 20.

Tom Helget

[Edited by THOMAS HELGET on 1/23/2019 9:58 PM]

Attached file : QQQ Sell Relative Strength Index.jpg (165KB - 238 downloads)
Attached file : indSRSI.txt (2KB - 42 downloads)

^ Top
Jim Dean

Sage
200010001002525
Posts: 3173

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 7:02 AM
Post #30260 - In reply to #30259

Hi Tom:

I’m just waking so I may be missing something but I think you can likely simplify the calc to be:

SMA( (C-O) / (H-L+.0000001), Length )

Of course it doesn’t pretty-print without extra code ;~)

[Edited by Jim Dean on 1/24/2019 7:04 AM]

^ Top
THOMAS HELGET

Legend
500
Posts: 524

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 7:04 AM
Post #30261 - In reply to #30260

Jim:

If you think I have inflated the code you should take a look at the TradeStation code in the original article. What a web we weave when we first practice to deceive.

Tom Helget
^ Top
Jim Dean

Sage
200010001002525
Posts: 3173

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 7:07 AM
Post #30262 - In reply to #30261

I believe you!

Actually, my formula is not the same as yours in the (rare) case of H-L=0

My reason for posting was not to criticize but rather to point out what the core of the calc was actually doing.

[Edited by Jim Dean on 1/24/2019 7:08 AM]

^ Top
THOMAS HELGET

Legend
500
Posts: 524

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 7:12 AM
Post #30263 - In reply to #30262

Jim:

I appreciate that and, as you can see from the code, the division by zero issue (H - L = 0) is nicely dealt with.

Tom Helget
^ Top
Jim Dean

Sage
200010001002525
Posts: 3173

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 8:11 AM
Post #30264 - In reply to #30263

Here’s a hint as to how to do it and avoid the repeated for-next loops at every bar (which for more complex code can slow things down)

#Indicator
#param “Len”, 7
Dim Term, Ans as single

Term = iif( H=L, 0, (C-O) / (H-L) / Len )
Ans += Term

If bar >= Len then
Ans -= Term[Len]
Plot(“SRSI”, Ans)
End if

Return Ans


… this is basically how any SMA can be calc'd iteratively. There are (more complex) variants for WMA, etc. Definitely the most efficient coding method.


[Edited by Jim Dean on 1/25/2019 8:23 AM]

^ Top
THOMAS HELGET

Legend
500
Posts: 524

Joined: 3/22/2006
Location: BALDWINSVILLE, NEW YORK

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 10:15 AM
Post #30265 - In reply to #30264

Jim:

Yes, very nice - I like that calculate the answer as merrily you go along approach and realize that loops can really slow things down as you noted.

Tom Helget
^ Top
jawjahtek

Member
25
Posts: 32

Joined: 5/30/2006
Location: Georgia, USA

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 2:42 PM
Post #30266 - In reply to #30264

Jim, thank you for your code improvements.
My problem: what "can be calves iteratively"????
^ Top
Jim Dean

Sage
200010001002525
Posts: 3173

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 4:05 PM
Post #30267 - In reply to #30266

Hmm

What can be calves iteravely?

Cow children riding space mountain over and over.
^ Top
Greg

Veteran
100100252525
Posts: 298

Joined: 3/22/2006
Location: Mishawaka, IN 46544

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/24/2019 5:07 PM
Post #30268 - In reply to #30259

It is a moooooving average right? (I know it's bad but I couldn't resist)
^ Top
Ken Wilsdon

New User

Posts: 2

Joined: 3/26/2018
Location: Calgary, Alberta, Canada

User Profile
 
Subject : RE: Sell Relative Strength Index (SRSI)
Posted : 1/25/2019 7:52 AM
Post #30272 - In reply to #30259

Let's milk this joke for all that it is worth!
Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.