Daily Fibonacci Signals

User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

H4 Wedge MA convergence breakout

Post by snailbeard »

Following on from the previous post, we can get the same breakout alert as above by a more complicated method which requires analysing the direction and proximity of moving averages so that we can detect a breakout from a convergence of moving averages.

Triangles with noisy bars can be difficult to see the wedges sometimes, whereas sloping MAs make it easier to spot sloping support and resistance lines. In the following chart the MA convergence helps locate a potential breakout:
EURUSD_M5_H4WedgeMaConvergenceBreakout_1235_10Jan2018.png
In this chart if we get the trigger between C and D then we might be looking at a 12 pip reverse before remaining in positive pips. On the previous price action chart a better entry at F meant hardly any bearish sentiment, thereby avoiding the need for larger stop losses.

A multiple entry system like the one I am working on is time bound to a single moment, but a more flexible system could spread secondary entries over several bars, if F is ranked as a better entry than C/D then one could risk more and use a closer stop loss.
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Triple entry first results

Post by snailbeard »

After being diverted away from implementing the the triple entry logic, I finally managed to get part of it working.
Hopefully, it can be cleanly switched off without affecting single entry trades.
On the now familiar but clean chart for EURUSD M5 we can see the initial trigger, stop loss and multiple take profit prices:
EURUSD_M5_FirstRunOfTripleEntryMethod_for12Jan2018.png
I was running with stealth mode SL/TP which is why the values in the results window (not shown) are completely different.
So phase 1 is complete, the Tp levels are unsophisticated derivatives of ATR, so in this example they are quite pessimistic about the range.

However, I am left with a number of bugs to fix:

1) There are two more unwanted repeat sets of triple entries occurring at 08:30 then 12:00 and these might be causing knock on problems.

2) The active monitoring does not move the stop loss to break even between 09:40 and 09:45.

3) The stealth take profit monitoring is not closing trades.

Hopefully, fixing the first problem will magically fix the other problems.

Update....
The active (stealth) stop/take profit method code has to be significantly updated to work with multiple entries, so it has been turned off for now. So the results are now much closer to the requirement:
EURUSD_M5_TripleEntry_codeFixesV2_12Jan2018.png
From this we can see 3 entries with a common stop loss and individual take profit levels.
At 09:45 price has moved enough to trigger the first take profit and move the the stop losses to break even.
However, do you see a remaining problem?
There should have been a modify stop loss for order #3.
Nevertheless, on this occasion it does not affect the outcome and at 10:40 order #2 reaches the take profit price.
And finally at 20:40 #3 reaches it's take profit price.
So this will be profitable on pairs which don't have deep reverses after the entry point but before break even and costly on pairs that do have early deep reverses.

Once the missing stop-loss updates are fixed I can to do some serious testing.

Update 2...
EURUSD_M5_TripleEntry_codeFixesV3_12Jan2018.png
It took me a while to track down a simple typo but we now have a usable triple entry method.
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Contrarian patterns

Post by snailbeard »

In the following chart there seems to be a high probability that we are about to have a breakout. The second observation is that price momentum is moving down (was moving down according to the MAs).
EURUSD_M15_looks_like_sell_but_0800_23Aug2017.png
However, this pattern was also a pause related to anticipated news, therefore we cannot know the effect of the news and we must follow the market movers or risk entering against the tide. Some of the manufacturing news was positive and good for currency.

The next M15 bar looks like a confirmation of a sell breakout:
EURUSD_M15_post_news_move_1015_23Aug2017.png
There is a strong bar down which might trigger many sell trades,
However, if we look closer at the M1 chart we can see some interesting patterns forming:
EURUSD_M1_false_then_real_breakout_1030_23Aug2017.png
Now we see that after a single large bar down price has stalled and a wedge is forming, the final bar of the wedge is a small bodied doji, then at 10:26 we get a significant volume and price shift up. A few more bars form a second wedge. However, the second wedge is higher and so we have a rising wedge. At 10:30 there is an absence of seller volume resulting in a gap up in price and and large shift in price by 10:31.
Finally, we now see that market sentiment is really bullish and although we have just seen 30 pips rush by, it is not too late to enter a buy trade.
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Do I intend to release an EA one day?

Post by snailbeard »

The following questions are asked from time to time:

Do I intend to release an EA/indicator one day?
Do I intend to produces alerts/signals?

The first question is easy to answer:
a) The EA is complex and CPU and memory hungry
b) I wouldn't want to be diverted/tied into supporting something unwieldy
c) I have not seen any evidence that EAs are consistently successful across multiple pairs or in the long term
d) If such an EA becomes possible and it was released then unscrupulous persons would package it and resell it

The second question is more interesting if it was about signals and alerts, note that EA and AT represent different things, an EA is an Expert Advisor so in a strict sense should not auto-trade but simply point users to interesting patterns and therefore a tool for
a) producing alerts
b) producing information about price movements

So if we want to simplify our trading life then we should
a) reduce the number of pairs to study - which pairs are most likely to have good trades/profits at this moment?
b) which entry patterns, stop loss and take profit are appropriate?
c) send an alert when a promising pattern is forming and/or when one has just happened
d) don't flood the trader with extraneous alerts

I believe alerts would be more useful to me and other traders. There are already some great signal generators being used by many members in these forums. Therefore, I wouldn't know if there would be much interest in another one. Although, at some point I hope that I can make signals available to other traders.

Although I have said EAs shouldn't AT, it would be useful to have a button for explicit permission to enter a trade for a short window of time. Perhaps, I am confusing two separate tools.
The first one generates alerts and the second one contains a collection of entry methods with options to be manually selected. Entries could be a set of pending trades or price triggered entries, long range stop loss or close proximity stop loss, thoughtfully chosen after reviewing the EA's alert and the charts.

We could even say there should be three separate tools:
a) the first EA tells us to ignore x,y,z and focus on a,b,c
b) the second EA spots patterns in a,b,c - should that be 3 EAs or just 1?
c) the third tool allows us to choose a pair and a type of entry/exit

There could be some common code in all tools, so there would need to be some library code.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

H4Trend unpicked fruit

Post by snailbeard »

I have now done a number of out of sample back tests for H4Trend combined with the triple entry method.
There are only two entry triggers for March 2017, which is due to the the large reverse swings of price movements. However, there are other entry patterns which might work well with these H4 bar swings.

In the following chart I have annotated e1 and e2 as two entry points which were successfully entered by the method under test:
EURUSD_H4Trend_unpicked_fruit_March2017.png
However, can we enter trades at the cyan rectangles by ORFB (Open Reverse Forward Break) when price develops upward momentum and recrosses the H4 open price? Can there be successful entries for the bars labelled A, B, C & D? Would this be a generically good method or would there be periods when this resulted in more failures?
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Empty4, MT5, JForex, cTrader?

Post by snailbeard »

For years we have complained about Empty4 and Crappy-Tester and discussed alternative platforms, but it has been hard to leave behind man-years of Empty4 specific utilities, scripts, EA's and indicators. So many of us have just delayed the inevitable for as long as possible. I seem to have reached the tipping point.

I am now so frustrated working around Empty4 history/data/testing issues that enough is enough and there was a theory for a while, that if I start working with DLLs again then I can move easily to MT5. It turned out to be a flawed idea in my case since I have several PCs and laptops running Linux for which the Window's layer (WINE) currently works well enough for Empty4, but when I came to install MT5 it requires different 'things'.

This would not normally stop me but all the other computers would have similar issues.

Another strong candidate is JForex from Dukascopy and in theory Java based JForex will run on any of my machines, I even thought it might run on a Raspberry Pi 3 according to the philosophy of Java's Virtual Machine (but again that was too optimistic regarding RPi3) and there is something non-Java-ish in those platform specific downloads.

I also looked at ForexTester 2 / 3 which seems like a great tool for testing manual trading strategies, but once again automated trading code locks you into a different API which would need translating to another platform in order to do real trading.

cTrader might be a good option for Window's users but on Linux similar or worse issues like MT5, so back again to JForex and after a trouble free installation on both a desktop and a laptop I think there is something which gives traders everything we need as long as we are happy to work with a new API and be locked into Java.

There is still an option to write the strategy as a separate program which communicates with JForex via network sockets. i.e. send a tick to the external program and check for a response, and if there is a response process it.
However, is the socket method compatible with back testing?

The feedback from Dukascopy is that sockets probably won't work properly during back-testing and the suggested solution is to create libraries as they are potentially more portable than a monolithic strategy file.

So now I am going to go and search for some bits and pieces I could reuse to test out my latest theories.
There is no way I can translate mega buckets of existing MQL into Java, therefore it is an opportunity to create a lean and mean EA from scratch using proper software engineering principles.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

A brief look at JForex

Post by snailbeard »

It is quite daunting to go off-piste and start coding in a new API and a different language. Something that you know you can code quickly in mql, or already have to hand. Its tempting to slink back quietly with ones tail between legs.

I am not giving up yet and keep reminding myself that it will be worth it in the end. The first bit of good news that I am not the first SHF member to go down this path and when you see this screen-shot you'll know why:
jForex-CSS-with-overlapping-multiple-pairs-for-Jul2017.png
The interface is easy to use but of course there are are also differences. The first positive is that we can overlay other instruments without using a custom indicator. Secondly, someone has rewritten CSS for JForex which is very encouraging and perhaps there are more code examples, snippets and libraries we can use to save a lot of time when moving our ideas into this new medium.

Those of you who have read my posts on CSS might remember that I asked the question is CSS a leading indicator or a trailing indicator, but I have never spent enough time on it and some members here are making good use of it.

The ease of having CSS in JForex and overlapping other pairs on the same chart means we can actually see how correlated or not the currency strengths are to price movements and we can also look for divergence or discrepancies. The main pair is EURUSD which is in a steady upward trend but with plenty of reversals.

I have overlaid 3 rectangles for CADJPY, AUSJPY and CHFJPY and these pair's prices appear to move significantly between June and July 2017. However, since we don't know how the prices are scaled relative to EURUSD we need to be cautious. Also I can only overlay a few instruments, so I might be showing the wrong pairs if there are other pairs with bigger price swings. Therefore, to do this properly I would need to have a custom overlay indicator which draws, say, the instruments with the greatest price swings. However, what if the pairs with the biggest swings in July are not the same as the pairs with biggest swings in June? So nothing is ever as trivial as it seems.

Perhaps the answer is to annotate with the top four movers for each bar, but if we are going to do that, why not just have a completely separate indicator at the bottom of the screen with top 4 movers listed bar by bar. Umm! The text would be too wide! We would need to colour code each pair, but that could be 30 different hues. I seem to be tying myself in knots.

So the question I am really asking is how well are CSS swings correlated to pair price swings? Are the correlations shifted bar +/-N bars? Are any correlations consistent for different samples?
Perhaps, someone has already done the analysis?

So keeping in mind the inadequacies of my chart, I added a vertical line on 26 Jun2017. It happened to be one of EURUSD's better days. However, what caught my eye was Blue JPY strongly moving down and EUR strongly moving up. Unfortunately, the first time I loaded CSS I didn't have the CAD and NZD history pairs which is why they are listed but not drawn on the chart. However, that is not the most significant information. Both CAD and EUR prices are steady risers relative to JPY, but the biggest contributing factor is the behaviour of JPY which in addition to falling, increases it's rate of change. This increase in the rate of change corresponds to the large swing in the CADJPY and EURJPY prices. It is not clear to me whether or not we would pick this up from the daily bars, but perhaps on H4. However, you could argue that we could have pending orders in place ready to catch anticipated price movements.

Many of you will remember that eventful day back in 2015 (15Jan2015) when some crazy Swiss bankers decided to release a forex tidal wave. I was wondering what the mult-pair history and CSS indicated for that moment looked like:
jForex_CSS_for_EURCHF_event_15Jan2015.png
The first thing is a big thank you to Dukascopy for allowing us to access all this history data and not deliberately sabotaging it like Empty4 brokers! Which is why I am here exploring JForex.

From the CSS we can see that the green EUR line is going down and the Swiss are doing their damnedest to keep going down, but if you look closely just before the event: the CHF appears to reduce its rate of decent and the EUR is winning the race to the bottom. It seems if Alpari's 'professional' traders had been members here and paying attention to NanningBob and CSS they would still be in business! Of course the collateral damage on some other pairs was very bad for many traders.

Those who were already selling EURJPY at the time thanks to CSS must have made a mint though!

I wonder how many of you would vote to make the Swiss bank compensate those who lost out due to the bank's recklessness?
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Signal following Dukascopy

Post by snailbeard »

I have been too side tracked to do much trading or coding, but I did spend some time sifting through the winners of Dukascopy trading challenge, but only those doing well for 12 months. The majority at the top have around 50% average draw-down, however, some steady traders in the top 50 have lower draw down.

So I set up some small scale live copy trades for 3 traders.

Another observation was that quite a few successful traders are using support and resistance based entry using pending orders. Despite my concerns about order hunting and stop hunting this can work for some time frames.

In the following JForex H4 chart we can understand the choice of price levels in relation to the H4 bars OHLC. Although, we don't know the actual decisions which could be based on other forms of support and resistance, such as Fibonacci retracements.
GBPUSD_H4_DK_PO_SL_TP_2018-06-22_1204.png
Overall, in the longer term price is moving down, but the signal provider is expecting a reversal if price goes back over the threshold price at 1.3170. The initial SL and TP are well chosen to give the trade room to swing down further. Once the trade was going well we can see with hindsight that a trailing stop loss killed the trade prematurely. However, going against the longer trend does require extra caution. Nevertheless, I added a dashed line to show (again with the benefit of hindsight) that the trade needed more room. It is not clear why the trailing stop is on the wrong side of the H4 doji, as I am sure most of us would have gone for the 1.3192 level below the doji body rather than above it.

The following M15 chart shows more clearly how the trade unfolded:
GBPUSD_M15_DK_PO_SL_2018-06-22_1235.png
Now we can see that the order was triggered around UK late morning and that after a gentle pull back there was strong price action upwards, but the premature trailing stop above the close the M15 bar was a strange choice.

So the jury is still out, and I'll continue to follow these signals with micro lots until I have more time to do my own trading.
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Curvefitting by Forward Testing

Post by snailbeard »

It has been a while since my last post as I have been diverted by other interests and frustrated by the elusiveness of consistent profits.

Those who have a background in statistical analysis and tools to process large amounts of data have a distinct advantage over most of us. Analysis can bring out correlations and anti-correlations. It might also be possible to look at a wider range of variables.

Experienced automated trading developers have seen the pitfalls of back-testing especially with crappy-testers which use inaccurate data and don't include real costs like commissions, slippage and swap.

When I found out that Dukascopy provide accurate data and their back testing includes multi-pair optimisation my interest was piqued.

Some of the strategy testers I looked at include 'forward testing'.

Lets say 100 people forwarded tested an EA with different parameters for 12 months and saved all the data, then you have an accurate recording of the past 12 months.

What if you have a platform that is sufficiently accurate so that it can replay the data and run the EAs so that the results match? Is there such a platform?

The market-movers must have such platforms. In addition, Dukascopy claim to have accurate data.
However, I don't have sufficient experience with their tester to know how accurate it is in reality, but the output report does include commission costs and pip-based swap adjustments:

2019-09-03 16:00:00 Order filled Order [IVF20190903_16000061905728, EUR/USD, SELL, 1000.0 at 1.09668] filled

2019-09-03 21:00:00 Commissions Commissions [0.02]

2019-09-03 21:00:00 Overnights Overnight commission [0.5433] pips applied to order [IVF20190903_16000061905728, EUR/USD, SELL, 1000.0]

Not only does it do this but they claim to provide multiple-pair historical testing, so I thought I would put that to the test with one of their example programs like an SMA trend trading bot.

The historical tester does allow you to select multiple pairs like so:
jforex_multipair_backtest.png
However, when I checked the report only the initial default EURUSD had trades, so I am still on a learning curve and perhaps the code needs to be adjusted as well.

Nevertheless, when I ran an optimisation test I was able to add more pairs and this did provide interesting output, although we know it is really just temporary curve fitting:

In the following results I ran a historical test for the previous 1 month for both EURUSD and AUDJPY, for SMA of 1 hour bars. It shows that there are occasions when lagging indicator based EAs can make profits.
JForex_2pair_optimisation_1month.png
So how does this relate to forward testing?

The argument by some historical-testing-platform sellers is that they split the data in half lets say you have 12 months of history so the tester uses the older 6 months for optimisation and then runs the best parameters against the later 6 months.

The argument is that if the data and simulation are accurate the output from the later six months should mimic your own forward testing had you started with those parameters six months ago.

I don't know if any commonly available historical testers can be as accurate as a real-time forward testing, but I am interested to wonder if 100 parallel forward tests will find the best parameters for the past 12 months, but will be curved fitted to the past and not useful for the future?

Are the price movements of the next 12 months always somehow different from the past 12 months, because I suspect that this is often the case. Actually, I know it for a certainty that this sometimes the case.
Even if I optimise for 2017 and find profits for 2018 how likely is it that 2019 will still behave like the past?
Somebody with access to extensive resources, reading this question must be chuckling, because they have already seen the answers. Perhaps, there is actually a well written book about this topic?

Perhaps before I commit myself to a year of forward testing I should properly understand whether forward testing is significantly different from slow motion historical testing.

To help me explore this concern I have written a simple noddy EA for Empty4 called RandomM15 which I'll describe in my next post.
You do not have the required permissions to view the files attached to this post.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

KISS profits and losses

Post by snailbeard »

From extreme complexity to stupid simplicity. I have tried all sorts of things to stop trading when price movements are suboptimal. However, the only thing which is consistent is the variations in profits over time.

So I came up with the theory that a stupidly simple trading robot would in the long run be no better or worse than an extremely sophisticated one (but only in the context of what is 'complicated' for a single programmer with limited tools and resources).

I also postulated that profits and losses have more to do with take-profit and stop-loss ratios than trading algorithms, on the basis that 1000s of programmers have tried 1000s of algorithms for years. i.e. most of these algorithms can be profitable for a subset of pairs and subsets of historical and future price data, but none of these algorithms can be run without frequent manual intervention.

There is also a fallacy about the need to abandon algorithms that once worked but appear to have stopped working. It has been found that market conditions can be cyclic so that retired trading methods start making profits again.

* The difficulty is that in the long run the loss making intervals usually out last the profit making intervals. *

This led me to reflect on automated trading competitions and therefore I suspected that winners disappear because (out of thousands of competitors) they could only win from a combination of high risk and exactly the right market conditions. The TV celebrity Derren Brown used horse racing and a 1000 volunteers to demonstrate that it is possible to create a myth that one person wins all the time. Finally, of course, our 'super trader' loses and the audience are shown why.

This would explain why so many leaders from systems like Zulutrader disappear into oblivion after a period of time.

And this is why I think stupidly simple algorithms can be similar in performance to sophisticated robots (over the long run).

One consistency I have noticed in every chart that I have examined is the presence of Fibonacci ratios and sometimes surprising how far into the future that support and resistance level are consistent with Fibonacci levels.
Although, they sometimes impede momentum they don't necessarily tell us anything about direction.

I implemented RandomM15 with the intention of entering 0.01 size trade every 15 minutes. However, to avoid over trading I added a time window limiting the opening of new trades and also a minimum price movement.
In addition the trading direction is not totally random, instead if the bar closed up it enters a buy and vice versa.
I also chose some ridiculous SL to TP ratio of 10:200.

This results in a trend following bias with lots of small losses in ranging periods and spectacular profits during well defined trends.

The important consequence is the large number trades: meaning the results are statistically meaningful,
and therefore the behaviour of the algorithm is well understood:
RandomM15_12mnths_wild_Tp200_Sl10.png
So there are alternating sequences of profits and losses caused by variations in price behaviour.

In the next post I'll show that the results can be a lot more interesting. That might be a while as I have finally crossed the jForex barrier and I'm currently using most of my spare time in this new programming environment because of the easy access to lots of data.
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Automated trading systems”