| |
 |
Views:
1536 |
| Added: August 06, 2008 |
| |
| |
|
| This formula has not been rated yet |
|
|
| |
email this link
|
| |
| |
| Tags:
TradeStation, indicator
|
| |
 |
The EasyLanguage code presented here reproduces the time and money charts described in Stuart Belknap's May 2003 article in STOCKS & COMMODITIES.
The time and money chart displays a simple moving average and six volatility bands around price, as defined in the article. Since TradeStation can show a maximum of four plots in a single indicator, we broke the code into two pieces: a ChanLinesHi indicator and a ChanLinesLo indicator.
Also displayed is the code for Belknap's volatility index as discussed in the article, and finally, the stochastic momentum indicator.
The code will also be available for download from the EasyLanguage Exchange on TradestationWorld.com at https://www.tradestationworld.com/discussions/default.asp?Group=8.
--Ian MacAuslan
EasyLanguage Specialist , TradeStation Securities, Inc.
A subsidiary of TradeStation Group, Inc. www.TradeStationWorld.com
Code:
Type : Indicator, Name : T&M - Volatility Indicator
{ "T&M - Volatility Indicator"
from "Time and Money Charts" by Stuart Belknap }
inputs:
Period( 25 ) ;
variables:
yom( 0 ),
avyom( 0 ),
varyyom( 0 ),
som( 0 ),
sigom( 0 ),
HalfPeriod( 0 ) ;
HalfPeriod = Period /2 ;
yom = 100 * (Close - Average( Close, Period ) /
Average( Close, Period ) );
avyom = Average( yom, 50 ) ;
varyyom = Average( yom*yom, 50 ) - ( avyom*avyom ) ;
som = squareroot( varyyom[ -HalfPeriod ] ) ;
sigom = Average( som, Period ) ;
plot1( sigom, "som" ) ;
Type : Indicator, Name : T&M - Stochastic Momentum Indicator
{ "T&M ? Stochastic Momentum Indicator"
from "Time and Money Charts" by Stuart Belknap }
inputs:
Length( 12),
Smooth1( 25 ),
Smooth2( 2 ) ;
value1 = 100 * ( XAverage( XAverage( Close - (.5 *
( Highest( High, Length ) + Lowest( Low, Length ) ) ),
Smooth1), Smooth2) /
(.5 * XAverage( XAverage( Highest( High, Length )-
Lowest( Low, Length ), Smooth1 ), Smooth2 ) ) ) ;
plot1( value1, "StochMom") ;
plot2( Average( value1, Smooth1 ), "SM Avg" ) ;
plot3( 50, "+50" ) ;
plot4( -50, "-50" ) ;
Type : Indicator, Name : T&M - ChanLinesHi Indicator
{ "T&M - ChanLinesHi Indicator" from "Time and Money Charts" by Stuart Belknap
Plots the minor term average and the three upper channel lines }
inputs:
Period( 25 ) ;
variables:
Arm( 0 ),
Level1( 0 ),
Level2( 0 ),
Level3( 0 ) ;
Arm = Average( C, Period ) ;
Level1 = (1 + (1.0 * 5/100 ) ) * Arm ;
Level2 = (1 + (2.0 * 5/100 ) ) * Arm ;
Level3 = (1 + (3.0 * 5/100 ) ) * Arm ;
plot1( Level1, "+L1" ) ;
plot2( Level2, "+L2" ) ;
plot3( Level3, "+L3" ) ;
plot4( Arm, "Arm" ) ;
Type : Indicator, Name : T&M - ChanLinesLo Indicator
{ "T&M - ChanLinesLo" Indicator" from "Time and Money Charts" by Stuart Belknap
Plots the minor term average and the three lower channel lines }
inputs:
Period( 25 ) ;
variables:
Arm( 0 ),
Level1( 0 ),
Level2( 0 ),
Level3( 0 ) ;
Arm = Average( C, Period ) ;
Level1 = (1 - (1.0 * 5/100 ) ) * Arm ;
Level2 = (1 - (2.0 * 5/100 ) ) * Arm ;
Level3 = (1 - (3.0 * 5/100 ) ) * Arm ;
plot1( Level1, "-L1" ) ;
plot2( Level2, "-L2" ) ;
plot3( Level3, "-L3" ) ;
plot4( Arm, " Arm " ) ;
Author: Stuart Belknap
Source: http://www.traders.com
all formulas for TradeStation
all formulas
|