log in     sign up for free
 
Show me the charts, and I'll tell you the news. Have an opinion on what the market should do but don't decide what the market will do. Be happy with a percentage of the move.
Bernard Baruch
 
 
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

Moving Averages with Resistance and Support

Formula for: TradeStation

indicator


 

 

Views:  1726

Added: June 24, 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
The focus of this month's Traders' Tips is the combination of a simple moving average with support and resistance, as presented by Dennis Tilley in his article "Moving averages with resistance and support." I have integrated this very interesting concept into both an indicator and a system for TradeStation or SuperCharts. Notice that the EasyLanguage codes for the indicator and the system are very similar.
We'll begin with the indicator, named "Mov avg--supp/res." The indicator has three inputs. "Price" and "length" are parameters for the basis of the moving average. "F" is the critical percentage, and should be entered as the percent value (8 = 8%). The plots for the indicator are as follows: the simple moving average line; points representing the support levels; and points representing the resistance levels. In order for the plots to appear correctly, the style for the indicator must be properly set (formatting information will follow the EasyLanguage code for the indicator).


Style:
Plot Name Type Color Weight
Plot1 SMA Line Blue thinnest
Plot2 R Point Magenta medium
Plot3 S Point Cyan medium
Scaling: Same as Price Data
Properties: Enable Alert

This code is available at Omega Research's Web site. The file name is "MA_SR.ELA." Please note that all the Traders' Tips analysis techniques that are posted at the Omega Research Web site can be utilized by both TradeStation and SuperCharts. Whenever possible, the posted analysis techniques will include both Quick Editor and Power Editor formats.

--Gaston Sanchez, Omega Research

800 422-8587, 305 270-1095
Internet: http://www.OmegaResearch.com

 

 



Code:

Type: Indicator, Name: Mov Avg--Supp/Res
Inputs: Price(Close), Length(10), F(8);
Vars: AvgVal(0), S(0), R(0), SC(0), RC(0);

AvgVal = Average(Price, Length);
RC = RC + 1;
SC = SC + 1;

IF Close Crosses Below AvgVal AND Close > S* (1+(F/100)) AND R <> 0 Then Begin
For value1 = RC-2 TO RC+2 Begin
Plot2[value1](R, "R");
End;
Alert = True;
S = L;
SC = 0;
End
Else Begin
IF Close Crosses Below S AND R <> 0 Then Begin
For value1 = RC-2 TO RC+2 Begin
Plot2[value1](R, "R");
End;
Alert = True;
S = L;
SC = 0;
End;
End;

IF Close Crosses Above AvgVal AND Close < R / (1+(F/100)) AND S <> 0 Then Begin
For value1 = SC-2 TO SC+2 Begin
Plot3[value1](S, "S");
End;
Alert = True;
R = H;
RC = 0;
End
Else Begin
IF Close Crosses Above R AND S <> 0 Then Begin
For value1 = SC-2 TO SC+2 Begin
Plot3[value1](S, "S");
End;
Alert = True;
R = H;
RC = 0;
End;
End;

IF Close > AvgVal Then Begin
IF High >= R Then Begin
R = High;
RC = 0;
End;
End;

IF Close < AvgVal Then Begin
IF Low <= S OR S = -1 Then Begin
S = Low;
SC = 0;
End;
End;

Plot1(AvgVal, "SMA");


 






Author: Dennis Tilley
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

Moving Average Adjuster
Nonlinear Ehlers Filter
RAVI II
Color on MACD Histogram II
Donchian Channel
R - Squared
Keltner Price
Phase Calculation
SaittaTrend
Trades After the Fact
...
 
 
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