Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 12-03-2009, 04:22 AM   #1

Join Date: Oct 2009
Location: london
Posts: 52
Ignore this user

Thanks: 2
Thanked 8 Times in 4 Posts

Candlestick Coding

I have fairly simple question (at least i think it is for anyone who codes). I'd like the following indicator to plot the text of the type of candlestick rather than dots.

Below is from MC and this indicates doji. Looking to have the text display above/below the bar, thanks.

inputs: Percent( 5 ) ;

if C_Doji( Percent ) = 1 then
begin
Plot1( Close, "Doji" ) ;
Alert( "Doji" ) ;
end ;
lonew0lf is offline  
Reply With Quote
Old 12-03-2009, 06:05 AM   #2

Join Date: Oct 2009
Location: Allentown
Posts: 5
Ignore this user

Thanks: 4
Thanked 0 Times in 0 Posts

Re: Candlestick Coding

Huh?????????????????????? ??????????????????
jrcentaur59 is offline  
Reply With Quote
Old 12-03-2009, 10:49 AM   #3

sep34's Avatar

Join Date: Dec 2008
Location: USA
Posts: 109
Ignore this user

Thanks: 17
Thanked 58 Times in 34 Posts

Re: Candlestick Coding

Quote:
Originally Posted by lonew0lf »
I have fairly simple question (at least i think it is for anyone who codes). I'd like the following indicator to plot the text of the type of candlestick rather than dots.

Below is from MC and this indicates doji. Looking to have the text display above/below the bar, thanks.

inputs: Percent( 5 ) ;

if C_Doji( Percent ) = 1 then
begin
Plot1( Close, "Doji" ) ;
Alert( "Doji" ) ;
end ;


This is how its done in TS, it should work in MC too.



//-------------------------------------------------------------------------------------------------------------------
Input: My_TEXT ("Doji");
Input: Txt_below_bar (2);
Input: Long_Clr (magenta);
Input: Horizdown (3);
Input: Vertdown (2);
inputs: Percent( 5 ) ;

variables:Text_ID2(0),one tick(0);

onetick = minmove/pricescale;


if C_Doji( Percent ) = 1 then
begin


Text_ID2 = Text_New( Date, Time, low-Txt_below_bar*onetick, My_TEXT );
text_setcolor( Text_ID2,long_clr) ;
Text_SetStyle(Text_ID2, horizdown, vertdown);
end;
//--------------------------------------------------------------------------------------------------------------------
sep34 is offline  
Reply With Quote
Old 12-04-2009, 01:51 AM   #4

Join Date: Oct 2009
Location: london
Posts: 52
Ignore this user

Thanks: 2
Thanked 8 Times in 4 Posts

Re: Candlestick Coding

Sep34,

thanks for the reply. This looks to be what i'm trying to accomplish; however, when I compile I get the below error, any thoughts?

"assignment is allowed only for variables or array elements"

Input: My_TEXT ("Doji");
Input: Txt_below_bar (2);
Input: Long_Clr (magenta);
Input: Horizdown (3);
Input: Vertdown (2);

inputs: Percent( 5 ) ;

onetick = minmove/pricescale;

if C_Doji( Percent ) = 1 then begin

Text_ID2 = Text_New( Date, Time, low-Txt_below_bar*onetick, My_TEXT );
text_setcolor( Text_ID2,long_clr) ;
Text_SetStyle(Text_ID2, horizdown, vertdown);
end;
lonew0lf is offline  
Reply With Quote
Old 12-04-2009, 01:57 AM   #5

Join Date: Nov 2006
Location: N/A
Posts: 612
Ignore this user

Thanks: 62
Thanked 294 Times in 177 Posts

Re: Candlestick Coding

Quote:
Originally Posted by lonew0lf »
Sep34,

thanks for the reply. This looks to be what i'm trying to accomplish; however, when I compile I get the below error, any thoughts?

"assignment is allowed only for variables or array elements"
In the post from sep34, replace this line:

Code:
variables:Text_ID2(0),one tick(0);
with this one:

Code:
variables:Text_ID2(0),onetick(0);
When copy and pasting code, it should be encapsulated with code tags (the # sign in the menu do that), otherwise formatting gets lost.
sevensa is offline  
Reply With Quote
Old 12-04-2009, 02:01 AM   #6

Join Date: Nov 2006
Location: N/A
Posts: 612
Ignore this user

Thanks: 62
Thanked 294 Times in 177 Posts

Re: Candlestick Coding

Quote:
Originally Posted by jrcentaur59 »
Huh?????????????????????? ??????????????????
Did you get confused and thought you were on ET?
sevensa is offline  
Reply With Quote
Old 12-04-2009, 02:34 AM   #7

Join Date: Oct 2009
Location: london
Posts: 52
Ignore this user

Thanks: 2
Thanked 8 Times in 4 Posts

Re: Candlestick Coding

Sep34 & Sevensa:

Many thanks, it now works the way I had hoped.

In applying these variables (and learning easy language/power language), is it possible to use the same inputs for other candlestick patters, for example bullish/bearish engulfing, etc... or are the parameters for the doji unique?
lonew0lf is offline  
Reply With Quote
Old 12-04-2009, 07:10 AM   #8

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Candlestick Coding

TradeStation EasyLanguage Code these functions might help. I am sure you can find more on the interwebz.

Candlestick detection is an ideal starter project to learn some easy language as it simply compares O,H,L & C's. Whether it is useful to trade with these patterns rather than reading the sentiment behind them depends on your objectives I guess.

Edit: Its up to you what are suitable parameters for the indicators. I might require that a hanging man has 3 times the wick to the body tou might want 2.5. Easy language will simply detect what you tell it to.
BlowFish is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Do Candlestick Patterns Work? TraderBG The Candlestick Corner 9 10-16-2008 06:53 PM
Why Candlestick Anaylsis is Different and Might Work for You brownsfan019 The Candlestick Corner 18 04-10-2008 12:58 PM
Intraday Candlestick Trading brownsfan019 The Candlestick Corner 53 12-19-2007 08:23 AM
Daily Candlestick Triggers MrPaul Technical Analysis 36 03-29-2007 11:50 AM

All times are GMT -4. The time now is 09:13 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.