log in     sign up for free
 
There are a lot of problems to solve with exits. If the worst case does not happen (i.e., so you don't get stopped out), then the job of your system is to allow you to make the most profit possible and give the least amount of it back. Only your exits do this!
Van K. Tharp
 
 
Home
systems (285)
 
 
Special offer: buy AmiBroker and EOD+Real-Time 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

Breakout Range2

System for: TradeStation

 

 

Views:  2460

Added: December 02, 2006
 
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, system
 


In "Catching DJIA Breakouts" in this issue, I discuss the strategy of buyingmarkets that are breaking out to new highs, and present the results ofbuying breakouts in the Dow Jones Industrial Average (DJIA).
In EasyLanguage, you can create a Boolean variable or a ShowMe studyto simply test whether the two conditions of a breakout are met. However, I thought it more useful to have the function return the numberof bars since the last time a new high was achieved. The only time a numberother than zero is returned is when it is a true breakout (the functionwill return a zero either when no new high is achieved or when a new highhas been achieved, but it has not been a breakout of look_bak length orgreater).

Note that all of the work of the breakout system went into the breakout function. This is perhaps the best way to develop your ideas: first create a function, then use the function to create indicators, ShowMe studies, and systems. If later you change the function, all the studies on whichit is based will be changed automatically, freeing you from the labor requiredto change each study.

 

 



Code:

Type : Function, Name : Breakout_Range2

{********************1/26/2000 Mark Vakkur, M.D.
if this bar is the highest bar of the last look_bak bars
AND this has not occurred in look_bak bars, returns
the number of bars, otherwise returns 0. **************}

Inputs:
price( numericseries),
look_bak(numeric);

Vars: bar_count(0),
max_price(h); {number of bars since last high}

If CurrentBar = 1
then Begin bar_count = 1;
{bar_count counts the number of bars since
a new high was made}End
Else Begin
If price > Highest(high, look_bak)[1]
{if this bar is the highest high of
the look_bak period} then Begin
if bar_count >= look_bak then Begin
Breakout_Range2=bar_count;
bar_count = 0;
End
Else {highest high but NOT since look_bak bars}
Begin bar_count = 0;
Breakout_Range2 = 0;
End;
End { of highestbar check }

Else {this isn't the highest high }
Begin bar_count = bar_count + 1;

Breakout_Range2 = 0;
End;
End;




If this seems too complicated, don't worry. Simply cut and paste the code into TradeStation and then create the following system based on this function:

Type : Signal, Name : Breakout_Range2
Input:
look_bak(4),
n_bars(4);
If Breakout_Range2(h, look_bak) <> 0 then
{this would only occur if a new high price occured after n_bars of no such new high}
Buy ;
If BarsSinceEntry >= n_bars then ExitLong;


 




 

Code to difficult? Find somebody to help you with coding here.

 



Author: Mark Vakkur
Source: http://www.traders.com

 

View similar:

Dual Time Frame Moving Average
Adaptive Moving Average System
Stochastic S&C System
DiNapoli 5
New Market Paradigm
SHARK-32 System
Stuckey 19
Kase 30
TFS System
Dynamic Zones
...
 
 
all systems for TradeStation
all systems

 

 

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.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009