log in     sign up for free
 
In addition, you should also have some idea about how you plan to take profits and a strategy for letting your profits run.
Van K. Tharp
 
 
Home
systems (285)
 
 
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

Candle Code

Formula for: TradeStation

indicator

 

 

Views:  2163

Added: January 24, 2007
 
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
 


Here's the EasyLanguage code for a single function that generates candlestick codes as described by Viktor Likhovidov in his article this month, "Coding Candlesticks (II)." Computations for the candlestick body and upper/lower shadows, the top and bottom thresholds for each element, and the candle code itself are all included in this single function. This contrasts with the multiple- function approach originally presented in Likhovidov's November 1999 STOCKS & COMMODITIES article on coding candlesticks.

This EasyLanguage code is written without any calls to the "Iff" function to keep it simple, and the Bollinger Band length and number of deviations are surfaced as inputs to the function so that the user can experiment with different values of these parameters. A simple indicator that plots the candle code and its average is included. Any user-created analysis technique or strategy can similarly call the CandleCode function.

This EasyLanguage for both the function and indicator will be available for download at www.TradeStation.com. Look for the file "CandleCode.ELS."
-- 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:

Typ : Function, Name : CandleCode

inputs: BBLength( numericsimple ),
{ recommended value of input: 55 }
BBNumDevs( numericsimple );
{ recommended value of input: .5 }
variables: BodyHi(0),
BodyLo(0),
Body(0),
UpperShadow(0),
LowerShadow(0),
ThBot_Body(0),
ThTop_Body(0),
ThBot_US(0),
ThTop_US(0),
ThBot_LS(0),
ThTop_LS(0),
ColorCode(0),
BodyCode(0),
USCode(0),
LSCode(0);
BodyHi = MaxList(Open, Close);
BodyLo = MinList(Open, Close);
Body = BodyHi - BodyLo;
UpperShadow = High - BodyHi;
LowerShadow = BodyLo - Low;
ThBot_Body = BollingerBand(Body, BBLength, -BBNumDevs);
ThTop_Body = BollingerBand(Body, BBLength, BBNumDevs);
ThBot_US = BollingerBand(UpperShadow, BBLength, -BBNumDevs);
ThTop_US = BollingerBand(UpperShadow, BBLength, BBNumDevs);
ThBot_LS = BollingerBand(LowerShadow, BBLength, -BBNumDevs);
ThTop_LS = BollingerBand(LowerShadow, BBLength, BBNumDevs);

if Close >= Open
then begin ColorCode = 64;
if Body = 0 then BodyCode = 0 else
if Body < ThBot_Body
then BodyCode = 16 else
if Body < ThTop_Body
then BodyCode = 32 else
BodyCode = 48; end else
begin ColorCode = 0;
if Body = 0 then BodyCode = 48 else
if Body < ThBot_Body then BodyCode = 32 else
if Body < ThTop_Body then BodyCode = 16 else
BodyCode = 0; end; if UpperShadow = 0 then
USCode = 0 else if UpperShadow < ThBot_US then
USCode = 4 else if UpperShadow < ThTop_US then
USCode = 8 else USCode = 12; if
LowerShadow = 0 then LSCode = 3 else if
LowerShadow < ThBot_LS then LSCode = 2 else if
LowerShadow < ThTop_LS then LSCode = 1 else
LSCode = 0;
CandleCode = ColorCode + BodyCode + USCode + LSCode;


Typ : Indicator, Name : Candle Code

inputs: BBLength(55),

BBNumDevs(.5),
AvgLength(9);

variables:

CCode(0);
CCode = CandleCode(BBLength, BBNumDevs);

Plot1(CCode, "CCode");
Plot2(Average(CCode, AvgLength), "CCodeAvg");


 





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

 



Author: Viktor Likhovidov
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

TFS Indicators
CCI Predict
Aroon
Hilbert Channel Indicator
Color on MACD Histogram
Quarterly Pivots
ZigZag
Stochastic S&C Indicator
SMI Oscillator
Bull and Bear Balance Indicator
...
 
 
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.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009