How can candlestick formula be changed?
Author: bundasse
Creation Date: 4/4/2009 10:18 AM
profile picture

bundasse

#1
Hi
I don't like the candlestick script on the library... do you know where i can find the script and above all change it ?

if it is not possible, how to make my own candlestick and use it on my strategy ? make a kind of fonction...

for example my shooting star is :

[open-close < 1/3*(high-low) or close-open < 1/3*(high-low)] and [close=low or close=low+1tick or open=low or open=low+1 tick]

thx a lot

PS : on the library, the opening of the shooting star has to open on gap compare the previous candlestick... that's not my idea of a shooting star...
profile picture

Eugene

#2
QUOTE:
on the library, the opening of the shooting star has to open on gap compare the previous candlestick

Actually, it requires the low of the current bar to be higher than the previous bar's close. I would say that Steve Nison probably haven't made that condition a Shooting Star prerequisite in his book, but other different sources really do:

trending123.com
hotcandlestick.com

Changing the candlestick rules library is not an option because the code is compiled, but certainly you can roll your own re-usable function according to your definition. However, the current one only has a single bar in mind whereas the shooting star formula compares today's bar with yesterday's:
QUOTE:
[open-close < 1/3*(high-low) or close-open < 1/3*(high-low)] and [close=low or close=low+1tick or open=low or open=low+1 tick]
profile picture

bundasse

#3
thx eugene,

i don't want to compare the previous bar chart for my candlestick definition,

can you tell me what i have to write on the code to roll my own re-usable function ?

thx a lot
profile picture

Eugene

#4
QUOTE:
i don't want to compare the previous bar chart for my candlestick definition,

Then your formula will catch many wrong candlesticks e.g. white body candles without tails. See below.
CODE:
Please log in to see this code.

QUOTE:
can you tell me what i have to write on the code to roll my own re-usable function ?

Sure, please read this first:
How do I start with C# ?
profile picture

bundasse

#5
CODE:
Please log in to see this code.



I have this script and watch the result, sometime it give me my candle, and sometime not, watch the picture below, can you help me ?


profile picture

Eugene

#6
Well, this looks like the lower part of the equation fails double equality test. Use any one of the codes below:
CODE:
Please log in to see this code.

CODE:
Please log in to see this code.
profile picture

bundasse

#7
that's work... thx a lot Eugene
profile picture

Eugene

#8
You're welcome.
profile picture

bundasse

#9
hi, i changed low by high to get a hammer (my style) and it doesn't work... strange... i used the first script and that works for the shooting star...

CODE:
Please log in to see this code.


profile picture

Eugene

#10
What's bad about the built-in bullish Hammer function that does the same job?
CODE:
Please log in to see this code.
profile picture

bundasse

#11
i don't like the hammer on the library like the shooting, i prefer to male my own...
profile picture

bundasse

#12
for me a hammer can have 1 tick above the body of the candlestick... and on your library not...

profile picture

Eugene

#13
QUOTE:
and it doesn't work... strange

After reviewing the code, there's nothing strange: that just can't happen -
CODE:
Please log in to see this code.

Neither Close nor Open can't be equal to High+1 tick.

Here's the amended code:
CODE:
Please log in to see this code.
profile picture

Cone

#14
By reviewing the code from Version 4 Candlesticks, you can see the precise rules used. In the case of the Bullish Hammer:

CODE:
Please log in to see this code.


It's hard to tell the condition that failed using just the picture, but I'd guess the Open was slightly more than 30% from the high. Of course you can generate your own pattern code, but the point is that number has to be defined to be something and it's likely that eventually you'll find a candle that "looks" like it fits the pattern doesn't exactly match the pattern you defined programmatically.
profile picture

bundasse

#15
i'm an idiot... this high-tick and not high + tick !!!

sorry
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).