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

Reply
Old 12-04-2009, 02:39 PM   #9

sep34's Avatar

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

Thanks: 17
Thanked 57 Times in 34 Posts



Re: Candlestick Coding

Quote:
Originally Posted by lonew0lf »
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?
Lonewolf,

If I understand you correctly then yes,

you can use the same code above and below the code for the doji, in concert with another code that describes another candle pattern and just name them engulfing or what ever via an input. In the past I have coded apprx 30+ candle patterns and use the same text code and inputs (inputs/variables related to plotting the text)that I posted above.


By the way,...Im sure you are already aware of this, just in case, the definitions for candlesstick pattern in TS Indicator Library or most books e.g. Nison are very....hmm how to say this....lets just say that they are very humble and thats being kind, an introduction at most.
sep34 is offline  
Reply With Quote
Old 12-04-2009, 02:56 PM   #10

sep34's Avatar

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

Thanks: 17
Thanked 57 Times in 34 Posts



Re: Candlestick Coding

Quote:
Originally Posted by BlowFish »

Candlestick detection is an ideal starter project to learn some easy language as it simply compares O,H,L & C's.
Agree, infact thats how I learned what little EL I know, however I have several CandleStick patterns that fill up two pages of code, on the other hand, If I knew how to use loops at the time of coding it would have reduce the length of the could to somthing much smaller.
sep34 is offline  
Reply With Quote
Old 12-04-2009, 03:15 PM   #11

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

Thanks: 4
Thanked 0 Times in 0 Posts



Re: Candlestick Coding

Hey Sevensa, Confused and on ET? No. Well I do like to entertain. I do know all about candlestick formations like tweezer bottom and tops. evening stars and morning. What I dont understand is what they mean by codes and =1 and all that.
jrcentaur59 is offline  
Reply With Quote
Old 12-05-2009, 07:13 AM   #12

BlowFish's Avatar

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

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Candlestick Coding

The way I would do it if I was starting from scratch is define a bunch of booleans at the start, for example OpenEqualsClose LongTail CloseHigh HighTailTwiceBody etc etc you get the idea

I would then have a case statement with the appropriate combination of the booleans so for example OpenNearClose and CloseHigh and LowTailTwiceBody .......then do hammer code or set hammer boolean for later printing.

Makes things very easy extensible.
BlowFish is offline  
Reply With Quote
Old 12-05-2009, 12:42 PM   #13

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 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 ;

like this?


73.57


http://www.traderslaboratory.com/for...tern-5736.html
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...
Tams is offline  
Reply With Quote
Old 12-08-2009, 09:54 AM   #14

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

Thanks: 2
Thanked 8 Times in 4 Posts



Re: Candlestick Coding

Sep34,

I was able to add the text for the remainder of the candlestick indicators but now curious how I would go about painting the bar a different colour so its easier to view. Below is the code you and sevensa helped with:

Input: My_TEXT ("Doji");
Input: Txt_below_bar (15);
Input: Long_Clr (white);
Input: Horizdown (3);
Input: Vertdown (2);
inputs: Percent (5);

variables: Text_ID2(0),
onetick(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;
lonew0lf is offline  
Reply With Quote
Old 12-08-2009, 12:40 PM   #15

sep34's Avatar

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

Thanks: 17
Thanked 57 Times in 34 Posts



Re: Candlestick Coding

Quote:
Originally Posted by lonew0lf »
Sep34,

I was able to add the text for the remainder of the candlestick indicators but now curious how I would go about painting the bar a different colour so its easier to view. Below is the code you and sevensa helped with:

Input: My_TEXT ("Doji");
Input: Txt_below_bar (15);
Input: Long_Clr (white);
Input: Horizdown (3);
Input: Vertdown (2);
inputs: Percent (5);

variables: Text_ID2(0),
onetick(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;
Lonwolf,
Usually if you want to paint the bar it self then a Paintbar study/format is used.
You can take a look at existing paintbar studies to get an idea.
That said... you can use, for example, a showme to place a market on the bar it self...You would just need to specify which part of the bar to place the marker.

Below is a your doji code in paintabr study....I bracketed the codes related to the text plots because you dont need it for the paint bar.

Code:
//Input: My_TEXT ("Doji"); 
//Input: Txt_below_bar (15); 
//Input: Long_Clr (white); 
//Input: Horizdown (3); 
//Input: Vertdown (2); 
inputs: Percent (5);

//variables: Text_ID2(0),onetick(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;}
	PlotPaintBar( High,Low ) ;
	Alert ;
	end
	else
	NoPlot( 1 ) ; { remove the marker }
sep34 is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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

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