VisualTrader Forum VisualTrader 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  
VisualTrader Forums
User-Contributed Profiles
Relative Strength Indicator
Last Activity 5/31/2013 9:07 AM
9 replies, 1682 viewings

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

^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : Relative Strength Indicator
Posted : 3/12/2012 4:45 PM
Post #6718

Would someone be able to write in a line in the indicator so that there I can see if the indicator is above 1.00 line and also make the incriments on the right move viewable at a glance.
Kind regards
Barry

Attached file : RS.txt (1KB - 300 downloads)

^ Top
Duxx

Veteran
100252525
Posts: 187

Joined: 10/14/2009

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/12/2012 4:52 PM
Post #6719 - In reply to #6718

Barry

Include before the return line

PlotLine(1)
^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : Relative Strength Indicator
Posted : 3/29/2012 3:35 PM
Post #6759 - In reply to #6718

Still does not work, please adjust test and post back to me
just need a line horizontal at the 1.0 mark so I can see the indicator above or below 1.0
kind regards
Barry
^ Top
Jim Dean

Legend
100100100100
Posts: 416

Joined: 5/20/2005
Location: L'ville, GA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/29/2012 4:51 PM
Post #6760 - In reply to #6759

The syntax is:
PlotLABEL(1) ... you can add as many PlotLabel(N) commands as you want ... they will all be the same colored lines ... all will have a label.

' ***************************************************************************
' * Relative Strength
' * by Matthew Greenslet
' *
' * Summary:
' * Indicator calculation from OT2009
' *
' * Parameters:
' * Periods
' * ReferenceSymbol (Unable to make string Parameters in OL at this time.
' Variable must be changed in code.)
' * Units OL does not support drop down menu parameters
' 1=Price 2=Return
'
' Copyright 2009 Nirvana Systems, Inc. Austin, Tx, USA.
' ***************************************************************************
#Indicator
#PARAM "Periods", 7
#PARAM "Units", 1, 1, 2

Dim fRatio, fRatioA, fRatioB, fRefClose, fRS As Single
Dim sReferenceSymbol as String = "$SPX"

fRefClose = GetClose(sReferenceSymbol)

If Units = 1 Then
fRatio = 0
If fRefClose <> 0 Then
fRatio = C/fRefClose
End If
fRS = EMA(fRatio, Periods)
Else
If Bar > Periods Then
fRatioA = 0
fRatioB = 0
fRS = 0
If C[Periods] <> 0 Then fRatioA = C/C[Periods]
If fRefClose[Periods] <> 0 Then fRatioB = fRefClose/fRefClose[Periods]
If fRatioB <> 0 Then fRS = fRatioA/fRatioB
End If
End If

PlotLabel(1)
Plot("Relative Strength", fRS)
Return fRS

^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/29/2012 6:22 PM
Post #6761 - In reply to #6718

I have omnilanguage in VT 9 it does not plot anything
Bazz
^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/29/2012 6:31 PM
Post #6762 - In reply to #6718

thi is what it has to look like the original in omni

Attached file : rsbc.docx (240KB - 263 downloads)

^ Top
Jim Dean

Legend
100100100100
Posts: 416

Joined: 5/20/2005
Location: L'ville, GA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/29/2012 7:49 PM
Post #6763 - In reply to #6761

So, is your problem just not seeing the line at "1", or not seeing anything at all?

If the latter, make sure that $SPX is in your focus list.
^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/30/2012 12:36 AM
Post #6764 - In reply to #6718

Jim returen is not there
check out the standard one in the price dropdown is ruturn
I need return also
Bazza
^ Top
barryc48

Member

Posts: 22

Joined: 4/9/2008
Location: Sydney AUSTRALIA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/30/2012 12:43 AM
Post #6765 - In reply to #6718

seems to be working when I move the slide to 2

^ Top
Jim Dean

Legend
100100100100
Posts: 416

Joined: 5/20/2005
Location: L'ville, GA

User Profile
 
Subject : RE: Relative Strength Indicator
Posted : 3/30/2012 6:10 AM
Post #6766 - In reply to #6765

I'm sorry but you will have to be clearer. Show a snapshot of your chart, and your Symbol-List, and your Edit > Data Periods window. I'm trying to work with your clues but can't find a problem.

Here is a snapshot of what I see when I plot two instances of the canned RS indicator (in orange), and two instances of the OLang-based RS indicator (in red). One of each is set to Units = 1/Price, the other is set to Units = 2/Return.

Please note that the final plot includes a reference line at 1.0, as you requested. That line will only show up if the range of plotted values for the window of time that you are looking at has a high value > 1 and a low value < 1. If the range is far away from 1, then that line will NOT show up (such as if you use the Units= 1/Price return value).

The problem is NOT with the OLang code.

Note that $SPX is in the list.

Maybe there is a problem with your VT settings, it is hard to tell.

The only other reason that I can think of is that if you are using a high value for the input Periods, such as 200, but you have a small amount of data loaded. I've added two more lines to the code to compensate for that - see snapshot below.






[Edited by Jim Dean on 3/30/2012 6:12 AM]

Attached file : RS Snap.png (50KB - 418 downloads)
Attached file : RS code.png (21KB - 435 downloads)

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
(un)/Freeze thread |
Toggle e-mail notification


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