stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Daily Fibonacci Signals
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4100
Page 14 of 21
Author:  snailbeard [ Mon Jan 23, 2017 6:27 pm ]
Post subject:  What to trade - looking back

Find Signs of a D1 Trend continued

I found some quirks in some results and tried to work around a drop in ATR due to resting phase.
Two particular days of interest recently are 17th and 18th of January because the 17th was a good trading day on several pairs followed by a pull back day also on several pairs due to the correlation between pairs.
GBPUSD-D1-rising-interest-snapshot-18Jan2017-AtrObv.png
When we look at this view of ATR, volume and OBV there is no doubt that something interesting is going on and there have been some excellent trading days. Mrs Snailbeard keeps coming into my room, pointing at the screen and demanding I want that, meaning FBATT and more recently FSD1T because less thinking is involved.
However, does she understand the difference between a trend and a signal?
She is not in the habit of reading my other posts, so I am a little worried about how she will use it.
AUDUSD-D1-Jan2017-18th-prediction-was-view-to-buy-18Jan2017.png
So if we blindly buy on the 18th because the FSD1T says we have a buy trend we would have a bad day as you can see from the white pull back bar, but 19th was another good up day. This tool is just way to get a quick overview of interesting pairs and the EA looks at many other short term factors before entering a buy trade.
Author:  snailbeard [ Tue Jan 24, 2017 3:25 pm ]
Post subject:  comparing methods

I am hoping that I can get the results from FSD1T and FBATT to be closer to each other, but FBATT is probably better for commodities and perhaps shares, which can have much longer cycles than fast switching currencies.

The following chart of USDJPY for 17th shows both a well defined trend and a perfect day for selling:
FSD1T-great-day-for-USDJPY-17Jan2017.png
Do both trend spotter methods pick up this pair and tell us to look more closely?
compare-FSD1T-and-FBATT-for-17Jan2017.png
Both methods pick up USDJPY as interesting but without more information many pairs are also on the radar.
FBATT is useful in telling us to watch out for fat spreads in relation to the daily range.

AUDUSD was picked up in the quick view but not in the long view.
It was a good trading day for AUDUSD and the spread as far as I know wasn't too high on the day and this might be a limitation in my attempt to run FBATT in the past?

In order to find out more about AUDUSD in January I have just run a back test to see how many trades it makes. We know that this EA is very picky and it only traded once for January despite what appears to be several very good opportunities.
In the following screen-shot we see that our EA is not superstitious, and the only day it liked was Friday the 13th:
AUDUSD-buy-trend-and-entry-13Jan2017.png
Note the duration of the trade, we are kept in the trade for whole week, which increases the risk, this is the necessary consequence of trading when price moves are limited in proportion to the spread!
Author:  snailbeard [ Tue Jan 24, 2017 4:07 pm ]
Post subject:  Where's my cheese?

In the last post I mentioned the absence of more AUDUSD trades and thought we might have had a buy entry on 11th January 2017 so I need to look at the log file to find out why it was missing an apparently easy trade.

The following M15 chart shows there were at least a few good places to join the trend:
AUDUSD-multi-chances-to-trade-11Jan2017.png
Although, entering at 'B' might have resulted in a stop hit, an entry at 'A' might have succeeded, and entering at 'C' would have been plane-sailing with no significant price reversals. So where is my cheese?

It seems that the EA is troubled by a lack of momentum:

Code: Select all

05:15 AUDUSD: :  MAIN: signal-cancelled: bCancelEntryByFallingAtr!
05:45 AUDUSD: :  MAIN: signal-cancelled: bCancelEntryByFallingAtr!
[/size]

Although, we might speculate that it is being too picky, don't forget there is a big dipper coming later in the day!

According to the log file it did acknowledge break out with momentum later in the day:

Code: Select all

09:00 AUDUSD: :  TRACE   3H1 Bias:   1 , Priority:  2H1BreakHigher  d1v<<^H1: +1  H1>>d1: +1  i3H1_YCYL: +1  ^|^|^P  ^Tails^: +1
09:00 AUDUSD: :  3H1BarPriceMoving: 1; H1Has3BarBkOutMomentum: 1
09:00 AUDUSD: :   Significant M5 ATR DRF(b) M5-ATR-D1RangeEst: 0.00745
[/size]

Despite picking up this breakout, it didn't get translated into a entry and I put it down to the complexity of the decision logic :uff:
Author:  snailbeard [ Fri Jan 27, 2017 12:12 pm ]
Post subject:  Something lost behind the Ranges

"Something hidden. Go and find it. Go and look behind the Ranges --
"Something lost behind the Ranges. Lost and waiting for you. Go!" - Kipling

Yes indeed something has been lost behind the ranges and those previous posts about estimating the daily range are an important part of understanding how this EA makes some of it's decisions. The reason that it misses out on some good January AUDUSD trading days is due to falling ATR (often a sign of a weakening trend), so changing anything to do with this could have terrible consequences for other pairs and choppy markets.

So looking at the log file for 11Jan2017 revealed that the estimated range for the day was much smaller than the final end-of-day range:

Code: Select all

Actual Range: 0.01197
D1 Atr Est: 0.00609 
H4 Atr Est: 0.00557 
H1 Atr Est: 0.00880
[/size]
The H1 estimate is never used but perhaps sometimes it should be?
How would we decide to use the H1 based daily range estimate instead of the D1 based range estimate?

We could look at recent past bars and ask the question:
Were any of these recent past bars bigger than expected?
However, one of those nasty price jumps which happen more frequently could make the answer less useful.
So any code changes here are going to be experimental.
Experimental-dynamic-range-adjustment-25Jan2017.png
In the following image I have labelled 11th, 13th and 23rd, as we now accepting 3 buy signals instead of just one, however, one of those comes just before a significant pull-back and turns into a loss:
AUDUSD-D1-finding-more-entries-by-dynamic-range-estimate-Jan17.png
However, if a trade is still running after 48 hours and not making any progress we could choose to terminate it before it reaches the stop-loss.

So on the start of a new day we might want to refresh some calculations, check if any trades are open, and check if they seem to have stalled. This could result in side effects such as terminating trades prematurely so this is another experimental change.

For AUDUSD in this particular month I can get the desired behaviour.
Checking the log file allows me to see what happened:

Code: Select all

00:00 AUDUSD: :  getOpenedOrder():  iNumOfDaysRunning: 2
00:00 AUDUSD: :  calcStealthStopLossFromHard: dM60AverageSpread: 0.00020
00:00 AUDUSD: :  New D1: refreshOrderInfo() ID: 3, Type: 0
 Hard SL 0.75165, Hard TP 0.76835
 Soft SL 0.75..., Soft TP 0.76...

00:00 AUDUSD: :  checkForCloseOldTrendTrade: close old trend trade
00:00 AUDUSD: M1:  checkForCloseOldTrendTrade(): 
 ExitBy24H_FallingD1Atr: 0
 IsAtr3D1LtAtr100(): 1
 IsD1SlopeFlatStraddled(): 0
 bTradeHasReversed: 0
 bTradeIsGettingOld: 0
>>> bTradeIsNotMoving: 1 <<<
 iExitResult: 3
[/size]

So we can see that the trade has just started it's third day since opening and the EA believes the trade is not progressing ( bTradeIsNotMoving: 1 ), so we get a pre-emptive exit.
AUDUSD-D1-stalled-trade-pre-emptive-exit-0000-25Jan17.png
Both of these options require a lot more testing for multiple pairs before we will know if they are going to be of any long term benefit.
Author:  snailbeard [ Mon Feb 06, 2017 11:04 am ]
Post subject:  Thick and thin spreads

Having spent a bit more time with FBATT (Find best assets to trade), I noticed that the spread calculations were a bit quirky. On investigating further, I realised that using a snapshot spread only makes sense during active session hours, even then we can get brief spread widening which could coincide with the moment we choose to run FBATT, so I have modified it to take advantage of the spread monitor and average spread. This results in a useful improvement as we can see from the FBATT snap-shots run at different times of the day:
FBATT-daily-spread-fluctuations-01Feb2017.png
From this early morning update on the left there is a lot more red than the previous day's afternoon.
So we can see how the entry/exit cost varies a lot more for some pairs than others.

This is still not an ideal spread history and it would be better to have a 24H spread monitor saving updates to CSV file, which can be loaded by FBATT and other programs, to allow them to better estimate the cost of entering and exiting the worst pairs and what parts of the day to avoid for certain pairs.
Author:  snailbeard [ Fri Feb 10, 2017 12:37 pm ]
Post subject:  GBPNZD - oh no! he's gone & dunnit again!

I did not initially suspect the losses were due to a bug.

Here is the daily view of GPBNZD:
GBPNZD-D1-1win-2losses-Jan2017.png
Entries 'A' and 'B' look like they should succeed, but 'C' is obviously just caught out by the rapid reversal.
So why two losers and one winner instead of two winners and one loser?

Yes it looks like I fixed one thing but added a new bug in the dynamic stop loss exit trade code.
No amount of optimisation is going to help fix these results:

A closer look might give a better idea:
GBPNZD-M15-optimisation-possibilities-Jan2017.png
The initial trade parameters with dynamic exits, on the 13 Jan 2017

Code: Select all

 dAdjustedLots: 0.080
 dTrigger: 1.71150     (1.72070 - 1.71150 = 0.0092 ) 
 rTakeProfit: 1.69310
 rStopLoss: 1.72070

dHardStopLoss: 1.75732     (1.75732 - 1.71150 = 0.04582)
rdHardTakeProfit: 1.65648

dStopDistanceInPoints 971.000000
dStopLossOffset: 0.03662
[/size]

The next day the EA refreshes the the dynamic parameters from the hard parameters,
but there is a problem:

Code: Select all

00:00 GBPNZD: :  getOpenedOrder():  iNumOfDaysRunning: 1
00:00 GBPNZD: :  calcStealthStopLossFromHard: , iType: 1,
 dHardSL: 1.75732, dSoftStopLoss: 1.75632,
  dHardTP: 1.65648, rdSoftTakeProfit: 1.65748,
   dM60AverageSpread: 0.00050, dStopLossOffset: 0.00100
00:00 GBPNZD: :  New D1: refreshOrderInfo() ID: 2, Type: 1
 Hard SL 1.75732, Hard TP 1.65648
 Soft SL 1.75632, Soft TP 1.65748
[/size]

Now that I understand what I have done wrong do we have a solution?

Creating the hard stop loss offset in CrappyTester Testing mode
requires a work around for gapping assets,
so this does not apply to the live EA!
However, this is what was set up with the work around:

Code: Select all

13:45 GBPNZD: :  calcSafetyStopLoss: , iType: 1,
 dCurrSL: 1.72070, dHardStopLoss: 1.75732,
  dCurrTP: 1.69310, rdHardTakeProfit: 1.65648,
   dM60AverageSpread: 0.00050, dStopLossOffset: 0.03662
[/size]

Refreshing order details every so often for the stealth stop loss and take profit
was not symmetrical:

Code: Select all

00:00 GBPNZD: :  getOpenedOrder():  iNumOfDaysRunning: 1
00:00 GBPNZD: :  calcStealthStopLossFromHard: , iType: 1,
 dHardSL: 1.75732, dSoftStopLoss: 1.75632,
  dHardTP: 1.65648, rdSoftTakeProfit: 1.65748,
   dM60AverageSpread: 0.00050, dStopLossOffset: 0.00100
[/size]

Note that on creating the trade the offset is 0.03662
and on refreshing it is 0.00100,
so I failed to use the test mode work around on refreshing the hard offset,
but on top of this using a spread based value (which is indeterminate)
introduces additional uncertainties. So moving to a fixed offset for live
and test-mode would solve the variable spread issues.

After changing the code to use fixed offsets in both calculations means we now get back what we started with:

Code: Select all

13:45 GBPNZD: :  calcSafetyStopLoss: , iType: 1,
 dCurrSL: 1.72069, dHardStopLoss: 1.74069,
  dCurrTP: 1.69309, rdHardTakeProfit: 1.67309,
   DbgUseSLTPforGaps: 1, dStopLossOffset: 0.02000
[/size]

Refreshing the dynamic stop loss info

Code: Select all

00:00 GBPNZD: :  getOpenedOrder():  iNumOfDaysRunning: 1
00:00 GBPNZD: :  calcStealthStopLossFromHard: , iType: 1,
 dHardSL: 1.74069, dSoftStopLoss: 1.72069,
  dHardTP: 1.67309, rdSoftTakeProfit: 1.69309,
   DbgUseSLTPforGaps: 1, dStopLossOffset: 0.02000
   
00:00 GBPNZD: :  New D1: refreshOrderInfo() ID: 2, Type: 1
 Hard SL 1.74069, Hard TP 1.67309
 Soft SL 1.72069, Soft TP 1.69309
[/size]

So now we can see a win to lose ratio of 2 to 1 for limited data

Code: Select all

1	2017.01.12 04:00	sell	1	0.08	1.72373	1.75293	1.68683	0.00	5000.00
2	2017.01.12 20:30	close	1	0.08	1.70726	1.75293	1.68683	94.22	5094.22
3	2017.01.13 13:45	sell	2	0.08	1.71099	1.74069	1.67309	0.00	5094.22
4	2017.01.16 00:00	close	2	0.08	1.68777	1.74069	1.67309	133.22	5227.44
5	2017.01.17 06:45	sell	3	0.07	1.69249	1.72279	1.65339	0.00	5227.44
6	2017.01.17 14:03	close	3	0.07	1.70466	1.72279	1.65339	-61.69	5165.75
[/size]
========================================================================
However, using a fudge for CrappyTester means not testing the code that is used on a live account, so it is important to see what the live code would produce as well:

Code: Select all

13:45 GBPNZD: :  calcSafetyStopLoss: , iType: 1,
 dCurrSL: 1.72069, dHardStopLoss: 1.72179,
  dCurrTP: 1.69309, rdHardTakeProfit: 1.69199,
   DbgUseSLTPforGaps: 0, dStopLossOffset: 0.00110

1	2017.01.12 04:00	sell	1	0.08	1.72373	1.73403	1.70573	0.00	5000.00
2	2017.01.12 20:30	close	1	0.08	1.70726	1.73403	1.70573	94.16	5094.16
3	2017.01.13 13:45	sell	2	0.08	1.71099	1.72179	1.69199	0.00	5094.16
4	2017.01.16 00:00	t/p		2	0.08	1.69199	1.72179	1.69199	108.86	5203.02
5	2017.01.17 06:45	sell	3	0.07	1.69249	1.70389	1.67229	0.00	5203.02
6	2017.01.17 14:03	s/l		3	0.07	1.70389	1.70389	1.67229	-57.76	5145.26
[/size]

So no problem so far, except that we have not carried any trades past midnight, so this needs to be forced in order to properly check that the correct values are generated each time. The easiest way to make trades keep running is to widen the stop loss and take profit values.

After setting the stop loss to (1.5 * the daily ATR) we end up with a very long and pointless trade:

Code: Select all

1	2017.01.12 04:00	sell	1	0.03	1.72373	1.75143	1.67093	0.00	5000.00
2	2017.01.23 00:00	close	1	0.03	1.72353	1.75143	1.67093	0.83	5000.83
[/size]

after several days have we lost track of the proper stealth values or are they correct?

Code: Select all

00:00 GBPNZD: :  getOpenedOrder():  iNumOfDaysRunning: 3
00:00 GBPNZD: :  calcStealthStopLossFromHard: , iType: 1,
 dHardSL: 1.75143, dSoftStopLoss: 1.75033,
  dHardTP: 1.67093, rdSoftTakeProfit: 1.67203,
   DbgUseSLTPforGaps: 0, dStopLossOffset: 0.00110
   
00:00 GBPNZD: :  New D1: refreshOrderInfo() ID: 1, Type: 1
 Hard SL 1.75143, Hard TP 1.67093
 Soft SL 1.75033, Soft TP 1.67203
[/size]

In conclusion, the EA can be interrupted, restarted and then it can refresh the stealth values back to what they should be so that the dynamic exit monitoring performs as expected.
With more data we can use the optimiser to find appropriate values for stop loss settings.
Author:  snailbeard [ Mon Feb 13, 2017 6:56 am ]
Post subject:  NZDJPY SignsOfD1Trend?

Running FindBestAssetsToTrade and SignsOfD1Trend this morning did not give a list of exciting possibilities this morning, practically everything seems to be ranging for the moment.

There was a brief hope that NZDJPY had something to offer:
NZDJPY-FindSignsOfD1Trend-13Feb2017.png
However, hopes are soon dashed when referring to the daily chart:
NZDJPY-D1-was-trending-down-13Feb2017.png
So the script produced the correct result because today's price action is not part of the calculations, that is for the EA to determine. So there was a short lived downward trend but at 'A' the market chooses to follow the rising longer term moving average as price support, initially, momentum carries price action well below the moving average but then the smart money determines price has dropped too far and starts heavy buying back to the moving average, the next day buying continues right through the fast falling moving averages, so the long wick of B is a clue to be cautious and Monday opened with a gap up which might set the mood for the week ahead, but we are firmly inside a ranging phase, which will be reflected in tomorrows 'FindSignsOfD1Trend'.
Author:  snailbeard [ Wed Feb 15, 2017 12:32 pm ]
Post subject:  Mind the gap

Once again our brokers are letting us down and stealing our M1 data, so is it the brokers or the liquidity providers or is there an additional party that we rely on to keep the history filled with M1 bars.

Who needs the M1 history anyway?

My live running EA does not really need more than a days worth of minutes anyway, and mostly it is more concerned about the current price action than old M1 price action, however, it does mean that I cannot easily do a reliable back test on recent weeks if there are big gaps in the data, which of course reminds me that I should be working on the utilities for collecting, converting and pushing data to an offline Empty4. This is the only way I have of doing meaningful experiments on multiple pairs.

The following screen shot shows three popular brokers with significant gaps in the M1 data:
AUDNZD-mind-the-gap-multi-broker-15Feb2017.png
In addition to the data issues we also need to take into account spreads and commissions. In the above, GlobalPrime and FxOpen are supposed to be neutral and not 'lose' our M1 data, because they charge a fixed commission and provide better spreads. On the other hand this FxPro account doesn't have commission so it has a fat spread instead, but at least there is a usable amount of M1 history for a quick back test.

So what happened to the claim that commission based brokers don't sabotage your data?

In the above GlobalPrime has really let us down and provided not even a days worth of M1 data, perhaps no one in Australasia trades AUDNZD???
Author:  tomele [ Wed Feb 15, 2017 8:56 pm ]
Post subject:  Daily Fibonacci Signals

Hi.

A person that I know offers reliable free Empty4 tickdata for 14 pairs and last 12 months at freetickdata.com
Author:  snailbeard [ Thu Feb 16, 2017 8:35 am ]
Post subject:  Daily Fibonacci Signals

Hi Thomas,

Many thanks for posting the link, this could be a good stop-gap for the time being. However, it is a free service of unknown origin and could disappear at any time. I hope your friend is able to continue the service long term as it would be very useful to Empty4 users who do lots of testing.

I have been making good progress with my own data collection and conversion utilities but have been side tracked by a closer look at monitoring spread behaviour.
All times are UTC Page 14 of 21