Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Discussion (https://www.forexfactory.com/forumdisplay.php?f=11)
-   -   Day's first H4 candle correlation to daily candle (https://www.forexfactory.com/showthread.php?t=455379)

fffx Nov 3, 2013 11:03pm | Post# 1

Day's first H4 candle correlation to daily candle
 
Could any one with backtesting expertise please post results regarding the correlation of EUR/USD's first 4h candle of the day vs the same day's daily candle. Also the correlation between the day's first 4h candle vs the previous day's daily candle. e.g if the day's first 4h candle was green how did the daily candle end up. Similarly if the day's first 4 hr candle was green what was the previous days daily candle. The period of study could be one year or max two years. This knowledge could benefit a lot of traders. Thanks

skenobi Nov 3, 2013 11:44pm | Post# 2

Data from different brokers will have different starting times in relation to GMT, i.e. one broker's 4 hour candle starts at a different time compared to another broker.

Are the differences in this time benchmark something you'll accept, I wonder.

(I don't have the data you seek, but for the benefit of those who would be inclined to assist you, I think your request is somewhat less specific.)

9047 Nov 3, 2013 11:55pm | Post# 3

Hi,

You can export the data from your terminal (assuming your using MT4) and do the analysis in Excel.

It will also help you phrase/frame your question better e.g. what do you mean by "correlation"? I think you meant to ask "what is the probability of having an up/down day if the first H4 candle is up/down?

ninety47

fffx Nov 4, 2013 12:20am | Post# 4

@skenobi. It doesn't matter which broker or day starting time.
@9047 . If I could export data to Excel etc I would have done it myself and not bothered fellow traders.
What I mean by correlation is exactly what you have clarified.

9047 Nov 4, 2013 9:41am | Post# 5

1 Attachment(s)
So I had fiddle here is my analysis for the AUDUSD H4 bars (with server time GMT+3):

R output:
Inserted Code
H4 to D1 bias
=============
Overall:
Total observations:     3862
Invalid D1 bars (NAs):  26
Succesful bias bars:    1403 ( 36.57% )
Failed bias bars:       2433 ( 63.43% )
Break down by day of the week:
          Bias
Day         Bearish None Bullish
 Monday       16.4 64.6    19.0
 Tuesday      17.6 61.3    21.1
 Wednesday    15.9 64.5    19.7
 Thursday     16.0 63.8    20.2
 Friday       16.8 62.9    20.3

A chart of the output:
Click to Enlarge

Name: audusd_d1h4bias.png
Size: 12 KB

I'll upload the R code to my FF stats collection thread here.

I'm guessing this stat might be more interesting for the Yen pairs and crosses but for AUDUSD its worth noting that day of the week has no impact the bias and that the bias occurs about every 1 in 3 days.

Before anyone asks for it in MT4 - I don't write analysis in MQL4. If you don't understand why go and hammer a nail into hardwood with a shoe..... hard when your not using the right tool isn't it? If you follow the above mentioned thread I will eventually start adding charts for the identified setups/points of interest.

Cheers,

ninety47.

PipMeUp Nov 4, 2013 11:06am | Post# 6

Thank you 9047 for posting these results. I notice a small bullish bias. I think it is certainly only due to the fundamentals of A/U: Aussie used to be a carry trade pair on the buy side. I suppose that if you do it again with G/J you'll get a small bearish bias. With A/N no bias should appear. 9047, do you have those data to test with?

fffx Nov 4, 2013 12:22pm | Post# 7

Thankyou 9047, for the effort. Please explain what is meant by 'none' bias. Also test it on EUR/USD if possible.

9047 Nov 4, 2013 11:44pm | Post# 8

Hi fffx,

"None" simply means there was not bias e.g. the 1st H4 bar was bullish and the day was bearish or the opposite.
I've uploaded more results to my stats thread over here (http://www.forexfactory.com/showthre...07#post7069607)

Cheers,

ninety47.

fffx Nov 5, 2013 2:04am | Post# 9

Thanks 904seven for the interest and the help. Also please find out for EUR/USD:- If the daily candle of two days ago (not the previous day but the day before that) candle was green/red what was current day's candle e.g. if Mondays candle was green/red what was Wednesday's candle (Same colour or opposite). Here we are not concerned with the immediate previous day candle which in this case is the Tuesday candle -- All best

9047 Nov 5, 2013 3:00am | Post# 10

Hi fffx,

Glad you found the results useful. I mean this in the most sincere way but I'm just not interested in writing that kind of a filter. The idea just doesn't really fit my approach to trading. That said I encourage you to export the data from MT4 and load in it Excel or LibreOffice Calc (this is one is free if you can't afford Excel or dislike Micrsoft etc) and learn to do some analysis. The key difference I can see between successful traders (either from books e.g. Market Wizards, forums like this or friends who trade for a living) is that at some point they all compiled statistics and hunted out patterns and setups.

To export data from MT4, open the terminal:

  1. Press F2 or Go to the "Tools"menu and select "History Center"
  2. Select the currency pair you want and press the download button.
  3. Once the download is complete press the Export Button
  4. Save the file as ASCII Text (CSV) data.

You can then easily import this into Excel or LibreOffice Calc - If you have trouble just Google for "import CSV file Excel" or similar. If this is all new to you, then you'll probably need to learn some worksheet functions etc But then you can go as quant as want on that bad boy!

Also don't forget to share your results here as well - I'm sharing so that other traders can benefit and will hopefully share their data (as many people have here already)

Good luck!
ninety47


PipMeUp Nov 5, 2013 6:40am | Post# 11

1 Attachment(s)
Hi,

I've built the probability distributions of a move for H4 and D1 candles for AUD/USD. They are grouped in 20 pip bins. Then I've build the matrix of the probability of D1 given H4. The excel file shows two cells per entry. The expected value is based on the assumption that the probabilities are independent and the actual value is the count of bars. I don't see anything statistically significant.
Aussie_H4_D1.xlsx

9047 Nov 5, 2013 10:18pm | Post# 12

Hi Pip,

Just looking at your table - nice work. I looked at the impact of the day whilst you looked at the distribution of the movement when bias occurs. Have a couple of questions:

  1. The bins hold the ranges for each bar (open - close)?
  2. Just to double check is this understanding of your binning correct - a bearish day closing 50 pips from the open would it fall in the [-40, -60) bin?
  3. How did you derive the probabilities to determine your expected values? Did you use the following:

    1. A: event of D1 being bullish
    2. B: event of H4 being bullish
    3. n: number of daily bars
    4. Under the assumption of independence Pr(A|B)Pr(B) = Pr(A,B) = Pr(A)Pr(B), so expected values are simply: Pr(A)*Pr(B)*n?

Hope I've made sense, my probability theory is a little rusty.

I did run the chi-square tests for the result I came up with where interesting. For the Yen pairs examined only CHFJPY didn't display a possible association between the day of the week and the bias distribution. The test results:

  1. AUDJPY: X-squared = 22.1925, df = 8, p-value = 0.004571
  2. CADJPY: X-squared = 7.36, df = 8, p-value = 0.4983 (not significant)
  3. CHFJPY: X-squared = 7.1666, df = 8, p-value = 0.02842
  4. EURJPY: X-squared = 26.1719, df = 8, p-value = 0.0009815 (very strong result)
  5. GBPJPY: X-squared = 42.272, df = 8, p-value = 1.204e-06 (very strong result)
  6. NZDJPY: X-squared = 15.6151, df = 8, p-value = 0.04823
  7. USDJPY: X-squared = 23.9819, df = 8, p-value = 0.002308

The possible association indicated for the AUDJPY, USDJPY, GBJPY and EURJPY may support some of the H4 breakout strategies that I've seen EAs and threads for (both here and stevehopwoodforex.com). I've posted the rest of the results here.

Cheers,

ninety47


PipMeUp Nov 6, 2013 3:45am | Post# 13

The bins hold the ranges for each bar (open - close)?
Open to close. The high/low was not taken into account.

Just to double check is this understanding of your binning correct - a bearish day closing 50 pips from the open would it fall in the [-40, -60) bin?
Correct.

How did you derive the probabilities to determine your expected values?
Exact. Under the assumption of independence Pr(A|B) = Pr(A) and the join probability reduces to Pr(A,B) = Pr(A)*Pr(b)
BTW n=3080

conglom-o Dec 3, 2013 7:35am | Post# 14

Hi fffx, "None" simply means there was not bias e.g. the 1st H4 bar was bullish and the day was bearish or the opposite. I've uploaded more results to my stats thread over here (http://www.forexfactory.com/showthre...07#post7069607) Cheers, ninety47.
Great job. So it means - if you have about 60% of "no bias" go short when the first H4 candle is green and long when it is red. Should result in about 60% winning trades then. Could be a start of a strategy where more details have to be found. Can you analyze the EURUSD also, please?

9047 Dec 18, 2013 4:06am | Post# 15

Hi Conglom,

So it means - if you have about 60% of "no bias" go short when the first H4 candle is green and long when it is red. Should result in about 60% winning trades then. Could be a start of a strategy where more details have to be found.

I can see the logic and I'd love yes but if was that simple we'd all be retired forex traders in 6 months.

Essentially the Chi-squared test just show that for the data I used there is an association between the resulting distribution of bullish, bearish and "no bias" for some currency pairs (namely a number of the Yen pairs - will address that below). Though as you've pointed out most of these pairs show no bias around 50-60% of the time (bias being set by the type of the bar printed in the first 4 hours of the day). The "no bias" outcome doesn't take into account:

  1. how far against the "bias bar" price moved,
  2. how much it missed being classified as biased day (e.g. some of these might have missed out by one 1 pip),
  3. the relative price action e.g. near support/resistance or reversal patterns like pin bars
  4. event impacts e.g. news was not considered in the calculations.

As I mentioned the flip side of the no-bias is that 40-50% of the time the bias is set by the first 4 hours of trading in a day. For simplicity if you assume an even split between bearish and bullish you could say for example 1 in 4 or 1 in 5 Mondays the bias works. Which translates to need a return of 3 times your risk to break even for (1 in 4 days) and 4 times for the later. Tall order given you stops may need to be pretty big. So you need to find something to filter the bad ones (the 75-80% that are false signals - quite a lot to clean out).

Its also important not to put much stock in the results of this analysis because it is a VERY simple threshold analysis and reduces all the information contained in the price down to essentially a binary value (biased or not-biased).

On issue of significant relationships identified for the Yen pairs is likely due in part to the fact that my data is GMT+3 (NY close midnight) so the first bar of the day is print during the Asian session. A way to investigate if this is the case would be to run the analysis and use London or the Frankfurt open as the start of the day instead on New York close (Sydney open).

So whilst I think that the bias analysis result isn't very effective on its own, knowing about it and using as a form of (weak) confluence with other set ups is how I think this basic information could be used e.g. if the first bar of the day prints a bearish pin bar into resistance at the top of a rally then you have the knowledge that on its own that bearish H4 bar has a 20-25% chance of bias the rest of the days price action.


Can you analyze the EURUSD also, please?

If you follow the link (http://www.forexfactory.com/showthre...07#post7069607) in the post you quoted you see the analysis for:

  1. AUDCAD
  2. AUDCHF
  3. AUDJPY
  4. AUDNZD
  5. AUDUSD
  6. CADJPY
  7. CHFJPY
  8. EURAUD
  9. EURCHF
  10. EURGBP
  11. EURJPY
  12. EURUSD
  13. GBPAUD
  14. GBPCHF
  15. GBPJPY
  16. GBPUSD
  17. NZDJPY
  18. NZDUSD
  19. USDCHF
  20. USDJPY

Regards,
ninety47



© Forex Factory