DD – Daily Doji

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • #127130

    The idea comes from Andreas Unger on Better system trader episode 45. He talks about his trend-systems, he likes to check the previous daily candle, if its body is above or below 50% of the high-low range.

     

    Im testing it on my trend systems and the results are very interesting. Bodyp = 0.5 (or another % if you feel like optimizing/testing it.)

     

    When i test them in my systems i use the following code:

    Im seeing some very interesting results from using this on my 1h systems. You can optimize the % of the body and you can check for = 0 as well as  = 1.

    Edit: Am i doing something wrong using dopen(0) etc, then calling it with [1]? or will it work as its suppose to?

    3 users thanked author for this post.
    #127186

    It’s always interesting to see how different people code the same thing! This is how I would code it:

    When you CALL an indicator it just applies the result to each candle that it is called on so it is perfectly normal to use [1] to find out what the called result was for the previous candle.

     

    1 user thanked author for this post.
    #127198

    I always like to try to analyse things that someone says gives an edge so here I have two indicators that will check through history on the daily chart and see what happened the next day whenever a doji type candle appeared.

    The first one just records whether the next candle was a green or a red one after a low doji or a green or a red one after a high doji and the second one records whether there was a break of the doji high or a break of the doji low on the next candle for both high and low doji types.

    Both indicators also calculate a datum so we can directly compare to the market norm.

    So it would seem that on the EURUSD a high doji day has been followed by a green day 55% of the time rather than a red day just 44% of the time – and is 70% likely to see a break of the doji high compared to only 30% a break of the low.

    A low doji day has been followed by a red candle 55% of the time and by a green 44% of the time and the doji high has been broken only 30% of the time but the low broken 70% of the time.

    The norm for any candle is 50% of the time the next candle is green and 49% it is red with 1% of candles having no change in value. 47% of candles are normally followed by a break of the high and 47% a break of the low. 14% of candles neither break the high or the low.

    (All %’s have been rounded in this example)

    So there might be an edge to looking for dojis on the EURUSD at least.

     

    2 users thanked author for this post.
    #127210

    Here is a third version that analyses after each doji whether the close was above the doji high or below the doji low or an inside close.

    On the EURUSD it seems that the normal datum is that 50% of candles close inside and 25% close above and 25% close below the previous candle.

    If we look at just high dojis then 45% close inside and 40% close above the doji high and just 15% close below the doji  low the next day.

    For low dojis then 43% close inside and 16% close above the doji high and 40% close below the doji low.

     

    3 users thanked author for this post.
    #127226

    @Vonasi thanks for the tools! Very interesting findings:

    “So it would seem that on the EURUSD a high doji day has been followed by a green day 55% of the time rather than a red day just 44% of the time – and is 70% likely to see a break of the doji high compared to only 30% a break of the low.

    A low doji day has been followed by a red candle 55% of the time and by a green 44% of the time and the doji high has been broken only 30% of the time but the low broken 70% of the time.”

     

    Ungar uses this as a filter for his trend/swing systems, so expecting a green day that exceeds the doji-high the next day would make sense that there is actually an edge (if not he must be lying lol)

    Big thanks for the good work 🙂

     

    Edit: This is why sharing is caring on the forum, one guys reads something in a book, another guy takes the idea and runs with it 🙂

    1 user thanked author for this post.
    #127251

    I ran a bit further with it.

    I decided to try to rate each doji by how close the open and close were to the extreme of the candle – so for a high doji the closer both the open and close are to the candle high the higher that doji scored and the opposite for low dojis so the closer both the open and close are to the candle low the higher the score. The scores are between zero and 100.

    Then thanks to v11 arrays I was able to split the results up into 80 buckets – so high dojis that were followed by a green candle and that scored 0 to 5 then >5 and <=10 then >10 and <=15 and so on – and the same for if a red candle followed and also the same for low dojis.

    I then plotted the results in four charts and put the green and red datum values across them all to see if the score of a doji effects the likely hood of the next candle being a red or green one.

    The numbers above the lines are the number of low dojis or high dojis with that score that were tested . The lines are scaled 0 to 100% on the y axis.

    The results on the EURUSD were a little inconclusive and this is perhaps to the limited amount of data in each bucket. Perhaps in hind sight bigger buckets would have been better. However I have drawn arrows on the second image showing what looks like the general trend for each chart and it would seem that the higher a doji scores the more likely the next candle is to continue in the same direction – that is up for high dojis and down for low dojis.

     

    1 user thanked author for this post.
    #127254

    Sometimes we have to take a step back and look at the bigger picture.

    The attached image is an equity curve of a strategy on the EURUSD that simple goes long on a high doji and short on a low doji and then exits the next day.

    We can clearly see that up to the beginning of 1993 the strategy worked very well indeed but since then the edge disappeared. I think we can blame all those pesky computers that people started trading with again. It seems that dojis are perhaps no longer a trading edge.

    2 users thanked author for this post.
    #127266

    Holy shit that strategy…. Lol…

     

    And another big thx to you Vonasi.

    #127279

    It is like someone just threw a switch at the start of 1993 and the doji edge just totally disappeared!

    It’s lucky I shared these codes here as my laptop just crash closed for some strange reason – perhaps because it is a rather warm day here in Greece and I haven’t got round to fitting the new cooling fan I bought for it yet! If I hadn’t shared them then they would have all been lost because I hadn’t hit CTRL+S yet today or exported them yet.

    #127281

    So I decided to run the same tests but exclude pre 1993 data. The results are very different.

    The doji seems to have no effect on the colour of the following candle.

     

    However when we compare to the high break and low break datums there is perhaps still something to see:

    The datum is that 48% of all candles are followed by a break of the high and 48% a break of the low

    After a high doji 70% of candles break the high and only break the low 33% of the time.

    After a low doji 68% of candles break the low and only break the high 34% of the time.

     

    When we study if the next candle closes above the doji high or below the doji low we can also see something:

    The datum is that 51% of candles close inside and 24% close above and 24% close below.

    After a high doji 35% close above and only 15% close below.

    After a low doji 34% close below and 19% close above.

    1 user thanked author for this post.
    #127448

    Here is another doji tester. This one splits the data down into high green dojis, high red dojis, low green dojis and low red dojis so we can see if the coulour of the doji has any influence on what happens next.

    It would appear that on the EURUSD daily since the beginning of 1993 green dojis whether high or low dojis are ever so slightly more often followed by red candles and red dojis whether high or low dojis are ever so slightly more often followed by green candles. It might be a 1 or 2% edge!

     

    #127509

    I got bored and so added even more doji analysis to the indicator. Now it analyses all types of doji, high, low, green ones and red ones and every combination of them. It also creates equity curves for if you had traded each type and then closed one candle later for both long and short directions.

    You can set a start date and also subtract a spread value from each trade if you want.

    I find the easiest way to view the equity curves is to make the one you want to see a thicker line in the indicator configure window so that it stands out.

     

    2 users thanked author for this post.
Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login