Wednesday 20 June 2012

the 22 Candlestick relational formulae


And for interest, following are the 22 definitive relational options for Candlesticks

xxx is the current period, yyy is the previous period, aaa is open price and bbb is the close price (specifically for the relational formulae for 2 periods both of which have the close greater than the open, aaa and bbb will be different for the other combinations of close and open price)

Each statement is taken separately and is period mutually exclusive, so as an example the first statement 'and xxx.f_low>= yyy.f_high' means 'if todays low is greater than or equal to yesterdays high' - with this statement one does not need to go any further because if this is true then we already know all the other relational relationships, ie that today's close, open and high will also be greater than or equal to yesterday's high

Below is also a screen shot of the logic by which one can get to the formulae, and should help to make some sense of the formulae

-=-=-=-=-=-=-=-=-=

and xxx.f_low >= yyy.f_high

and xxx.f_low < yyy.f_high and xxx.f_high < yyy.f_low

and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa < yyy.bbb and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa < yyy.bbb and xxx.bbb < yyy.bbb

and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa >= yyy.f_low and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa >= yyy.f_low and xxx.bbb < yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa < yyy.f_low and xxx.bbb >= yyy.f_low and xxx.bbb >= yyy.aaa and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa < yyy.f_low and xxx.bbb >= yyy.f_low and xxx.bbb >= yyy.aaa and xxx.bbb < yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa < yyy.f_low and xxx.bbb >= yyy.f_low and xxx.bbb < yyy.aaa
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low < yyy.f_low and xxx.aaa < yyy.aaa and xxx.aaa < yyy.f_low and xxx.bbb < yyy.f_low

and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.aaa and xxx.aaa >= yyy.aaa and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.aaa and xxx.aaa >= yyy.aaa and xxx.bbb < yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.aaa and xxx.aaa < yyy.aaa and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.aaa and xxx.aaa < yyy.aaa and xxx.bbb < yyy.bbb

and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa < yyy.bbb and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa >= yyy.aaa and xxx.aaa < yyy.bbb and xxx.bbb < yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa < yyy.aaa and xxx.bbb >= yyy.aaa and xxx.bbb >= yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa < yyy.aaa and xxx.bbb >= yyy.aaa and xxx.bbb < yyy.bbb
and xxx.f_low < yyy.f_high and xxx.f_high >= yyy.f_low and xxx.f_low >= yyy.f_low and xxx.aaa < yyy.aaa and xxx.bbb < yyy.aaa

-=-=-=-=-=-=-=-



So what can we do with these ?

We have xxx and yyy because we have 3 periods to combine in the relational process, today, yesterday and the day before yesterday - that is for the relationship between today and yesterday xxx and yyy will be today and yesterday, and the relationship between yesterday and the day before, xxx and yyy will be yesterday and the day before - aaa and bbb are the dependent on if close is higher than open, but are either open or close prices.

What we can say is that for today and yesterday we can take the first statement and calculate the success coefficient (how well it conforms to wealth increase) and then we can combine with all of these same statements for the periods 'yesterday and the day before', again to give separate success coefficients, and then run the statements with the highest success coefficients on a daily basis, if triggered then tweet and /or combine with the current traces for further analysis

The statements are also designed around database sql statements and so plug directly into the Candlestick trace engine and hence the 'and' at the start of each sentence

This is purely for the relational aspect of Candlesticks, we also need to add the intra period and trend formulae on top of this

No comments:

Post a Comment