Skip to content

entries/exits based on candlestick recognition

2 messages · Dmitry Kishkinev, Ilya Kipnis

#
Dear all R-SIG readers

I am learning Quantstrat now and wonder if anybody could point out examples
where entries/exits were based on Japanese candlesticks' patterns.

For example, I would like to back-test intraday momentum strategy when
there was a large gap (previous day Close to given day Open) and during the
first three 5-min candlesticks there were at least 2 candlesticks showing
strong momentum. Say we have gap up and at least 2 candlesticks were
Marubozu (Close = High) and/or Large White candlestick (Open-Close >= 66%
of High-Low). One could imagine that such a strong momentum observed at day
opening could hold for some time and one may try to 'ride on a hype' in the
gap direction.

One more thing I would like to implement in this back-testing is, once
entered say long, I would like to apply a sophisticated stop trailing order
which starts at a predefined risk (say, 1% of my Equity) and then it should
follows the price based on the last 5-min candlestick. When it was again
Marubozu and/or Large White candlestick I replace stop trailing order price
with the one at the last candlestick Low and so on until the order is
executed or I close before the day ends.

Any snippets/examples related to the ideas mentioned?

My rough idea I that I could introduce add.indicator and classify each
5-min candlestick and that then will be used for add.rule? Sorry, I am very
new in Quantstrat.

Thanks you so much in advance.

Best regards

Dmitry Kishkinev
#
I believe there is an R package called candlesticks. Use that. Then, your
candlesticks are merely indicators which are merely R functions.

On Mon, Apr 4, 2016 at 9:16 AM, Dmitry Kishkinev <dmitry.kishkinev at gmail.com