Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   MACD Simple Cross System (https://www.forexfactory.com/showthread.php?t=931503)

Lukass Jul 10, 2019 9:40am | Post# 1

MACD Simple Cross System
 
7 Attachment(s)
Hello Everyone,

I have had this idea in my head for quite some time and wanted to share it with you.

I would like to ask you to give me your feedback and if someone knows how to create EA, then it would be great to speed up the testing.

The only indicator I am working with is MACD (standard setting 12,26,9). Just copy it to your indicators folder. I am using this with H4 timeframe.

BUY:
We are looking for a buy signal when both signal and main MACD lines are below 0. We enter the trade when the histogram turns to green color.

Add-on BUY:
If after the valid buy (both lines below 0, histogram turns green) the histogram turns to red and then turns to green again, you add another buy position.

From left to right:
Buy, Add-on Buy, Sell, Buy

Attachment 3382460

SELL:
We are looking for a sell signal when both signal and main MACD lines are above 0. We enter the trade when the histogram turns to red color.

Add-on SELL:
If after the valid sell (both lines above 0, histogram turns red) the histogram turns to green and then turns to red again, you add another sell position.

From left to right:
Sell, Buy, Sell, Add-on Sell, Add-on Sell

Attachment 3382463

EXITS:
Exit all open positions when you receive an opposite signal. This means you will always have an open position(s) - either buy or sell.

Here are some screenshots from MACD alone with signals marked, price levels with signals marked, and a combination of both.

Attachment 3382469
Attachment 3382461
Attachment 3382462

I used this system a few years back on my live account and I managed to grow my account from approx 5,000 CZK to about 7,500 CZK (200$ to 300$ approx.), but then lost most of it as I missed the reverse signal, and then instead of closing in a small loss, I let the trades run against me until I get another signal in the same direction. Unfortunately, this took longer than I thought and so I closed my trades with big loss...Had I waited a few more days, the market moved in "my" direction and I would have been close to 300% gain, but that's another story

Have a great day, everyone!
MACD_ColorHist_Alert 12 26 9 LA .ex4
MACD_ColorHist_Alert 12 26 9 LA .mq4

DrDave Jul 11, 2019 2:58am | Post# 2

Hello Everyone, I have had this idea in my head for quite some time and wanted to share it with you. I would like to ask you to give me your feedback and if someone knows how to create EA, then it would be great to speed up the testing. The only indicator I am working with is MACD (standard setting 12,26,9). Just copy it to your indicators folder. I am using this with H4 timeframe. BUY: We are looking for a buy signal when both signal and main MACD lines are below 0. We enter the trade when the histogram turns to green color. Add-on BUY: If after...
Interesting idea, Lukass. On a first quick look, did you evaluate exiting when MACD line crosses the signal line?

Lukass Jul 11, 2019 3:26am | Post# 3

{quote} Interesting idea, Lukass. On a first quick look, did you evaluate exiting when MACD line crosses the signal line?
Hey there DrDave I would exit all open positions, let's say sell positions, the first moment I receive the buy signal. Then I exit all sell positions and open buy position. This way, you would always have either buy or sell position(s) open. Hope it makes sense.

DrDave Jul 11, 2019 5:51am | Post# 4

{quote} Hey there DrDave I would exit all open positions, let's say sell positions, the first moment I receive the buy signal. Then I exit all sell positions and open buy position. This way, you would always have either buy or sell position(s) open. Hope it makes sense.
Yes, of course it makes sense as far as logic for always being in the market. However, I suspect that in the long run, you will lose money. This is because your strategy performs well on trending charts but takes heavy losses on non-trending charts. In addition, when you make an entry on a move with good momentum, then it goes into a low momentum consolidation, there can be many, may bars pass with little price movement, but your money is tied up in that trade. That is why I asked if you had evaluated making any earlier exit and being out of the market until the next entry signals appears. Take a quick on H1 charts over a period of 1 week and see what I mean.

Lukass Jul 11, 2019 6:33am | Post# 5

{quote} Yes, of course it makes sense as far as logic for always being in the market. However, I suspect that in the long run, you will lose money. This is because your strategy performs well on trending charts but takes heavy losses on non-trending charts. In addition, when you make an entry on a move with good momentum, then it goes into a low momentum consolidation, there can be many, may bars pass with little price movement, but your money is tied up in that trade. That is why I asked if you had evaluated making any earlier exit and being out...
I actually tested H1 for a few weeks, and overall it was in green...However, I trade only on H4 as there are fewer whipsaws. I would love to play around the settings, but doing everything manually is time consuming. I was wondering if someone who knows the coding could make this into the EA where I could change the MACD parameters, set up trailing/fixed TP and SL or reverse...Then I could test this more on different pairs/timeframes...

DrDave Jul 11, 2019 8:31am | Post# 6

1 Attachment(s)
{quote} Hey there DrDave I would exit all open positions, let's say sell positions, the first moment I receive the buy signal. Then I exit all sell positions and open buy position. This way, you would always have either buy or sell position(s) open. Hope it makes sense.
I think you will have better success rate if you make entries on H1 based on what H4 shows you. For example, look at H4 for what would be a valid sell signal and put a vertical line on that bar. H4 shows your entry direction is SELLING. Switch to H1. Now you WAIT until H1 makes a valid BUY signal, but do not take that, because H4 showed you SELLING is the best direction. Now assuming that H4 did not go up strongly and make a BUY signal while H1 was going up, you look for the H1 to make a SELL signal and enter short.

After you get some number of pips profit, you really need to either set a hard stop to protect some amount of profit, or use a trailing stop. Look at the picture. Even if you used my suggested exit of MACD line X signal, this sell trade turns from a winner to a loser without some kind of profit protecting stop.

Look at the screen capture of H1. In the MACD window, the thicker verticals mark signals on the H4.
After the first H4 sell signal on the left, wait for H1 buy (dotted green vertical), but do not enter; wait for the H1 sell signal and enter short, the red vertical. An add on sell was generated at the next red vertical.

The first sell either went into drawdown or you got stopped out. If you stayed in and entered the add on sell, your position went into profit with some drawdown along the way. If you exit at the either the first or second green vertical, both probably gave you losing exits. (This first MIGHT have resulted in some small profit). This is where you see that you need some kind of profit protection stop in place.

With you current system of always being in the market, you would have made a buy at the second green vertical. Clearly, this was a totally losing trade; it never saw any positive pips. However, if instead of buying you would have followed the direction of the H4, you would be looking only to sell, so would not have made that losing buy entry.

Next comes the thicker green vertical that marks a buy signal on H4. Remember, you do not buy here; this only shows you the direction that you should enter, if conditions are right. Now, after the H4 direction is shown, what do you do? WAIT for the H1 to go down and make a sell signal (the red vertical), then reverse and go back up to make a buy signal while H4 remains in an up state! Look at the chart. After the H4 signals buy direction, H1 makes the desired sell signal (that you do not take), and while waiting for H1 to to go back up for a buy signal, H4 makes a SELL signal, canceling your plans for buying!

Now that H4 signalled only selling, wait for H1 to make a buy signal (dotted green vertical), then when H1 comes back down, sell on the sell signal (red vertical). This definitely a winner with a lot of pips IF you exit at my exit point (first green vertical). If Exiting at your exit signal (2nd green vertical, price actually made a spike up that went into DRAWDOWN, then came back down for a few pips of profit.

At this point, H4 is still on SELL mode, so I would not make a buy entry at that last H1 buy signal; I wait for price to come back down and have an H1 SELL signal and go short, the last red vertical. That sell is in profit at the end of the screen. (NOTE: In reality, I would not have taken this second sell on H1. Only 1 cycle is allowed. After that, the market has probably moved up to the H2, or started over with m1.)

drdave
Click to Enlarge

Name: Lukass_H1.png
Size: 142 KB

DrDave Jul 11, 2019 8:48am | Post# 7

{quote} I actually tested H1 for a few weeks, and overall it was in green...However, I trade only on H4 as there are fewer whipsaws. I would love to play around the settings, but doing everything manually is time consuming. I was wondering if someone who knows the coding could make this into the EA where I could change the MACD parameters, set up trailing/fixed TP and SL or reverse...Then I could test this more on different pairs/timeframes...
Even if you have net green, did you keep track of drawdown on each trade during the time it was open? In any case, as you saw from post #6, your current strategy does not do well in ranging markets. If you incorporate my strategy of using H4 to set direction and H1 to make entries, your whipsaws will be greatly reduced, and probably a lot of your current entries that are losing or worth only a few pips will get filtered out.

If you want to make your entries on H4, then use the method I gave and have Daily set your trade direction. But remember, if you are entering on H4, you only have 6 bars per day. So unless you can make your entry early in the day, most likely you will not be doing much day trading, because you will need to hold overnight very often.

If you want to make it easier on your analysis, install NinjaTrader. It has MACD, but you'll need an adjusted one to get the histogram type that MT4 has. NinjaTrader has a market replay feature that uses the tick data downloaded during your sessions (or imported). Then you can go back and replay from anywhere within your data set and not only see where setups are, but you can practice making trades. NT also lets you create nearly ANY timeframe that you want. So if you decide to incorporate my suggestions and make entries on H1, you should include H2 and H4 in your set of charts. (And really, you should have m30 to refine the actual entries rather than entering on H1).

drdave

DrDave Jul 11, 2019 9:01am | Post# 8

{quote} ... doing everything manually is time consuming. ...
W. D. Gann said that you must study the charts and markets for 1 hour every day for 5 years before placing your first trade. If we approximate 200 trading days per year, that works out to a minimum of 1,000 hours of study.
I think you would do well to do some manual work on it.

Lukass Jul 11, 2019 9:07am | Post# 9

1 Attachment(s)
{quote} I think you will have better success rate if you make entries on H1 based on what H4 shows you. For example, look at H4 for what would be a valid sell signal and put a vertical line on that bar. H4 shows your entry direction is SELLING. Switch to H1. Now you WAIT until H1 makes a valid BUY signal, but do not take that, because H4 showed you SELLING is the best direction. Now assuming that H4 did not go up strongly and make a BUY signal while H1 was going up, you look for the H1 to make a SELL signal and enter short. After you get some number...

Oh Wow! Thanks for that information, Dave. This reminds me of another system I was interested in some time ago. Triple Screen System by Alexander Elder. I loved the idea of using higher TF to get the main direction of the trend.

I am not 100% sure if we are on the same page with my entries/exits. I tried to go to September 2018, to have the same graph as you have attached, and I marked my entries, as I would have entered them. I had to go a little bit back as the first trade was on 14th September, but I think you understand that. H1 does not want to load on those dates don't know why.

I will try to play around that, combining H4 and H1 TFs. I will post my results later Thank you for your feedback, I appreciate that.

Lukas
Click to Enlarge

Name: EURUSDH4.png
Size: 115 KB

DrDave Jul 11, 2019 12:29pm | Post# 10

1 Attachment(s)
WOW! According to your screen capture in post #9, we have DRASTICALLY different price feeds for EURUSD H4!! Unbelievably different. So I closed my terminal, relaunched, and refreshed the data. Now it is much closer.

To summarize the below commentary, it looks like PROBABLY your system of trading on the H4 will indeed make decent net green pips, IF your account can handle a substantial amount of drawdown. My variation does not do much to improve the results, if any at all. I would need to find a different signal to use (probably MACD X 0 line for direction.)

I switched to D1 and marked with thicker verticals where it has signals. There were 3 during that period we have been checking; 2 consecutive sells followed by a buy.

After the first D1 sell, I put a yellow vertical. This marks the first H4 buy signal, so now looking for the H4 sell signal to enter short. Got 3 of those, about the same as you showed. (Interesting how price is creeping higher when we are supposed to have a sell bias.) So of course, all three of those went into drawdown 103, 138, and 58 pips respectively, giving 389 pips of drawdown that your account would have to handle.

They finally went positive after the 2nd thicker vertical (that marked a D1 add on sell). And then your system would exit on the following green vertical to harvest 72, 127, and 187 pips respectively, for a total of 386 pips.

Then for the H4 buys, again, the first 2 go into drawdown, but the 3rd manages to avoid that low, and only saw 8 pips drawdown later. Finally, an H4 sell signal is given where the thicker green vertical is. This resulted in drawdown of 118, 81, 8 pips for 207 pips total drawdown, and profit of -9, 28,and 44 pips, for a total of 63 pips profit.

In my variation, there would have been none of those buys because D1 was still in down bias. Instead, I was waiting for the up move to end and an H4 sell signal, which happened 16 Oct, and then the buy signal to enter long, which came 19 Oct. I did not mark any of these because this went into a bunch of add on buys that mostly went into draw down (price ws still heading down) and when the H4 sell signal finally came, the net for this was probably close to 0. Then waited through the sell signals (D1 still in buy bias) and got at least one good buy (~150 pips), and then mostly sideways for a few net + pips until the D1 showed sell signal.

drdave
Click to Enlarge

Name: Lukass_EURUSDH4_D1.png
Size: 63 KB

Lukass Jul 11, 2019 12:48pm | Post# 11

1 Attachment(s)
WOW! According to your screen capture in post #9, we have DRASTICALLY different price feeds for EURUSD H4!! Unbelievably different. So I closed my terminal, relaunched, and refreshed the data. Now it is much closer. To summarize the below commentary, it looks like PROBABLY your system of trading on the H4 will indeed make decent net green pips, IF your account can handle a substantial amount of drawdown. My variation does not do much to improve the results, if any at...
I got to say, that I was wondering why the price was so different...I was thinking maybe you went all the way to 2015 or something...Hehe, strange, but at least, we can compare the same/similar graphs. But yea...WOW!

I tested H1/H4 combination as you presented in the last post, and got into the same issue you are describing now with the last buys...if I had to wait until the higher TF "allows" me to enter in that direction, the lower TF would not create a signal to enter the trade...So normally, there would be a buy signal on lower TF, not agreeing with higher TF so you would not trade...but then as the higher TF changes, you would not get any more trade signals to work with....

Talking about the drawdown - that is what wiped me out last time I was trading using this system. I basically missed my reverse...and instead of doing the "late" reverse and accepting the bigger loss for that cycle...I stayed, foolishly thinking that it would reverse again in a few days...what a mistake and bad decision...I was also thinking that if I increased the add-ons lot size, that might exponentially increase the profit...as you mentioned those trades in your example:

72, 127, and 187 pips
-9, 28,and 44 pips

If I'd go with 0.01 the first trade...then adding 0.01 for each additional position it would have been like this.

72 x 0.01
127 x 0.02
187 x 0.03

and

-9 x 0.01
28 x 0.02
44 x 0.03

Much more profit at the end of the cycle. More add-ons trades you make, higher the possibility of the reversal, due to the divergence (I think). So in theory, this should lower the risk for each add-on trade...However, there is no certainty

I have done hundreds of hours of testing, but there are still some ideas like this to try...that's why I think EA would speed things up a lot...

Thank you a lot for your input, I appreciate any comments and suggestions

EDIT: As I am looking at the graph that I posted...I missed the last buy trade and forgot to mark it...
Click to Enlarge

Name: EURUSDH4.png
Size: 112 KB

Lukass Jul 11, 2019 1:31pm | Post# 12

1 Attachment(s)
I did some more testing. I have combined the P/L for each cycle. This is for EUR/USD H4 from 09.14.2018 - 30.01.2019

+300
+110
+100
-190
+255
+125
+90
-30
-70
-5
-15
+105
-25
0
+65
-35
+190
+70

Total: 1110 pips

EDIT:
If I would use 0.01 for 1st position, 0.02 for 1st addon, 0.03 for 2nd addon, 0.04 for 3rd, etc. The results would be like this:

735
305
160
-330
410
125
120
-30
-70
-5
-15
160
-25
0
95
35
325
95

Total: 2090 pips
Click to Enlarge

Name: EURUSDH4-1.png
Size: 143 KB

DrDave Jul 11, 2019 2:22pm | Post# 13

I did some more testing. I have combined the P/L for each cycle. This is for EUR/USD H4 from 09.14.2018 - 30.01.2019 +300 +110 +100 -190 +255 +125 +90 -30 -70 -5 -15 +105 -25 0 +65 -35 +190 +70 Total: 1110 pips EDIT: If I would use 0.01 for 1st position, 0.02 for 1st addon, 0.03 for 2nd addon, 0.04 for 3rd, etc. The results would be like this: 735 305 160 -330 410 125 120 -30 -70 -5 -15 160 -25 0 95 35 325 95 Total: 2090 pips {image}
Those are quite nice results. If that is realistic in the long term, there are about 2500 to 5000 pips to be made per year. But you need to include the drawdown in your data display, considering that is a big concern with the system as it stands now.

You also need to have a look at adding either a trailing stop or a hard stop to protect profits. Consider after going N pips positive (you have to decide value of N) set protective stop to give back only M% of current gain ( you decide value of M; I'm thinking of looking at 20 to start, but maybe needs to be based on ATR instead).

Personally, I don't worry about it at all. I typically target 10 pips. LOL

Lukass Jul 11, 2019 3:49pm | Post# 14

{quote} Those are quite nice results. If that is realistic in the long term, there are about 2500 to 5000 pips to be made per year. But you need to include the drawdown in your data display, considering that is a big concern with the system as it stands now. You also need to have a look at adding either a trailing stop or a hard stop to protect profits. Consider after going N pips positive (you have to decide value of N) set protective stop to give back only M% of current gain ( you decide value of M; I'm thinking of looking at 20 to start, but...
Hehe, yea, it would be good if that worked The worst so far for that period would be -820, if I'd go with adding the extra lots...

I will try to run at least 2 more major pairs for comparison of the results...at least for the same period

I am not sure if trailing or hard SL would work as you could see, most of the times, it goes against you for some time until it reverses to profit...

Lukass Jul 12, 2019 5:46pm | Post# 15

Is there anyone who could possibly create EA for this system?

tkamal81 Jul 12, 2019 6:58pm | Post# 16

1 Attachment(s)
I am using MACD 15 31 12 and ichimoku as guide with 20 MA

This is very much possible to earn in H4 even with m30

A grid averaging robot will be useful so that we can sleep and earn with this system

thank u


please give us an ea
Click to Enlarge

Name: Image1.png
Size: 42 KB

M.Propper Jul 15, 2019 7:00am | Post# 17

2 Attachment(s)
Test this....
from Member Dave_C
MACDCrossEA.ex4
MACDCrossEA.mq4

Lukass Jul 15, 2019 8:16am | Post# 18

Test this.... from Member Dave_C {file} {file}
Thank you M.Propper! Unfortunately, it seems that this does not work the way I need it

Lukass Jul 15, 2019 12:32pm | Post# 19

1 Attachment(s)
Here is the continuation to the post #12

Trades:
+220
+30
+100
+80
+80
+65
+80
+20

Total: 675 pips
Click to Enlarge

Name: EURUSDH4.png
Size: 142 KB

DrDave Jul 15, 2019 2:03pm | Post# 20

2 Attachment(s)
I was thinking about how you might get more trades and also have an opportunity to see if the H4 entry might be at a bad time.

I put H1 next to H4. On the "down" charts, I put a white vertical at the MACD crossing per your rule where you sell on the next bar. I placed on the H1 a white vertical at the same time as H4. You can see that H1 MACD is getting close to 0 line and at a good angle. Your rules have no more sells before H4 MACD goes below zero that I marked with the red vertical. If you check H1 after the H4 sell entry, you see that MACD continues below 0. I marked it with a solid yellow vertical. You can make another sell here, because H4 is still in sell mode.

Now keep watching H1 for add-on sells until H4 goes to buy mode. You see three add-on sells on H1 marked by the dotted verticals. So this gave 1 sell using H4 alone and 5 sells using H4 + H1.
Click to Enlarge

Name: L_EU_H4_H1_25JUNE_down.png
Size: 36 KB

Now on the "up" charts, I put on H4 two white verticals for initial buy and add-on buy. Looking at H1, you see the initial buy had MACD very close to 0 and angle up, confirmation a good buy on momentum. There are no more buys H4. However, on H1, you see between the two white verticals a yellow dotted vertical marking an H1 add-on. You can also see on H1 after MACD went above 0 a large dip marked by dotted yellow vertical for another add-on buy. No ore buys before H4 MACD cross down at the gray vertical. I did not mark it on H1, but I would also do an add-on buy when MACD crossed 0 up.

So this gave 2 buys using H4 alone and 5 buys using H4 + H1.
Click to Enlarge

Name: L_EU_H4_H1_17JUNE_up.png
Size: 36 KB


© Forex Factory