|
|||||||||||||||||||
|
|||||||||||||||||||
| Special offer: buy MetaStock (try for free) | Reuters QuoteCenter Real-Time Data (get a free month) | EOD Data |
|
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:
all formulas for TradeStation all formulas
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
|
|