SAR system based on QQE Adv and MACD Platinum

the QQE and MACD dual signal.mq4 (#97) compilation have an error due to the last #include at the end of program: missing bracket.
i cant get around that issue, and wonder that #include is declare at the end of program instead of the usual top lines.

Ignored

Dino,

I've just downloaded the .mq4 from post #97, and it compiles without any problems. I'm running Windows XP SP2 and Pepperstone MT4 build 427.

Anyway, you don't need the .mq4 file, unless you're planning on making changes to the program code yourself. Simply delete the file and restart MT4.

I realise I haven't posted for quite a few days, but been busy with other stuff with family etc. Actually flying out to Bali in a couple of days for some R&R and to celebrate my 50th birthday. Getting old, but the funny thing is that I am fitter and leaner than I have been in years. Maybe that has something to do with my Paleo lifestyle.....

I digress. The 2nd version of the EA is going well, but in the meantime I have been having some further ideas with regards to improving (?) it. These are things I have touched on in this thread previously and also had some private discussions with other members along these lines. In a nutshell, I have made a request to Christina to see if it would be possible to have a filter added to the EA.

An example would probably be the easiest way to describe it, so here goes:

The EA is loaded onto the EUR/USD 5 min chart as per normal. This is my primary chart or time frame.
In the settings, I have a choice of choosing true/false if I want to use my new filter.
If I select 'false', then the EA would just perform as usual depending on what other inputs I had selected.
However, if I had selected 'true', then I would select my filter time frame, and in this example it maybe the EUR/USD 1hr and also choose which settings I would like to use on the same two indicators that dictate this filter (MACD Plat & QQE).
So then the EA would only take trades on the 5 min chart that are in the same direction as the 1 hr chart.
For example, if the 1hr chart was long, then only long trades wold be taken by the EA on the 5 min chart. The fib sequencing would remain the same, however it would just ignore all short signals on the 5 min chart.
Obviously there are some finer details to work out, but this is basically what I am after.

Below is a copy of my email to Christina for this request, and also some of her responses (in blue) to date.

Just had a bit of another idea that I would like to run past you. Not sure if it is viable or not, but I'm sure you will tell me.

Looking at adding a filter to the SAR EA (2nd version). Basically would it be possible to select true/false to use a filter? If so, then this filter would be the same two indicators used on a different time frame.

What I mean by this, say for example I was trading off the EUR 1hr chart using the SAR EA, but only wanted to take trades in the same direction as the EUR Daily chart. Would this be possible. Would be looking for a choice to use this filter or not.

As already stated, this filter would be based on the same indicators as the primary (1hr) chart. However, I would like to be able to adjust the settings for each individual indicator. EG MACD Platinum on the 1hr chart may be 12, 26, 9 but on the daily chart the MACD Platinum settings may be 18, 39, 13. Same applies to the QQE Adv. I would like to nominate my settings on all indicators.

It's possible to do multiple time frame, usually there is 2 ways:

1. Build high tf condition into signals. This way every signal is a result considering conditions of both time frames and is a signal could have trades opened.
2. High tf condition is not part of the signal but as a filter. This way your signal is only based on lower tf conditions, if your filter does not agree, then you won't open trades.

With certain system, it won't make much difference either way, but with your system, I can only imagine using option 1. Using option 2 will be opening up a lot more discussions, a lot more rules is needed.

For example:

stf QQE=cond1, stf MACD=cond2, ltf QQE=cond3, ltf MACD=cond4

Say at one point cond 1-4 all line up for a buy, you open a buy, we know for your old EA your next signal can only be a sell (you had only 2 conditions any changes with just 1 conditions won't matter in that case), the only thing I can see here being completely clear here is to wait for all 4 condition to turn down and line up, then you get a sell signal. If this is not what you think, you will have possibly a buy signal after a buy, then this will be significantly different than your old EA, which is built on the basis that your signal will alternate.

You could have from all 4 cond is buy, then 1,2 change to sell, but 3,4 is still buy, is this a signal for sell? Or you could have 1.2 is sell then change to 1,2 is buy again, which 3,4 remains buy, is this a signal? Or you could have 1, 3 change to sell and 1 change back to buy again, etc.

Adding a mtf condition, for some ea it's very simple thing, but in this case, I feel a lot of confusion here, you probably need to make a video.

The next request would be, if a filter was nominated as 'true' on the EA, then obviously the EA would be loaded onto my primary chart, in this case the EUR 1hr. Then if I could select what time frame and the settings required to base this filter on. In the example above, this would be the EUR Daily chart. Not sure how you could nominate that on the EA, possibly a multiplication of the primary chart, in this case '24'??

This can be done, just need to give you another variable to define what higher time frame is, in this case it's daily time frame, you input 1440, EA will monitor daily tf condition internally. EA is attaching on 1h chart.

So to continue with the above example, if the EUR Daily chart was in an up trend as per the two indicators, then the EA would only take long trades on the EUR 1hr chart when those indicators went into buy mode. It would ignore all sell signals, by either closing out the buy trades in profit or carrying over the loss until the next buy signal as per the normal sequence.

The issues I can see are what if the last trade was a long that was in an overall losing sequence and the filter chart changed direction before the losses were recovered. I guess the EA, could pick up the sequence on the first short trade?? Or it could close out the sequence no matter what the overall result was. Would prefer the first option.
Then there is the issue of the filter chart and its indicators (Daily chart). For example if the two indicators were out of sync, then this would not be a clean signal for the 1hr chart to take any trades, until they were back in sync. For example, the QQE might have crossed for a sell and there was a red dot on the MACD Platinum, then all is fine for the 1hr chart to take short trades. But if there was then a blue dot on the MACD Platinum but the QQE stayed short, would the 1hr chart take any new trades based on this, or would it wait for either the QQE to cross to the upside also, or there was a new red dot on the MACD Platinum? Or would it be better just to have the 1hr chart continue to take shorts until there was a definite reversal to the long side with both indicators in sync??

I don't know what you are talking about here. I guess I will wait for the answers of above first.

Also when you looking at ltf QQE and ltf MACD, assuming that is daily, at any given hour of today, are you reading yesterday's closing value or today's ever changing value?

And I would assume that all signals would be based on the open of the candle that follows confirmation of the signals as per usual.

So basically nothing really any different from what the EA already does, just the option of using a higher time frame as a filter based on the same indicators. Hopefully that all makes some sense. I can do a video up explaining it a bit clearer if you would like. But see what you think and even if it is doable, then we can take it from there. I realise you have a busy week, so no rush. Thanks.

And just to add to the previous post, I did send Christina the attached screenshot just to help with her understanding. This was based on a EUR/USD 1hr primary chart and the EUR/USD Daily chart as the higher time frame filter. Cheers. Jim

And just to add to the previous post, I did send Christina the attached screenshot just to help with her understanding. This was based on a EUR/USD 1hr primary chart and the EUR/USD Daily chart as the higher time frame filter. Cheers. Jim

Ignored

Hi, Jim,

Based on all the information from you, I think the best way to apply this direction filter (based on higher time frame direction) is to only use it to filter trade entry, not filter trade close. All signal identification should be exactly as before, all buy and sell signal will be identified and signal will close all opposite orders, the only difference is when filter direction pointing upwards, all see signals won't result a new trade open.

In your example, during the time Oct 26 to Nov 20, filter direction is sell. So when there is a buy signal, if within session, sell order will be closed, but no new buy order will be opened. We have rules such as close entire session on next signal, here next signal still should include both buy and sell signal. We also have rules such as start new session at first signal after session starts, here will be first sell signal after session starts, but if first signal is a buy, it won't prevent that to close sell trades from previous session. At the opening of Nov 21st, filter direction change to buy, this should not change the course of any on going session, the exiting trade should still go on until next signal (could be buy or sell) or take profit, the only difference is from that point, only buy order can be opened.

What you say makes sense. Just to confirm something though. On the screenshot, where the daily changes from short to long on the open of the 21st Nov candle, if the current short sequence was in a losing position overall, would the EA then only take long trades to recover that loss. I guess what I'm asking, is the sequence going to continue even though there has been a change of direction on the filter (daily) chart? Or would that short sequence be closed out completely and start a new sequence with the first long trade? Naturally I would prefer that the sequence just continue and recover the loss, even though there has been a change of trend on the filter chart. Thanks. Jim

What you say makes sense. Just to confirm something though. On the screenshot, where the daily changes from short to long on the open of the 21st Nov candle, if the current short sequence was in a losing position overall, would the EA then only take long trades to recover that loss. I guess what I'm asking, is the sequence going to continue even though there has been a change of direction on the filter (daily) chart? Or would that short sequence be closed out completely and start a new sequence with the first long trade? Naturally...

Ignored

Not sure what you mean by "short sequence", a sequence can have long and short, so I don't see a direction here. I think what you mean is the last order still exists is a sell order?

If so, I think what makes most sense is this:

By the time 21st Nov upper time frame change to buy, and if your current sequence has a sell still, then this sell order needs to go through it's normal way, either close out at next buy signal to close, or reach break even or take profit target if it's the first order. Buy the time you get the next buy signal, you will open a buy order, it'll either be a first order of the sequence, or another order of the same sequence and try to recover the loss.

By the time 21st Nov upper time frame change to buy, and if your current sequence has a buy still, then this buy order needs to go through it's normal way, either close out at next sell signal to close, or reach break even or take profit target if it's the first order. Buy the time you get the next sell signal, you will not open a sell order since it's not allowed. Then what's going to happen is that, we then have to wait for the next buy signal to open a new order, it'll either be a first order of the sequence, or another order of the same sequence and try to recover the loss.

Christina, sorry for the confusion. By 'short sequence' I meant that as the daily chart was in a down trend during this example period, there would only be short trades taken on the 1hr chart, hence it could only be in a short sequence. I understand that the last signal may have been a buy signal, but that would have been ignored due to the filter and no trade taken. It could only then go into a 'long sequence' from the first long signal on the 1hr chart anytime after the 21st daily candle opens confirming the change of direction on the filter. Thanks. Jim

Oh, sorry I forgot only sell is possible before 21st Nov. Then it should be this:

By the time 21st Nov upper time frame change to buy, and if your current sequence has a sell still, that means your last signal before 21st Nov is a sell. So next signal must be a buy. Then if sell is not closed before this buy signal, then close sell and open buy as next order in sequence and try to break even.

If your last signal before 21st Nov is a buy, your previous sell trade will be forced to close there with no new trade open. So when 21st Nov start, you will end up having no trades and a sequence still at loss so unfinished. The at first signal, which must be a sell, no trade will open, at 2nd signal, which must be a buy, a new buy will open and then try to recover the whole sequence to break even.

just have a money management (MM) idea, not sure how appropriate it might fit your method.

********
if 1st trade is a win, raise the lotsize, for every consecutive win, you raise the lotsize, till the 'N'th trade fails, then reset the lotsize to initial size.

if 1st trade is a loss, keep the same lotsize, until you have a win, and then do the same thing as above.
********

you see it is sort of an opposite of your lotsize mechanism.

if your system often produce winning streaks, this MM will help you exponentially.

but if your system tend to win and lose in a mixed manner, the MM might be a problem. but at least, no risk for "total annihilation".

by the way, why not connect your demo/live testing to the "trade explorer" on FF? very easy, and you can conceal/reveal any information by your choice. we can learn a lot from the evolving equity vs balance.

Yep, the big 50 today and sitting by the pool in Legian, Bali enjoying a few Bintangs. It is a big number to wrap your head around!

Charvo, I like your thinking and it is something I'll check out on my return to Oz. I am a numbers guy always looking for an edge. MM is the key to successful trading, in my opinion. You can have an excellent system but if the MM is crap, then you will lose, and on the same hand, you could have an average system with good MM and be profitable. I use to be into horse racing a few years back and it was all about using the correct staking plan. It was a business and a numbers game. I use to have some good results but there was a moral issue with my family about the whole set up. But I have always thought I could combine trading and a staking plan, which is MM. You definitely know the odds before you open a trade as you could have a defined risk:reward ratio, and you either win or lose. Prett simple really. A lot of professional gamblers do increase their bet (position) size when they are winning and decrease when losing. Thanks for the idea and I'll certainly sus it out. Cheers. Jim, the old man.....

Yep, the big 50 today and sitting by the pool in Legian, Bali enjoying a few Bintangs. It is a big number to wrap your head around!

Charvo, I like your thinking and it is something I'll check out on my return to Oz. I am a numbers guy always looking for an edge. MM is the key to successful trading, in my opinion. You can have an excellent system but if the MM is crap, then you will lose, and on the same hand, you could have an average system with good MM and be profitable. I use to be into horse racing a few years back and it was all about...

Just by way of example, here's a small sample of the trades made by the combined MACD/QQE signal, on the EURUSD,H4 chart, since the beginning of the year, showing the number of pips won/lost on each trade. A negative value denotes a loss.

So the question is: how can we use MM to turn this loss into a profit?
The only possible answer: by placing higher position sizes on the winning trades.
Which obviously leads to the question: how do we know, at the time of placing each trade, which trades are more likely to be winners?

You need to find (using a much larger sample) a statistically valid non-random pattern of either (i) 'streaks' of wins and losses (aka 'serial correlation'), or (ii) market conditions that lead to higher probability wins. Any other method of varying position size results in nothing more than a game of 'lucky' guesswork, and can not provide any kind of an edge, because 'luck' is not sustainable indefinitely.

That's your starting point IMO.

But the bottom line is that, if every signal offers approximately the same probability of success (or failure), then there's no MM that can enhance your P/L. In other words, the only way to achieve long term profit is by attaining a positive pip count. I wish I was wrong about this, because then I could use MM to improve my own bottom line.

Charvo, even if you manage to prove some serial correlation, your anti-martingale poses the dilemma as to when to revert to the original stake, during a series of wins. Otherwise, the first loss encountered will erase the profit made by several previous winners.

IMO the system would likely be improved by trading only in the direction of the longer term trends. And extending this idea, choosing pairs by pairing the strongest currency/ies against the weakest ones. For example, over the last week or so, my strength indys have been telling me that GBP is weak(est), and USD is strong(est). I've attached a pic of GBPUSD,H4. Trading only the red arrows on this chart would have resulted in a handsome positive pip count. The idea being to eliminate the need for MM to make the system profitable.

Or, if you prefer not to use indicators, you can get a strength/weakness analysis from either Oanda, or Forex Peace Army.

Another idea might be to employ the (dreaded) stoplosses. Keeping your losing trades smaller will improve your eventual bottom line, provided that your SLs are not so close to the entry, that trades that would otherwise have been winners, get prematurely cut off. Hence you'd somehow need to find an optimal balance.

Been a few days since I last posted. Thanks for those taking an interest in the thread, but nearly time to wrap it up and concentrate on my testing/trading. There have certainly been some good ideas thrown around here, which probably ask more questions than they answer. Getting the edge in your trading is certainly the key and there has been some creative thinking displayed here in this thread. This all started with a pretty basic trading idea of mine, which was a manual system that then morphed into an EA. The manual system is simple enough and if trading on the longer time frames, which I have always encouraged, then I could see no reason as to why you couldn't manually manage the trades also by either taking profits when they presented themselves or even using a trailling stop. You don't have to go from signal to signal. Obviously there will be times when it would advantageous to do so, but you wouldn't know that until after the fact.

But as I like my free time and don't particularly like sitting staring at my charts for hours on end, but the idea of trading on the shorter time frames always seems to suck me in. I think it is just the idea of being in and out of the market multiple times in a day appeals to me and is probably most people's perception of what a trader actually does. So I figured same system, smaller time frame, but controlled by an EA. Then I could add a few bells and whistles to it like trading times, profit targets etc. Enter Christina from Wise-EA You basically saw the process I went through with Christina to see how I came to have a couple of different versions built for me. The 1st version was freely posted here along with the indicators, and the 2nd version was freely available to anyone that asked for a copy. Some of the backtesting results have been pretty good, but not a huge fan of this, so I would rather risk small amounts on live accounts to see how the EA performs in real time. This is what I am doing now, just concentrating on the EUR/USD, which at the moment is probably not the best pair to trade.

Next I wanted to add a time filter to the EA. By this I mean, base my primary trades on a shorter time frame, however those trades are only taken in the same direction as a higher time frame's trend. If the higher time frame's trend is long, then only long trades will be taken on the shorter time frame (primary chart). So Christina has now completed this EA and delivered it to me, which I am in the process of testing now. Basically looking at trading the 1hr chart off the daily chart, and after a few hours testing, the results are promising. Not setting the world on fire, but certainly giving the impression it would be consistently profitable with smallish drawdown as long as you are smart about position size in relation to your account size etc. Keep in mind that this is a method that uses a martingale method to recover losses, so it's not for everyone.

So that's where I am at the moment, and will be looking to add this updated version to some live charts very soon. I will then be concentrating more on my own trading and getting it all set up, and probably less time on the forums. But I do enjoy the interaction here and go through stages where I am very active and then lay dormant for a while, depending what else is happening in my life at the time. If anyone would like a copy of the latest version of the SAR EA, feel free to contact me through my website and I'll be more than happy to send you a copy and some basic instructions. Remember you get what you pay for, so be warned that my EAs won't make you rich overnight and there is always the potential risk of completely blowing your whole account. That's my disclaimer. I have been threatening to fix up my website for a while now, so I might actually do it sometime soon. Just need to figure a way on how to upload downloadable attachments like my EAs, indicators and word docs/pdfs to a wordpress site. I'm sure someone has developed a plugin for that.

Now if someone could just move the EUR/USD out of this 70 pip range it's been in for the last 24hrs, that would be appreciated. Cheers. Jim

After a bit of testing on the latest version of the SAR EA, I am pretty happy that it is doing everything that it should be doing. I have also knocked up some pretty basic instructions relating to the features of the EA. I have attached both the EA and the instructions to this post. If you need the indicators, they can be found on page one of this thread. As usual, if anyone does take the time to test it, any feedback, good, bad or ugly, would be appreciated. Thanks. Jim

After a bit of testing on the latest version of the SAR EA, I am pretty happy that it is doing everything that it should be doing. I have also knocked up some pretty basic instructions relating to the features of the EA. I have attached both the EA and the instructions to this post. If you need the indicators, they can be found on page one of this thread. As usual, if anyone does take the time to test it, any feedback, good, bad or ugly, would be appreciated. Thanks. Jim

Ignored

Jim,

Personally I can't use this EA on a live account, due to the martingale element. I don't have the stomach for it.

Nonetheless........ I'd like to acknowledge the great work performed by both you and Christina, and also say that it's EXTREMELY generous of you to share the EA freely here, especially as you've borne the time and development costs of producing it. Sadly, most FF members seem to simply take whatever happens to be freely on offer, without showing a shred of appreciation; MT4 is free, so they seem to think that everything else should be free for them also.

Hence I'd like to say a BIG THANKS to both you and Christina for your ideas and hard work, as (being a systems/software developer myself) I'm very aware of the time and effort that's required to make these projects happen. I hope many others will follow suit and do likewise.

Hey David, thanks for the kind comments. Bali was excellent, like always, even with Bali Belly on the last day before a 6hr plane trip. Longest trip of my life!

I can understand the reluctance to use a strategy that involves martinglae. No problems there.

One of my older EAs I tested for over 5 mths on a demo account really putting it through it's paces. It didn't miss a beat and added about 150% to the account during this period with a max 25% drawdown. Time to go live, and as Murphy's Law would have it, blew the live account. The funny thing was that I panicked and started interfering manually, and even though the demo went into it's largest drawdown to date, it still recovered nicely. I guess the point of the story is that not only is trading live completely different to demo trading, you also need a system where you can sleep at night and not wake up in cold sweats. And to make matters worse, I am in contact with a guy that uses this same EA and his live account is way up and he loves it!

I'm still looking at the longer timeframes using this method, and will even have a look at the 1hr on a few pairs. Here I can still monitor the trading throughout the day so it doesn't get away from me. I have no problems taking profits when they present themselves and then letting the EA start a new sequence if need be. As much as I would like to run it on the 5 min charts for sessions etc, I just can't see me doing that unless I am sitting at the computer watching, which is now a tad difficult as I have a stand up desk just to keep me away from spending hours at the thing. Maybe a laptop in a Jason recliner watching Fox Sports...

Again, thanks for the support, and good luck with your own personal trading and the business. Cheers. Jim

To David and others that aren't comfortable using a martingale type strategy to recover losses, I have decided to also supply you with a copy of my LACW EA. This EA uses the exact same indicators as the SAR EA, but there is no martingale involved. But there are a couple of slightly out of the box inputs that can be ignored if you wish. It also has a money management tool built in, if you want to go down that path. There is also the option of setting a stop, profit target, break even price and trailling stop. I have also attached some basic instructions for it that I sent to some others that requested it.

Just be aware that it will not take every single cross on the QQE, as it depends where that cross takes place compared to the central 50 level. On a buy, it is preferred if the cross takes place below the 50 level, and vice versa for a sell. Just higher probability trades. Get a hold of Forex Rebellion which explains it pretty well.

Have a play, try using the extended settings we have been talking about in this thread, and see what you think. Me personally, I would use it as a tool to get me into trades and then manage them manually from there on. This would be all timeframes. Cheers. Jim