log in     sign up for free
 
In fact, the ironic part of system design is if you want to maximize profits, you must be willing to give back a great deal of the profits you have already accumulated.
Van K. Tharp
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Relative Vigor Index

Formula for: TradeStation

indicator


 

 

Views:  2685

Added: July 20, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: TradeStation, indicator
 
Your Ad Here
John Ehlers's article "Relative Vigor Index (RVI)" in this issue includes a version of EasyLanguage code for the indicator. That version includes hardcoded implementations of a symmetrically weighted moving average in three places, and also a hardcoded implementation of two summations. We provide an alternative version below that replaces these hardcoded implementations with function calls. This version produces identical results, except for minor initialization differences.

The SWMA, also known as a triangular moving average, can be conveniently implemented as a double simple moving average, and this code can be separated out into a function that can than be called from the main body of the code as many times as necessary. TradeStation includes a TriAverage function, but the function required here is a little more generalized, so we call it TriAverage_gen and provide the code for it below, following the main indicator code. Summation is another built-in function in TradeStation, and we use that as is.




Type : Function, Name : TriAverage_gen

inputs:
Price( numericseries ),
Length( numericsimple ) ;

variables:
Length1( 0 ),
Length2( 0 ) ;
Length1 = Floor( ( Length + 1 ) * .5 ) ;
Length2 = Ceiling( ( Length + 1 ) * .5 ) ;
TriAverage_gen =
Average( Average( Price, Length1 ), Length2 ) ;





Type : Indicator, Name : Relative Vigor Index

inputs:
Length( 10 ) ;
variables:
Change( 0 ),
MyRange( 0 ),
Num( 0 ),
Den( 0 ),
RVI( 0 ),
RVISig( 0 ) ;
Change = Close - Open ;
MyRange = High - Low ;
Value1 = TriAverage_gen( Change, 4 ) ;
Value2 = TriAverage_gen( MyRange, 4 ) ;
Num = Summation( Value1, Length ) ;
Den = Summation( Value2, Length ) ;
if Den > 0 then
RVI = Num / Den ;
RVISig = TriAverage_gen( RVI, 4 ) ;
Plot1( RVI, "RVI" ) ;
Plot2( RVISig, "Sig" ) ;






This code will also be available for download at www.tradestation2000i.com. Select Support -> EasyLanguage -> Strategies and Indicators -> Traders Tips, and look for the file "RelativeVigorIndex.ELS."
-Ramesh Dhingra
Director, EasyLanguage Consulting
TradeStation Technologies, Inc. (formerly Omega Research, Inc.) a wholly owned subsidiary of TradeStation Group, Inc.
http://www.TradeStation.com

 

 



Code:


Type : Function, Name : TriAverage_gen

inputs:
Price( numericseries ),
Length( numericsimple ) ;

variables:
Length1( 0 ),
Length2( 0 ) ;
Length1 = Floor( ( Length + 1 ) * .5 ) ;
Length2 = Ceiling( ( Length + 1 ) * .5 ) ;
TriAverage_gen =
Average( Average( Price, Length1 ), Length2 ) ;





Type : Indicator, Name : Relative Vigor Index

inputs:
Length( 10 ) ;
variables:
Change( 0 ),
MyRange( 0 ),
Num( 0 ),
Den( 0 ),
RVI( 0 ),
RVISig( 0 ) ;
Change = Close - Open ;
MyRange = High - Low ;
Value1 = TriAverage_gen( Change, 4 ) ;
Value2 = TriAverage_gen( MyRange, 4 ) ;
Num = Summation( Value1, Length ) ;
Den = Summation( Value2, Length ) ;
if Den > 0 then
RVI = Num / Den ;
RVISig = TriAverage_gen( RVI, 4 ) ;
Plot1( RVI, "RVI" ) ;
Plot2( RVISig, "Sig" ) ;


 






Author: John Ehlers
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

Pivot Bar
RAVI
Seasonal SB
ZigZag
eKam CCI
Moving Averages with Resistance and Support
Trend Continuation Factor
Regularization
Point of Balance Oscillator
Instantaneous Trend Line
...
 
 
all formulas for TradeStation
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012