Daily Fibonacci Signals

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

USDJPY - identifying a falling channel

Post by snailbeard »

Following on from the previous post, I have now added logic to identify both OBV and price channels over an 8 hour period.

The following chart shows the relative lower highs and lows over a period of about 8 hours:
USDJPY-M15-identify-falling-channel-1700-3April2017.png
So we can now use this take precedence over the weaker up trend. The following extract from the log file shows how the EA interprets these calculations:

Code: Select all

17:00 USDJPY: :  
 b36M15ObvChannelUp: 0 b36M15ObvChannelDown: 1
17:00 USDJPY: :   M15PreBreakoutDown-Alert-3SB
17:00 USDJPY: :   M15PreBreakoutDown-Alert-COBN
17:00 USDJPY: :  
 b36M15ChannelUp: 0 b36M15ChannelDown: 1
[/size]

So now instead of continuing to generate pre-breakout up alerts, it is able to inform us about a potential sell breakout.
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

USDJPY ambiguous signals

Post by snailbeard »

Since I started testing the EA on USDJPY I found a whole new set of challenges in the form of interpreting patterns. So if we say this mainly an M15 based approach: other time frames need to be monitored and analysed.
The aim is to be right often enough to be consistently profitable.

The following M15 chart ticks a number of boxes for predicting a buy breakout:
USDJPY-M15-rising-channel-14April2017.png
So there is a triangle formed by the orange and purple slow moving averages and at the same time the outlook is currently upwards as both price and OBV create rising channels. However, the first part of the day is often opposite to the main move of the day. So it is important to analyse other time frames as well. I am not currently doing enough because the current analysis leads to the wrong decision and when we look at the H1 chart we will be able to see some obvious warnings against buying too soon:
USDJPY-H1-price-moving-towards-breakout-14Apr17.png
A look at the trades at the bottom of this image shows the buy entry at 06:45 14April2017 went quickly to the stop loss.
Looking at the chart we see the same familiar triangle but the red MA appears to be in use as a significant resistance level by the market and going against the market is more risky than going along with it.

The H1 bars have long wickies at 'A' and the H1 bar close to C are closing below C so we need to take this into account and wait for for more information.
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

It takes 3 to tango

Post by snailbeard »

I spent a significant part of last week looking at April results for USDJPY in order to understand why it was such a bad month for the current method. This helped me unearth a number of bugs and I also discovered some completely different strategies used by a friend of mine (which also had a torrid month in April).

I was interested to hear that he has been having steady successes with a signal service and I saw it as a challenge to guess their method from their results. It is good to have a combination of strategies to compensate for the complementary strengths and weaknesses, so this being a 'one to two week' strategy it complements the Short-Range-Trades method.

After looking at about 6 of their trades my guess is that it is a combination of (D1) stochastic, candle pattern and something like Bear/Bull power. Whether or not this is correct it does seem to produce interesting results in my small amount of analysis.

Lets describe it as a reversion to the mean strategy, so the precursor is something like a Stochastic Oscillator at the extremes and starting to revert. Since my monster EA already has some old routines for SO I extended them a bit to give 'days of interest' indication, we can see this from the log file:
GBPUSD-StoOsc-Days-Of-Interest-April2017.png
So a highlighted day containing HtoL means the stochastic is or was at the top but is now less extreme than it was and conversely 'LtoH' means the opposite, so this is not a signal but tells us to keep a look out for a potential reversal. So experienced traders will know that the stochastic is a pretty fickle beast and has to be properly understood, in a strong trend reversals against the trend are short lived or imaginary.

In order to believe the stochastic we need something tangible and candle patterns might help us out, so a doji followed by a reversing bar could be a good pattern to spot. We are likely to see at least some pull back but it could be short lived. So we need another partner in this up down dance and I wonder if it could be bull/bear power. I have never really looked at this before, just another lagging indicator, but we are not looking for a signal because we took the signal from the candle pattern, instead we are asking about the strength of the reversal should we run with it or take an early exit?

In the following D1 chart I have marked the areas of interest with rectangles:
GBPUSD_D1_FIL_alerts_March2017.png
So the stochastic at 'A' is rising for several days and during this period we can see a candle pattern at 'B' which can be a sign of reversal and finally once we are in the buy trade we need to make sure the bulls are stronger than the bears. This all looks good for ABC and it requires an appropriate exit method such as a trailing stop.
According to 'D' we should already be out of our buy trade and looking for a sell opportunity and we see 'falling pins' at 'E' so let's enter a sell and watch what happens. The next day ends with a doji above a slow moving average, a possible indication of a reversal to the up side. It could just be a pause but if we look at the bear power it is weak and the bull power is positive so perhaps it would be good to make a sharp exit.

I would be interested to know if any experienced traders think there is any mileage in this approach, as I am considering adding it into the EA's toolbox?

Perhaps, one of the EA's in the this forum has already been here and done that?

If this method doesn't already have a name I am thinking of 'StosCandyCowPat'.
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

12 month accumulator

Post by snailbeard »

Last week I tried following some of the alerts from the EA, it even predicted the Gold buy entry on Friday (which I was unable to trade as it occurred at 4am and the price had already moved by the time I saw it).

However, I did follow some of the D1-Stochastic-Bull-Bear alerts with patience being rewarded on Friday.

Most of my focus was on increasing the number of good alerts, for this I had to introduce the concept of reflection which is an aspect of price pulling back before continuing in the main price direction for the day.

There are a range of candle and moving average patterns which suggestion price reversal on different time frames. It is very time consuming to describe them and code them.

Here is one example which could be described as Harami reversal:
GPBUSD-M15-Harami-reversal-at-SM1100-1300-16Mar2017.png
So the yellow slow moving average tells us that the daily price is probably up, while the fast moving red and blue averages tell us that price is moving down. Then at A an M15 bar closes with a long tail above the yellow MA, which is our first hint that there could be a reversal, then the bar at B is a doji inside the previous bar and this Harami pattern often indicates a price reversal, so on the opening of C we can take a chance on buying with a large take profit to small stop, so that if successful we will suck up lots of pips for a very good profit-to-loss ratio.

However, this is just one example, of a price reversal at a moving average and there are many combinations, so I have coded a few of them. Many times these trades get stopped out. They are only worth trading if we can find enough good ones to outweigh the large number of failures, which is why I prefer to see manually what is happening on other time frames before making any decision.

After much intensive and complicated trade-offs, I came up with more potential entry alerts, however, this usually means falling into a curve fitting trap, after all, pattern matching is curve fitting. To get a better understanding of the alerts, I needed to see what happens if I traded them over 12 months:
GBPUSD-12months-pip-accumulator-28May2017.png
So this rather scary trading method seems to win a lot less than my more cautious methods, has long nail biting periods with brief periods of big profits. It is certainly not a method for the faint hearted but it does seem to work in the long term. The orange rectangles are where there are a long series of failed entries. the narrow green rectangles are the occasional big winners.
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

JOAR dropping pips

Post by snailbeard »

JOAR is short for 'Just Open Above Rising' which is in itself shorthand for detecting that a bar has just opened above a rising moving average. It's opposite is JOBF. So it is a generic concept which we can apply on any time scale and also on any moving average. Sometimes these JOARs and JOBFs are more significant. We can develop entry methods by using these patterns in combination with other logic.

Some of the EAs in this forum probably make use of the idea. I have been using the concept to both corroborate and inhibit entries and below is the latest code for picking up one variant of this entry method:
Code-sample-for-M15H1H4D1-JOBFH4-May2017.png
In this example we are trying to detect price reverting to a MA before continuing to move with the longer time frame. One could actually loosen the strings on the entry method if you wanted to run with bigger stop losses and longer periods, but this is a picky version which tries find an entry at a better chance of good stop to profit ratio.

The entry method could be used manually or auto-traded. There is an example of this pattern for EURUSD at 21:00 on 2017.12.14, here is the corresponding M15 chart:
EURUSD-M15-entry-by-M15H1H4D1-JOBFH4-2100-14Dec2016.png
In this chart we do not get any indication that the long term direction is down, but we do see the familiar triangle formed by the slower moving averages (green, brown). The decision to only sell has already been determined by other calculations and the M15 analysis helps us to line up our ducks before pulling the trigger.

Why do you suppose there is a big price jump down at 21:00?
Can it be that someone with a lot of clout has decided to make their move?
What if my entry is not calculated until 21:15?
So for us small players there is no point making a move after the movers and shakers: we need to know when their triggers go off and pull ours first if we don't want to miss the big move.

However, unlike Captain Jack who is sitting with his finger over the sell button, I don't have the patience to watch the chart for the right moment to enter the trade, I'm sure CJ gets it to the minute and makes a huge return and takes the rest of the week off.

However, the donkey work comes from D1 and H4 with some help from H1. So really we should start from the top and work down. Here is the D1 chart which tells us that buying is a lot hard than selling:
EURUSD-D1-M15H1H4D1-JOBFH4-2100-14Dec2016.png
From this we get a clear sense of going with main down direction and at 'A' we have a small bodied doji under a fast and falling moving average, so we read this as an indication that price is likely to start falling again.
The long term traders might see this as enough to go short, but using a significant stop loss, so in a ranging market profits can be quite limited. However, you don't need all that secondary analysis just to go short. It is only needed if you want to pick the time of entry to improve your profit to loss ratio. In a non-ranging market an entry here could easily bag you a weeks worth of pips, but these days those straight runs are less frequent.

At 'C' we see that price rises before it falls and our smart entry point occurs after 'C' but the auto-trade only bags a cautious amount of pips. Can you trade the alert manually and bag more pips?

Many traders like H4 and it is good place to hunt the Snark:
EURUSD-H4-M15H1H4D1-JOBFH4-2100-14Dec2016.png
Again there is no prior sense of an imminent sell without D1, by itself this chart could be about to breakout to the upside, but thankfully we have that D1 doji, but still my EA hates entering trades just before an important moving average as that is often a mistake and it is not easy to get it to accept an entry until price has passed the yellow MA. The entry price is at the green dashed line which is after SMA60 but before LWMA60 and before SMA100. It was necessary to bend the logic to make this entry work.

Finally, if we take a look at H1, we can see the threat to the close proximity stop loss:
EURUSD-H1-M15H1H4D1-JOBFH4-2100-14Dec2016.png
H1 is key to timing for this particular case, we are particularly interested in A,B & C. A and B are the signature spikes in price before the real price move. Some traders think they are market movers and stop hunts but they are quite common before the real breakout, so I have added code to detect them as another tool in the tool box.

From the log file:

Code: Select all

21:00 EURUSD: :  bH1DualDojiStopHuntPassed && bY1BarDown
[/size]
This can give us another duck in our line of ducks
At C we see the bar has opened just under the brown MA (slow) and the red MA (fast).
We can say that these two MAs have merged and price is below (after a Doji and Hammer) and since we are waiting to sell there is no better time than the opening of this H1 bar at C. We don't really need the M15 confirmation.

The stop loss could even have been half what it is, we could have had P/L=10 instead of 5. However, the wider SL results in fewer stop hits. The trade goes on to take 96 pips with room to spare.

So its back to EA to detect more entry patterns with better entry points.
You do not have the required permissions to view the files attached to this post.
zyx
Trader
Posts: 84
Joined: Thu Jan 29, 2015 12:42 am
Location: San Diego

Pre-Breakout-Alerts

Post by zyx »

snailbeard » Wed Apr 19, 2017 12:54 am wrote:
I have added some code to find a number of small bars at a line of support or resistance. This the market being indecisive about price direction and often precedes a breakout. We often see several false breakouts before the real move starts.
Hey man I was searching for a way to get alerts for small bars and this post popped up. Small bars at S/R after an impulse is something I look for intraday but its hard too many pairs.

Is there anyway to make a simple alert for a small bar?
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Pre-Breakout-Alerts

Post by snailbeard »

zyx » Wed Jun 07, 2017 1:48 am wrote:
snailbeard » Wed Apr 19, 2017 12:54 am wrote:
I have added some code to find a number of small bars at a line of support or resistance. This the market being indecisive about price direction and often precedes a breakout. We often see several false breakouts before the real move starts.
Hey man I was searching for a way to get alerts for small bars and this post popped up. Small bars at S/R after an impulse is something I look for intraday but its hard too many pairs.

Is there anyway to make a simple alert for a small bar?
There are many ways to find SR levels, many time frames and what is the threshold for small or not small. One could write a generic function first and pass it parameters or produce a lot of specific functions.
I have ended up repeating a lot of similar code. I would create generic classes with more specific instances if I was starting again. I was reflecting that it could be possible to reduce a number of arithmetic relationships to true or false outcomes, then have a multidimensional array of boolean results which could be passed to a machine learning algorithm which finds the best combination of flags for entering trades. Some people must be trying that approach already...
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Serious bug with OrderSymbol

Post by snailbeard »

This is a new problem and only started after Empty4 was updated, I am going to try and force the older version to run with the same EA's. However, it could be my mistake? I was under the impression that each EA has it's own memory space for OrderSymbol() and OrderSelect(). I wasn't aware that when two or more EAs are selecting symbols in their own memory space that they would trample over each others OrderSelect() data.

I added some logic to the EA to be more explicit about the currently selected order in the EA's separate memory space so it can detect if the OrderSelect from a different EA has trampled over it's selected symbol:

Code: Select all

0	08:15:00.139	marjoram EURJPY,Daily: Alert: EURJPY: M15PreBreakoutParams:  M=1a  ?Buy?  (Ask?Sl?Tp?),123.609,123.409,124.674, P/L=5.32
0	08:15:00.324	marjoram USDJPY,M15: Alert: USDJPY: M15PreBreakoutParams:  M=2b  ?Sell?  (Ask?Sl?Tp?),110.311,110.511,109.610, P/L=3.50
2	08:15:00.623	marjoram USDJPY,M15: open #77636609 sell 0.31 USDJPY at 110.308 sl: 110.511 tp: 109.610 ok
0	08:15:00.624	marjoram USDJPY,M15: Alert: USDJPY: Sell-signal: AlertAllowed(0/1): 1, CurrentHour: 10, AlertsFromHour: 9, AlertsUntilHour: 21
0	08:15:00.725	marjoram EURJPY,Daily: Alert: getRunningOrderProfit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.725	marjoram EURJPY,Daily: Alert: checkforM15_SRT_Exit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.725	marjoram EURJPY,Daily: Alert: : Error Expect Tk: 77628469, alien Tk: 77636609
0	08:15:00.809	marjoram EURJPY,Daily: Alert: getRunningOrderProfit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.809	marjoram EURJPY,Daily: Alert: checkforM15_SRT_Exit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.809	marjoram EURJPY,Daily: Alert: : Error Expect Tk: 77628469, alien Tk: 77636609
0	08:15:00.870	marjoram EURJPY,Daily: Alert: getRunningOrderProfit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.870	marjoram EURJPY,Daily: Alert: checkforM15_SRT_Exit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.870	marjoram EURJPY,Daily: Alert: : Error Expect Tk: 77628469, alien Tk: 77636609
0	08:15:00.899	marjoram EURJPY,Daily: Alert: getRunningOrderProfit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.899	marjoram EURJPY,Daily: Alert: checkforM15_SRT_Exit(): Error OrderSymbol Does not match CURRENRPAIR: EURJPY, alien pair: USDJPY
0	08:15:00.899	marjoram EURJPY,Daily: Alert: : Error Expect Tk: 77628469, alien Tk: 77636609
[/size]
In case the above is hard to read, here is a screenshot:
MT4Terminal_Client_OrderSymbol_problem_Jun2017.png
I would interested to know if anyone was experiencing problems which would be explained by the above issue?

Do we need to write our own order symbol management library to avoid this problem?

How many people in this forum have switched to a better trading client?
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Daily Fibonacci Signals

Post by SteveHopwood »

Anybody else come across this problem? I am not sure I would notice if I did.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Daily Fibonacci Signals

Post by tomele »

Hi.

Very hard to judge without knowing your code. On the other hand very easy to verify. First let only one EA run. Then add a second one. If it works flawlessly with one and starts creating those errors after adding the second one, it is worth a serious investigation.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
Post Reply

Return to “Automated trading systems”