log in     sign up for free
 
My attitude is: Never risk your family's security.
Marty Schwartz
 
 
Home
systems (284)
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD 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

VIMA

Formula for: TradeStation

indicator


 

 

Views:  1923

Added: August 23, 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
R.G. Boomers' variable-interval moving average, or VIMA, described elsewhere in this issue, can be implemented as a function-cum-indicator pair in TradeStation's EasyLanguage as shown here. The function VimaLength returns the recommended length for the simple average at the current bar, given the set of difference intervals to use, the amount of history to consider, and the lengths of the pair of bracketing averages.
The indicator VIMA provides the actual values of the inputs for the VimaLength function and plots the variable interval moving average based on the dynamically changing average length, or interval, from bar to bar. Default values for the inputs are included in the indicator and can be edited by the user at the time the indicator is applied to a chart.

Instead of an indicator, the VimaLength function could also be called by a user-created trading strategy with similar inputs. TradeStation's backtesting engine could then be used to not only quickly find the best pair of averages to use, but to optimize the other two inputs as well.

The code for both the function and the indicator will be available for download at www.tradestation.com. Look for the file VIMA.ELS.



Type : Function, Name : VIMALength

inputs:
MaxLength1(numericsimple),
{"interval" will vary from 2 days to (MaxLength1 + 1)
days; equivalently, Length1 below will vary from 1 day to MaxLength1 days}

Length2(numericsimple),
{number of historical RESULTS to consider for each max/min calculation;
actual number of historical data points used may be more than this}

ShortestVIMALength(numericsimple),
LongestVIMALength(numericsimple);

variables:
VIMAOsc( 0 ),
Length1( 0 ),
MaxDiff( 0 ),
MinDiff( 0 ),
NormDiff( 0 ),
VIMAOscMax( 0 ),
VIMAOscMin( 0 ),
VIMAOscNorm( 0 ),
VIMALengthRange(LongestVIMALength - ShortestVIMALength);

VIMAOsc = 0;
for Length1 = 1 to MaxLength1
begin
MaxDiff = Highest(Close - Close[Length1], Length2);
MinDiff = Lowest(Close - Close[Length1], Length2);
NormDiff = (Close - Close[Length1] - MinDiff) / (MaxDiff - MinDiff);
VIMAOsc = VIMAOsc + NormDiff;
end;

VIMAOscMax = Highest(VIMAOsc, Length2);
VIMAOscMin = Lowest(VIMAOsc, Length2);
VIMAOscNorm = (VIMAOsc - VIMAOscMin) / (VIMAOscMax - VIMAOscMin);
VIMALength = ShortestVIMALength + Round(VIMAOscNorm * VIMALengthRange, 0);





Type : Indicator, Name : VIMA

inputs:
MaxLength1( 3 ),
Length2( 20 ),
ShortestVIMALength( 3 ),
LongestVIMALength( 6 );

variables:
CurrentVIMALength( 0 );

CurrentVIMALength = VIMALength( MaxLength1, Length2,
ShortestVIMALength, LongestVIMALength);

Plot1(Average(Close, CurrentVIMALength));






--Ramesh Dhingra, Product Manager, EasyLanguage
TradeStation Technologies, Inc.
(formerly Omega Research, Inc.)

A wholly owned subsidiary of TradeStation Group, Inc.
http://www.TradeStation.com

 

 



Code:


Type : Function, Name : VIMALength

inputs:
MaxLength1(numericsimple),
{"interval" will vary from 2 days to (MaxLength1 + 1)
days; equivalently, Length1 below will vary from 1 day to MaxLength1 days}

Length2(numericsimple),
{number of historical RESULTS to consider for each max/min calculation;
actual number of historical data points used may be more than this}

ShortestVIMALength(numericsimple),
LongestVIMALength(numericsimple);

variables:
VIMAOsc( 0 ),
Length1( 0 ),
MaxDiff( 0 ),
MinDiff( 0 ),
NormDiff( 0 ),
VIMAOscMax( 0 ),
VIMAOscMin( 0 ),
VIMAOscNorm( 0 ),
VIMALengthRange(LongestVIMALength - ShortestVIMALength);

VIMAOsc = 0;
for Length1 = 1 to MaxLength1
begin
MaxDiff = Highest(Close - Close[Length1], Length2);
MinDiff = Lowest(Close - Close[Length1], Length2);
NormDiff = (Close - Close[Length1] - MinDiff) / (MaxDiff - MinDiff);
VIMAOsc = VIMAOsc + NormDiff;
end;

VIMAOscMax = Highest(VIMAOsc, Length2);
VIMAOscMin = Lowest(VIMAOsc, Length2);
VIMAOscNorm = (VIMAOsc - VIMAOscMin) / (VIMAOscMax - VIMAOscMin);
VIMALength = ShortestVIMALength + Round(VIMAOscNorm * VIMALengthRange, 0);





Type : Indicator, Name : VIMA

inputs:
MaxLength1( 3 ),
Length2( 20 ),
ShortestVIMALength( 3 ),
LongestVIMALength( 6 );

variables:
CurrentVIMALength( 0 );

CurrentVIMALength = VIMALength( MaxLength1, Length2,
ShortestVIMALength, LongestVIMALength);

Plot1(Average(Close, CurrentVIMALength));


 






Author: R.G. Boomer
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

Finite Volume Element (FVE)
Time and Money Indicators
Pivot Point Levels
Cosine IFM
Relative Vigor Index
Dunn's Noisetest
NLR Indicator
Weekly Hi-Lo Lines
Hilbert Transform
Tether 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