|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
| Special offer: buy MetaStock (try for free) | Reuters QuoteCenter Real-Time Data (get a free month) | EOD Data |
|
This month in Traders' Tips we take a look at stochastics as defined in this issue's article "Stochastics" by Stuart Evens. The calculation of the %K line, as defined in the article, is identical to the way in which it is calculated in EasyLanguage. The %D line, though, differs slightly. With this in mind, I have presented the calculation for the %K and %D, using both the regular and slow calculations. In addition, I have included two EasyLanguage indicators, one that plots the regular version of the pair and one that plots the slow version of the pair. We begin by creating functions for each of the %K and %D calculations. Obviously, the calculations are not very complex, but I still chose to create them as user functions. The reason for creating them as functions is that it provides the versatility of using these calculations in any of my own custom studies without having to recreate the calculations each time. The EasyLanguage for each of the four functions is as follows: Type: Function, Name: StochKreg Input: Length(Numeric); Variables: HH(0), LL(0); HH = Highest(High, Length); LL = Lowest(Low, Length); StochKreg = 100 * ((Close - LL) / (HH - LL)); Type: Function, Name: StochDreg Inputs: Length(Numeric), SlowPeriod(Numeric); Variables: HH(0), LL(0); HH = Highest(High, Length); LL = Lowest(Low, Length); StochDreg = 100 * (Summation(Close - LL, SlowPeriod) / Summation(HH - LL, SlowPeriod)); Type: Function, Name: StochKslow Inputs: Length(Numeric), SlowPeriod(Numeric); StochKSlow = StochDreg(Length, SlowPeriod); Type: Function, Name: StochDslow Input: Length(Numeric), SlowPeriod(Numeric); StochDSlow = Average(StochDreg(Length, SlowPeriod), SlowPeriod); The indicators for creating the regular stochastic lines and the slow stochastic lines would be written in the PowerEditor using the EasyLanguage as follows: Type: Indicator, Name: Stoch - Reg Inputs: Length(5), SlowLen(3); Plot1(StochKreg(Length), "%K-reg"); Plot2(StochDreg(Length, SlowLen), "%D-reg"); Type: Indicator, Name: Stoch - Slow Inputs: Length(5), SlowLen(3); Plot1(StochKSlow(Length, SlowLen), "%K-Slow"); Plot2(StochDSlow(Length, SlowLen), "%D-Slow"); The indicators above appear best when they are scaled to "User Defined -- Maximum = 100 and Minimum = 0." This EasyLanguage code is also available from Omega Research's Website. The name of the file is STOCH.ELS. Note that all Traders' Tips posted at the Omega Research Website can be utilized by both TradeStation and SuperCharts. When possible, the posted analysis techniques will include both QuickEditor and PowerEditor formats. -- Gaston Sanchez, Omega Research Inc. 800 422-8587, 305 270-1095 Internet: http://www.omegaresearch.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. |
||
|
||
|