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

Zigzag Bollinger Band
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3237
Page 5 of 28
Author:  snailbeard [ Tue Jan 07, 2014 3:22 pm ]
Post subject:  Re: Zigzag Bollinger Band

MQ CrappyTester M1 Bar drift

As previously mentioned here I had some confusion over some results during back-testing with Crappytester.
I have just plugged the latest DLL into a MQL test script to see what happens to M1 bars over a single day.
And this is a secondary aspect of what the DLL is compensating for:
(the primary flaw being the incorrect High/Low values)
compensating for the missing bars just makes sure everything is consistent.

Code: Select all

Day of Week of First day of Year: 5, Week Num: 14
Investigate Thursday 2010.04.01 00:01 
Current Time: 2010.04.01 04:33:59, Prev: 2010.04.01 04:32:00, Drift (secs): 59
Current Time: 2010.04.01 05:03:59, Prev: 2010.04.01 05:02:00, Drift (secs): 59
Current Time: 2010.04.01 20:03:59, Prev: 2010.04.01 20:02:00, Drift (secs): 59
Current Time: 2010.04.01 20:06:59, Prev: 2010.04.01 20:05:00, Drift (secs): 59
Current Time: 2010.04.01 20:41:59, Prev: 2010.04.01 20:40:00, Drift (secs): 59
Current Time: 2010.04.01 20:44:59, Prev: 2010.04.01 20:43:00, Drift (secs): 59
Current Time: 2010.04.01 20:52:59, Prev: 2010.04.01 20:51:00, Drift (secs): 59
Current Time: 2010.04.01 20:54:00, Prev: 2010.04.01 20:52:59, Drift (secs): 1
Current Time: 2010.04.01 20:55:59, Prev: 2010.04.01 20:54:00, Drift (secs): 59
Current Time: 2010.04.01 20:58:00, Prev: 2010.04.01 20:56:59, Drift (secs): 1
Current Time: 2010.04.01 21:11:59, Prev: 2010.04.01 21:10:00, Drift (secs): 59
Current Time: 2010.04.01 21:17:00, Prev: 2010.04.01 21:15:00, Drift (secs): 60
Current Time: 2010.04.01 21:20:00, Prev: 2010.04.01 21:18:00, Drift (secs): 60
Current Time: 2010.04.01 21:23:00, Prev: 2010.04.01 21:20:00, Drift (secs): 120
Current Time: 2010.04.01 21:25:00, Prev: 2010.04.01 21:23:00, Drift (secs): 60
Current Time: 2010.04.01 21:26:59, Prev: 2010.04.01 21:25:00, Drift (secs): 59
Current Time: 2010.04.01 21:30:59, Prev: 2010.04.01 21:28:59, Drift (secs): 60
Current Time: 2010.04.01 21:33:00, Prev: 2010.04.01 21:31:59, Drift (secs): 1
Current Time: 2010.04.01 21:39:59, Prev: 2010.04.01 21:38:00, Drift (secs): 59
Current Time: 2010.04.01 21:43:59, Prev: 2010.04.01 21:42:00, Drift (secs): 59
Current Time: 2010.04.01 21:46:59, Prev: 2010.04.01 21:45:00, Drift (secs): 59
Current Time: 2010.04.01 21:48:59, Prev: 2010.04.01 21:46:59, Drift (secs): 60
Current Time: 2010.04.01 21:51:00, Prev: 2010.04.01 21:49:59, Drift (secs): 1
Current Time: 2010.04.01 21:53:59, Prev: 2010.04.01 21:52:00, Drift (secs): 59
Current Time: 2010.04.01 21:55:59, Prev: 2010.04.01 21:53:59, Drift (secs): 60
Current Time: 2010.04.01 21:57:00, Prev: 2010.04.01 21:55:59, Drift (secs): 1
Current Time: 2010.04.01 22:08:59, Prev: 2010.04.01 22:06:00, Drift (secs): 119
Current Time: 2010.04.01 22:10:00, Prev: 2010.04.01 22:08:59, Drift (secs): 1
Current Time: 2010.04.01 22:14:59, Prev: 2010.04.01 22:11:00, Drift (secs): 179
Current Time: 2010.04.01 22:17:59, Prev: 2010.04.01 22:16:00, Drift (secs): 59
Current Time: 2010.04.01 22:24:59, Prev: 2010.04.01 22:19:00, Drift (secs): 299
Current Time: 2010.04.01 22:28:59, Prev: 2010.04.01 22:27:00, Drift (secs): 59
Current Time: 2010.04.01 22:31:59, Prev: 2010.04.01 22:29:59, Drift (secs): 60
Current Time: 2010.04.01 22:34:00, Prev: 2010.04.01 22:31:59, Drift (secs): 61
Current Time: 2010.04.01 22:35:59, Prev: 2010.04.01 22:34:00, Drift (secs): 59
Current Time: 2010.04.01 22:38:00, Prev: 2010.04.01 22:36:00, Drift (secs): 60
Current Time: 2010.04.01 22:42:59, Prev: 2010.04.01 22:41:00, Drift (secs): 59
Current Time: 2010.04.01 22:45:00, Prev: 2010.04.01 22:43:00, Drift (secs): 60
Current Time: 2010.04.01 22:48:59, Prev: 2010.04.01 22:46:00, Drift (secs): 119
Current Time: 2010.04.01 22:53:00, Prev: 2010.04.01 22:51:00, Drift (secs): 60
Current Time: 2010.04.01 22:57:00, Prev: 2010.04.01 22:54:00, Drift (secs): 120
Current Time: 2010.04.01 22:58:59, Prev: 2010.04.01 22:57:00, Drift (secs): 59
Current Time: 2010.04.01 23:03:59, Prev: 2010.04.01 23:02:00, Drift (secs): 59
Current Time: 2010.04.01 23:07:00, Prev: 2010.04.01 23:05:00, Drift (secs): 60
Current Time: 2010.04.01 23:09:59, Prev: 2010.04.01 23:08:00, Drift (secs): 59
Current Time: 2010.04.01 23:11:59, Prev: 2010.04.01 23:10:00, Drift (secs): 59
Current Time: 2010.04.01 23:15:59, Prev: 2010.04.01 23:13:00, Drift (secs): 119
Current Time: 2010.04.01 23:17:59, Prev: 2010.04.01 23:15:59, Drift (secs): 60
Current Time: 2010.04.01 23:31:00, Prev: 2010.04.01 23:29:00, Drift (secs): 60
Current Time: 2010.04.01 23:35:00, Prev: 2010.04.01 23:33:00, Drift (secs): 60
Author:  snailbeard [ Tue Jan 07, 2014 5:07 pm ]
Post subject:  Re: Zigzag Bollinger Band

Baby sitter required 24x7 for AutoTrader

I am still running on a demo account otherwise I would have been babysitting this trade.
Firstly, I did not place the trade in my real account because I don't like to trade against strong momentum (see the slope of the H4 Bollinger Band (Green - top right). The EA does have various filters available to block this trade but they are not on. However, I am not a control freak (?), so I let it run and I was thinking when the price and that H4 Bollinger meet, the EA should at least take a partial profit and if I was babysitting real money I would have done it. Interestingly, The EA almost had that profit in the bag since it is set to take partial profits at 30 pips and a few more pips would have been enough. When you look at where the prices went and didn't go (see the stop-loss) - its almost like someone is playing games with me:

Entry at 1.6406
pullback just before partial profit at 1.6432
stoploss just touched at 1.637
Author:  snailbeard [ Wed Jan 08, 2014 11:49 am ]
Post subject:  Re: Zigzag Bollinger Band

Well it is no good staring at virtual profits in demo accounts, it is time to take a real risk:

Snail version 1754-02Dec2013 is now running live with real money!

:!!:

but I'll be managing the trades in between developing the usability side of things.
Author:  trader689 [ Wed Jan 08, 2014 4:10 pm ]
Post subject:  Re: Zigzag Bollinger Band

best of luck live!
snailbeard ยป Wed Jan 08, 2014 11:49 am wrote:Well it is no good staring at virtual profits in demo accounts, it is time to take a real risk:

Snail version 1754-02Dec2013 is now running live with real money!

:!!:

but I'll be managing the trades in between developing the usability side of things.
Author:  snailbeard [ Thu Jan 09, 2014 10:52 am ]
Post subject:  Re: Zigzag Bollinger Band

This morning I found an ambigous trade had been entered, there is a filter for this but not currently enabled.

There are momentum 'vectors' or channels from several timeframes forming sideways triangles.
The dash green lines and blue arrows indicate momentum from different durations.
The short-range and long-range momentum are up while the mid-range momentum is down.
The price is currently moving towards the stop-loss but there is a mid-range channel boundary before the stop-loss.

I am thinking about a short-range autotrader to grab 10 to 30 pips at a time
CBO labels a breakout from a mid-range channel boundary and CFM is a confirmation of short-range momentum.

However, going back to the actual trade which reached both DMS1 and WMS1 in Alpari, it failed to take a partial profit because of the higher spreads whereas had it been running in GlobalPrime it would be more likely to capture the profit due to the low spread (typically less than 1 pip).
More work is required to have a more active approach to exits.
I would like to try exiting if the either ask or bid price reaches the first target.
Unfortunately, CrappyTester uses a fixed spread.
It will be necessary to add a feature to the DLL to create a substitute spread which can be used by the exit monitor during back-testing.
Author:  snailbeard [ Thu Jan 09, 2014 11:29 am ]
Post subject:  Re: Zigzag Bollinger Band

Would you take this trade or not?

Initially we see EurJpy showing downward momentum. The EA gets an entry signal at 01:01 and decides to trade it. However, there are more things to consider the H4 (Green) and D1 (Purple) Bollinger bands are more or less horizontal, and the zig-zag swings are falling in size: forming a sideways triangle. There is a filter for this configuration but it is not currently on. There is no strong momentum and so the market is consolidating or ranging, without further information it would be better not to enter.
Author:  snailbeard [ Thu Jan 09, 2014 3:41 pm ]
Post subject:  Re: Zigzag Bollinger Band

Short range buy set-up

Unlike the previous view this view of EurJpy M1 shows a clear drift upwards. Consider the ZZ (zigzag bottom for both H1 and M15) to be our reference point, from there onwards we see Higher HIghs and Higher Lows.

It might be clearer to look at the tops and bottoms of H4 and H1 bars to determine the HH and HL.
When the M15 crosses over the H4 Bollinger that is not an entry signal because we need a pull back an a recrossing of a suitable threshold. The ideal signal occurs after the price leaves the lower M1 Bollinger band (Red) and crosses the mid M15 Bollinger band (back).

Therefore we can split the logic into parts:
There is a combination of M15/H1/H4 bars that indicates a series of higher highs and higher lows:
This can be updated every 15 minutes.
The price has just crossed M15 mid Bollinger (the main trigger)
and the price was recently at the lower M1 Bollinger band (to further define this we can define recent as say within the last 15 minutes).

On entering a trade we must have a plan for taking profits.
I already described this as a short range trade, taking a partial profit every 30 pips is a good starting point.
There is a swing of about 34 pips from the ZZ low to the most recent HH, so that can be a clue to price volatility.
Author:  snailbeard [ Fri Jan 10, 2014 5:54 pm ]
Post subject:  Re: Zigzag Bollinger Band

A leap in the dark

Its one way to sum up trading because there is no way to know exactly what will happen once the trade is in. The last few days have been interesting. I was watching the very weak Euro and the very strong Yen, and basically ignored the autotrader and just swam around EURJPY waiting, waiting, waiting. It was such an obvious falling channel that I suspected the criminals may have laid a trap for us on the third cycle. I placed a sell entry (142.74) with a very distant stoploss. At about 15:30 the crims sprung their trap and no doubt quite a few smaller traders got zapped. I closed the trade just above DS1.

The AutoTraders recorded the maximum spread and it was much worse on Alpari than GlobalPrime:
(HS: Highest Spread, LS: Lowest Spread)
Leaping-spreads-Alpari-1530-10Jan2014.png
Leaping-spreads-GlobalPrime-1530-10Jan2014.png
Author:  snailbeard [ Fri Jan 10, 2014 6:13 pm ]
Post subject:  Re: Zigzag Bollinger Band

End of week summary

Although I had some frustrating time consuming C++ issues with silently failing file operations. It was more than made up for by the Snails trading activity:
Author:  snailbeard [ Thu Jan 16, 2014 12:31 pm ]
Post subject:  Re: Zigzag Bollinger Band

Improvements to the High/Low DLL

This finally appears to be bug free.

Had some difficulties passing boolean values between MQL script and C++,
because bool values do not really exist, so just pass integers instead :arrrg:

Using real historical data in CrappyTester now does meaningful things and gracefully handles missing minutes:

(Test using April 2010 data)
The first number is the day of the month
The number in ( ) is the day of week: Sunday to Friday

Code: Select all

----------------------------------------------------------------
Final Summary
GHL_CountedDays:        26
GHL_TotalExpectedMins: 31500
GHL_TotalReceivedMins: 30996
TotalLostMinutes:          504
GHL_TotalLateMins (>15 Secs): 0
GHL_TotalShortMins (<55 Secs): 298
----------------------------------------------------------------
M1 bars
Day:         1(4)  2(5)
Expected:    1440  1260
Received:    1405  1161
Missing:       35   99

Day:         4(0)  5(1)  6(2)  7(3)  8(4)  9(5)
Expected:    180  1440  1440  1440  1440  1260
Received:    137  1379  1434  1420  1416  1252
Missing:       43   61   6   20   24   8

Day:         11(0)  12(1)  13(2)  14(3)  15(4)  16(5)
Expected:    180  1440  1440  1440  1440  1260
Received:    174  1425  1420  1415  1421  1260
Missing:       6   15   20   25   19   0

Day:         18(0)  19(1)  20(2)  21(3)  22(4)  23(5)
Expected:    180  1440  1440  1440  1440  1260
Received:    172  1439  1422  1430  1430  1257
Missing:       8   1   18   10   10   3

Day:         25(0)  26(1)  27(2)  28(3)  29(4)  30(5)
Expected:    180  1440  1440  1440  1440  1260
Received:    157  1421  1435  1434  1420  1260
Missing:       23   19   5   6   20   0
This means that trade filters that rely on correct highest and lowest value of the current open bar should now get the correct result during back-testing...
All times are UTC Page 5 of 28