Zigzag Bollinger Band

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

25 pip slippage

Post by snailbeard »

Although it has been a frustrating week, there has been quite a bit of progress as well. In addition, I had to stop working on the risk-to-lot-size indicator to fix other issues. I added a function called slopeAsymmetry() which measures the speed of price change before and after a number of back-bars and computes whether or not the more recent price change is stronger than the previous price change over a similar time interval. This has worked very well at spotting a false swing in the apparent main direction. I am also thinking it is generic enough to use on smaller timescales - but that is for the future - not on this MetaCrap platform.

Anyway at the end of each week I have to review ZzBb3's performance to see what can be improved.

There was one mystery loss which is particularly interesting because the price movement is over in a single minute. In order to speed processing most calculations are updated once every 15 minutes.

GBPUSD made a loss in a back test for 11:30 23Oct14:
On M15 we just see a spike between 11:30 & 11:15:
GBPUSD-M15-25PIP-slippage-1131-23Oct2014.png
Even though I normally run Crappytester on M1, this is not always sufficient. How many price changes can there be in a single minute?

In this M1 chart we get a much better idea about change in price:
MinuteManTakesThePips-1129-23Oct14.png
In-order to find out if ZzBb3 can actually catch these high speed moves I need to run CrappyTester in tick mode which is painfully slow even after all the work done to save generated data in memory. There are still plenty of places where the code could be more efficient.
Also logging during testing has a big impact on testing times if lots of string operations are handled every tick.

According to the log file the profit tracking needs to be updated more frequently as it currently cannot keep up:

Code: Select all

11:30 GBPUSD: :  WARNING! (Abs(dTrackedProfitInPips - dProfitInPips ) > 2) dTrackedProfitInPips: 0.00, dProfitInPips: 3.30 dSpreadInPips: 2.00
11:30 GBPUSD: :  WARNING! (Abs(dTrackedProfitInPips - dProfitInPips ) > 2) dTrackedProfitInPips: 0.00, dProfitInPips: 3.60 dSpreadInPips: 2.00
...

11:30 GBPUSD: :  Switched from Previous JumpSL to ExtraProfitLock because: closer to target

...
11:30 GBPUSD: :  WARNING! (Abs(dTrackedProfitInPips - dProfitInPips ) > 2) dTrackedProfitInPips: 0.00, dProfitInPips: 20.90 dSpreadInPips: 2.00

11:30 GBPUSD: :  manageExits():  ExitByExtraProfitLock
So the ExitByExtraProfitLock is operating every tick and ZzBb3 can catch the rapid price action:

Code: Select all

1	2014.10.23 11:30	sell	1	0.31	1.60241	0.00000	0.00000	0.00	10000.00
2	2014.10.23 11:30	modify	1	0.31	1.60241	1.60566	1.59951	0.00	10000.00
3	2014.10.23 11:30	close	1	0.31	1.60052	1.60566	1.59951	56.80	10056.80
You do not have the required permissions to view the files attached to this post.
nonlinear
Trader
Posts: 293
Joined: Fri Jun 01, 2012 2:56 pm
Location: Washington DC

Zigzag Bollinger Band

Post by nonlinear »

I still read this regularly, SB. You are a persistent one. Which brokers are you running this on? So much variance.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Moving goal posts

Post by snailbeard »

nonlinear » Mon Oct 27, 2014 1:54 am wrote:I still read this regularly, SB. You are a persistent one. Which brokers are you running this on? So much variance.
Glad you find this interesting and/or useful. I think of it as a place to keep track of my rambling thoughts so I can come back revisit previous thoughts, ideas, results.

As you know persistence is an essential part of trading. The game and rules change over time. The only constant is MetaQuotes who continue to produce the same #£%^%^% time after time.

I regularly test on the following brokers
Favourites: GlobalPrime, FxOpen, FxPro
Secondaries: Onanda, Armada
Fat-spread/Market-maker brokers: Alpari, IG

Here is an interesting chart that shows how the game has changed over many years. Interesting that despite massive changes in volumes and ATR there is still importance attached to 0.866. Since values are relative and not anchored to anything in particular, unless one could express economic fundamentals in terms of conservation of energy/mass/momentum then 0.866 cannot be anything more than a psychological reference.
Do central banks pay attention to these levels?
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 sticky

Post by snailbeard »

Has anyone tried trading USDJPY recently?

According ZzBb3 it is highly sticky at the moment:

Code: Select all

08:45 USDJPY: : PBRE:   dH4Stickness: 101.00 iH4CountedSticks: 1 dH4Shrinkage: 0.195
08:45 USDJPY: : PBRE:   dD1Stickness: 152.80 iD1CountedSticks: 3 dD1Shrinkage: 0.310
On both H4 and D1 stickiness is over 99 which is not a good sign and shrinkage is a lot less than 1.0. that means shrinking price movements and a lack of interest or strong uncertainty.
USDJPY-D1-sticky-price-2014-10-29-0800.png
On the other hand perhaps USDCAD has more potential with some strong hints of a possible fall. Adding some longer term Fibonacci lines shows price close to 38.2 and if price remains below this level we might get good run down to F50. ZzBb3 thinks it is worth a punt. However, this is not the best time to enter. We now have a number of counter flags:

Code: Select all

13:30 USDCAD: :  PBRE  Sell entry dropped because bD1ZzReversingUp || bH4ZzReversingUp : 0,  1
13:30 USDCAD: :  PBRE Sell entry dropped because bReverseH4Doji
13:30 USDCAD: :  PBRE  Sell entry dropped because  bTooFarFromH4Ma10
13:30 USDCAD: :  PBRE Sell entry dropped because 3M15CandleBias UP
13:30 USDCAD: :  PBRE b7D1SwingBeyondWpRange   Dir:  -1
13:30 USDCAD: :  PBRE bH24PartSwung   Dir:  -1
13:30 USDCAD: :  PBRE bPriceIsCloseToH4LBB   Dir:  -1
13:30 USDCAD: : PBRE:   dM15Stickness: 56.28 iM15CountedSticks: 3 dM15Shrinkage: 0.288
13:30 USDCAD: : PBRE:   dH1Stickness: 18.75 iH1CountedSticks: 1 dH1Shrinkage: 0.062
13:30 USDCAD: : PBRE:   dH4Stickness: 5.33 iH4CountedSticks: 1 dH4Shrinkage: 0.157
13:30 USDCAD: : PBRE:   dD1Stickness: 102.14 iD1CountedSticks: 2 dD1Shrinkage: 0.569
Price is right on F38.2 and the market has not made its mind up.
USDCAD-H4-downward-bias-29Oct2014.png
However, anything could happen at the FOMC meeting later today, so I better set a reminder to close trades before the meeting.
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

GBPUSD Profit tracking

Post by snailbeard »

Yesterday I noticed an excess of warnings about lost tracking in the log file in real time. However, time spent dumping to log file is time not spent watching ticks so I had to go back and understand how the profit tracking should recover gracefully from drop-out and restarts. This is not easy to back-test I was considering adding a flag to force the tracking data to be cleared at a particular time. However, this morning FxOpen was already running a trade with GBPUSD so I did a live test.

This is from before restarting Empty4...

Code: Select all

08:03 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 45.94  Pips:26.40  $DdBp:-2.66  $DdAp:-0.50  GapTp:21.50  MnGpTp:12.20
08:04 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 59.80  Pips:34.30  $DdBp:-2.66  $DdAp:-0.50  GapTp:13.80  MnGpTp:12.20
08:05 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 55.66  Pips:32.30  $DdBp:-2.66  $DdAp:-0.50  GapTp:16.10  MnGpTp:12.20
08:06 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 51.88  Pips:29.80  $DdBp:-2.66  $DdAp:-0.50  GapTp:18.20  MnGpTp:12.20
08:07 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 50.44  Pips:29.50  $DdBp:-2.66  $DdAp:-0.50  GapTp:19.00  MnGpTp:12.20
08:08 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 54.22  Pips:31.40  $DdBp:-2.66  $DdAp:-0.50  GapTp:16.90  MnGpTp:12.20
08:09 GBPUSD: :  2002708558  $MxPf:62.68  $RPf: 50.80  Pips:29.00  $DdBp:-2.66  $DdAp:-0.50  GapTp:18.80  MnGpTp:12.20
08:09 GBPUSD: :  Switched from Previous JumpSL to bH4JumpSL because: closer to target[/size]
[/size]
This is a longer trade because of increasing price swings and it has just switched to trailing by H4 candles.

After restarting MetaCrap the copious warnings are nolonger generated and the profit tracking picks up with the current profit as the maximum profit, $DdBp & $DdAp are left untouched, so draw-down before and after profit are lost but they are only for postmortem analysis anyway, such as determining if stop-losses are too near or too far from the entry price.

Code: Select all

08:09 GBPUSD: M1 PACL:   iPairRunningCount: 1
08:09 GBPUSD: :  Switched from Previous JumpSL to ExtraProfitLock because: closer to target
08:10 GBPUSD: :  2002708558  $MxPf:59.44  $RPf: 57.82  Pips:33.90  $DdBp:0.00  $DdAp:0.00  GapTp:14.90  MnGpTp:14.00
08:11 GBPUSD: :  2002708558  $MxPf:59.44  $RPf: 52.60  Pips:30.40  $DdBp:0.00  $DdAp:0.00  GapTp:17.80  MnGpTp:14.00
[/size]

Looking at the live trade suggests it has hit an area of support, profit peaked at 62.68 but this has slipped back into the 50s:
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

USDCAD hit the target before reversing

Post by snailbeard »

Yesterday, I chickened out of my own USDCAD trade (fear versus greed) while ZzBb3 carried on down to the target, however, caution was justified by the big reversal a few hours later:
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

Profit leakage

Post by snailbeard »

GBPUSD was making a nice profit but something in the profit locking is not quite right. I discovered that ZzBb3 has been running without a breakeven setting for sometime, which I hadn't noticed because generally the short range trades have been reaching their targets but with ATR picking up and quite a bit of swinging its time to address some leaks in the profit locking. The extra-profit-lock works well on many trades if price gets close enough to the target but shorter trades were not part of the older trailing-stop methods designed for 90 pip swings. So I am just revising lock-by-percent-profit code and here is what currently happens when we get close to the target in a short USDJPY trade:

Code: Select all

04:32 USDJPY: :  3  $MxPf:57.66  $RPf: 55.28  Pips:14.00  $DdBp:0.00  $DdAp:-15.15  GapTp:5.20  MnGpTp:4.70
04:32 USDJPY: :  done: updateStopLossToXplSl(): bExtraProfitLockSL bUpdatedXplSlOk: 0
04:32 USDJPY: :  manageTrailingSymbol()...
04:32 USDJPY: :  iCPTicketNum : 3, dSymSumCashProfit 55.28, symbolPercentUp : 0.55
04:33 USDJPY: :  3  $MxPf:63.86  $RPf: 63.86  Pips:15.80  $DdBp:0.00  $DdAp:-15.15  GapTp:3.40  MnGpTp:3.40
04:33 USDJPY: :  done: updateStopLossToXplSl(): bExtraProfitLockSL bUpdatedXplSlOk: 0
04:33 USDJPY: :  updateStopLoss(): , iDirection: -1
, dOldStopLoss: 107.47100, dNewStopLoss: 0.00000
, bSetStopLossToBreakEven: 1, bSlValidGap: 1, bNewSlIsCloser: 1
04:33 USDJPY: :  updateStopLoss(): Changed stoploss to breakeven!
04:33 USDJPY: :  manageTrailingSymbol()...
04:33 USDJPY: :  iCPTicketNum : 3, dSymSumCashProfit 63.86, symbolPercentUp : 0.63
04:33 USDJPY: :  Previous symbolLockAccPercent : 0.00
04:33 USDJPY: :  ((symbolPercentUp - symbolTrailPercent) > symbolLockAccPercent)
04:33 USDJPY: :  Updated symbolLockAccPercent : 0.32
04:34 USDJPY: :  3  $MxPf:63.86  $RPf: 59.57  Pips:14.90  $DdBp:0.00  $DdAp:-15.15  GapTp:4.30  MnGpTp:3.40
04:34 USDJPY: :  done: updateStopLossToXplSl(): bExtraProfitLockSL bUpdatedXplSlOk: 0
04:34 USDJPY: :  manageTrailingSymbol()...
04:34 USDJPY: :  iCPTicketNum : 3, dSymSumCashProfit 59.57, symbolPercentUp : 0.59
04:34 USDJPY: :  GlobalVariableCheck : sLockName: USDJPY600323_trailingSymbol, symbolLockAccPercent 0.32
[/size]

The first thing I noticed was that losing trades correctly consume about 1%, but recent profits are often coming in at just over 50% even when getting close to the target. So is this just the cost of profit-locking and trailing-stops?
There is a disparity in the risk-to-reward-ratio which could be due to a minimum stop loss or inefficient profit locking.

In this back-test trade we only saved a quarter of the risk:

Code: Select all

9	2014.10.13 03:35	sell	3	0.51	107.259	0.000	0.000	0.00	10132.36

10	2014.10.13 03:35	modify	3	0.51	107.259	107.471	107.087	0.00	10132.36
First SL: 107.471 - 107.259 => 21 pips
First TP: 107.259 - 107.087 => 17 pips

12	2014.10.13 04:44  close3  0.51  107.197  107.259  107.087  27.66  10160.02
Final SL: 107.259 - 107.197 => 6.20 pips
Final TP: 107.259 - 107.197 => 6.20 pips
[/size]

6 pips is better than breakeven, which in turn is much much better than a $99 loss.

In the following M1 chart we see that the full profit was there for the taking.
Using breakeven without trailing would have given better result in this one particular case:
usdjpy-M1-profit-leakage-0440-13Oct2014.png
Both percent-lock and extra-profit-lock had the same exit point by different methods, in a longer trade the results would be different. Extra-profit-lock is ideal for longer trades and not as useful on short trades.
Percent-lock could kill-off a longer trade too soon so we need to be careful to get the settings right:

Code: Select all

04:44 USDJPY: :  USDJPY, orders closed at: 0.32 ,Symbol trailing percent level
04:44 USDJPY: :  manageExits():  ExitByExtraProfitLock
[/size]

In conclusion, we can try different settings for percent-lock and extra-profit-locking to find the best return over a given period of time, but these settings are short lived. We can also try to accommodate individual trade settings based on volatility and the range of the trade.

I'm considering an additional extra-profit-lock of 5 pips when price gets within 1.5 pips of the target price.
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

Surprise of the week

Post by snailbeard »

I have been using Crappytester for a long time. Spreads were always fixed and preset, and using every tick instead of bar-by-bar slows down the results. Recently I have been trying to get a slightly more realistic approximation to live trades. At the end of each week I would like to reproduce the same results as the real-time results :lol:
Well sometimes you just have to try.

But if you don't use every tick and you fix the spread at 2 pips and run tests over 2 months then repeat the same tests two more times, once with every tick and once with thin spread e.g 0.2 pips. Which of those two changes would you expect to have most influence on the final total profit/loss?

Would it be the ticks because price sometimes moves very fast?
Would it be the spread because a couple of pips can make the difference between a good entry, a late entry and no entry at all as well as just missing a target by the spread or just tripping a stop loss before going back towards the target?

Well the following results are not statistically significant unless I get similar results for other pairs and can actually relate them to real time results:

USDJPY

Code: Select all

2 Pip spread
1	2014.09.08 22:04	buy	1	0.32	105.944	0.000	0.000	0.00	10000.00
2	2014.09.08 22:04	modify	1	0.32	105.944	105.614	106.200	0.00	10000.00
3	2014.09.09 00:22	modify	1	0.32	105.944	105.944	106.200	0.00	10000.00
4	2014.09.09 02:59	close	1	0.32	106.163	105.944	106.200	64.33	10064.33
5	2014.09.10 10:16	buy	2	0.39	106.529	0.000	0.000	0.00	10064.33
6	2014.09.10 10:16	modify	2	0.39	106.529	106.263	106.754	0.00	10064.33
7	2014.09.10 11:07	modify	2	0.39	106.529	106.529	106.754	0.00	10064.33
8	2014.09.10 11:31	close	2	0.39	106.719	106.529	106.754	68.03	10132.36
9	2014.10.13 03:35	sell	3	0.51	107.259	0.000	0.000	0.00	10132.36
10	2014.10.13 03:35	modify	3	0.51	107.259	107.471	107.087	0.00	10132.36
11	2014.10.13 04:33	modify	3	0.51	107.259	107.259	107.087	0.00	10132.36
12	2014.10.13 04:44	close	3	0.51	107.197	107.259	107.087	27.66	10160.02
13	2014.10.23 09:40	buy	4	0.34	107.314	0.000	0.000	0.00	10160.02
14	2014.10.23 09:40	modify	4	0.34	107.314	106.990	107.570	0.00	10160.02
15	2014.10.23 11:05	modify	4	0.34	107.314	107.314	107.570	0.00	10160.02
16	2014.10.23 11:16	t/p	4	0.34	107.570	107.314	107.570	79.70	  10239.72

------------------------------------------------------------------------
Reducing the spread from 2 pips to 0.2 pips to reflect the broker's spread
Back test using M1: NOT ticks
1	2014.09.08 22:01	buy	1	0.31	105.896	0.000	0.000	0.00	10000.00
2	2014.09.08 22:01	modify	1	0.31	105.896	105.568	106.185	0.00	10000.00
3	2014.09.09 00:06	modify	1	0.31	105.896	105.896	106.185	0.00	10000.00
4	2014.09.09 02:59	close	1	0.31	106.163	105.896	106.185	76.34	10076.34
5	2014.09.10 08:01	buy	2	0.35	106.478	0.000	0.000	0.00	10076.34
6	2014.09.10 08:01	modify	2	0.35	106.478	106.191	106.739	0.00	10076.34
7	2014.09.10 10:22	modify	2	0.35	106.478	106.478	106.739	0.00	10076.34
8	2014.09.10 11:31	close	2	0.35	106.719	106.478	106.739	77.78	10154.12
9	2014.09.25 00:33	buy	3	0.34	109.054	0.000	0.000	0.00	10154.12
10	2014.09.25 00:33	modify	3	0.34	109.054	108.751	109.951	0.00	10154.12
11	2014.09.25 02:09	modify	3	0.34	109.054	109.054	109.951	0.00	10154.12
12	2014.09.25 02:52	modify	3	0.34	109.054	109.094	109.951	0.00	10154.12
13	2014.09.25 03:56	close	3	0.34	109.191	109.094	109.951	41.44	10195.56
14	2014.09.26 17:22	buy	4	0.34	109.278	0.000	0.000	0.00	10195.56
15	2014.09.26 17:22	modify	4	0.34	109.278	108.955	110.155	0.00	10195.56
16	2014.09.26 21:21	modify	4	0.34	109.278	109.278	110.155	0.00	10195.56
17	2014.09.26 22:25	s/l	4	0.34	109.278	109.278	110.155	-1.22	10194.34
18	2014.10.10 15:31	sell	5	0.28	107.779	0.000	0.000	0.00	10194.34
19	2014.10.10 15:31	modify	5	0.28	107.779	108.164	107.460	0.00	10194.34
20	2014.10.13 00:00	modify	5	0.28	107.779	107.779	107.460	0.00	10194.34
21	2014.10.13 00:10	t/p	5	0.28	107.460	107.779	107.460	81.56	10275.90
22	2014.10.23 08:32	buy	6	0.32	107.265	0.000	0.000	0.00	10275.90
23	2014.10.23 08:32	modify	6	0.32	107.265	106.942	107.555	0.00	10275.90
24	2014.10.23 11:05	modify	6	0.32	107.265	107.265	107.555	0.00	10275.90
25	2014.10.23 11:16	t/p	6	0.32	107.555	107.265	107.555	85.12	10361.02
26	2014.10.24 14:01	buy	7	0.17	108.168	0.000	0.000	0.00	10361.02
27	2014.10.24 14:01	modify	7	0.17	108.168	107.567	108.714	0.00	10361.02
28	2014.10.27 00:00	modify	7	0.17	108.168	108.168	108.714	0.00	10361.02
29	2014.10.27 02:04	s/l	7	0.17	108.168	108.168	108.714	-0.89	  10360.13
------------------------------------------------------------------------
Spread 0.2 again
Back test using ticks
1	2014.09.08 22:00	buy	1	0.31	105.891	0.000	0.000	0.00	10000.00
2	2014.09.08 22:00	modify	1	0.31	105.891	105.568	106.185	0.00	10000.00
3	2014.09.08 23:45	modify	1	0.31	105.891	105.891	106.185	0.00	10000.00
4	2014.09.09 02:57	close	1	0.31	106.128	105.891	106.185	67.60	10067.60
5	2014.09.10 08:00	buy	2	0.35	106.478	0.000	0.000	0.00	10067.60
6	2014.09.10 08:00	modify	2	0.35	106.478	106.191	106.739	0.00	10067.60
7	2014.09.10 10:21	modify	2	0.35	106.478	106.478	106.739	0.00	10067.60
8	2014.09.10 11:22	close	2	0.35	106.633	106.478	106.739	49.62	10117.22
9	2014.09.25 00:32	buy	3	0.34	109.051	0.000	0.000	0.00	10117.22
10	2014.09.25 00:32	modify	3	0.34	109.051	108.751	109.951	0.00	10117.22
11	2014.09.25 02:04	modify	3	0.34	109.051	109.051	109.951	0.00	10117.22
12	2014.09.25 02:48	modify	3	0.34	109.051	109.091	109.951	0.00	10117.22
13	2014.09.25 03:58	close	3	0.34	109.185	109.091	109.951	40.51	10157.73
14	2014.09.26 17:15	buy	4	0.34	109.255	0.000	0.000	0.00	10157.73
15	2014.09.26 17:15	modify	4	0.34	109.255	108.955	110.155	0.00	10157.73
16	2014.09.26 21:02	modify	4	0.34	109.255	109.255	110.155	0.00	10157.73
17	2014.09.26 21:30	modify	4	0.34	109.255	109.295	110.155	0.00	10157.73
18	2014.09.26 21:47	close	4	0.34	109.390	109.295	110.155	40.74	10198.47
19	2014.10.10 01:00	sell	5	0.26	107.811	0.000	0.000	0.00	10198.47
20	2014.10.10 01:00	modify	5	0.26	107.811	108.197	107.460	0.00	10198.47
21	2014.10.10 03:14	modify	5	0.26	107.811	107.811	107.460	0.00	10198.47
22	2014.10.10 03:27	s/l	5	0.26	107.811	107.811	107.460	-0.94	10197.53
23	2014.10.10 15:30	sell	6	0.28	107.793	0.000	0.000	0.00	10197.53
24	2014.10.10 15:30	modify	6	0.28	107.793	108.164	107.460	0.00	10197.53
25	2014.10.10 23:30	modify	6	0.28	107.793	107.793	107.460	0.00	10197.53
26	2014.10.13 00:09	close	6	0.28	107.479	107.793	107.460	80.25	10277.78
27	2014.10.23 08:31	buy	7	0.32	107.263	0.000	0.000	0.00	10277.78
28	2014.10.23 08:31	modify	7	0.32	107.263	106.942	107.555	0.00	10277.78
29	2014.10.23 11:04	modify	7	0.32	107.263	107.263	107.555	0.00	10277.78
30	2014.10.23 11:05	close	7	0.32	107.531	107.263	107.555	78.60	10356.38
31	2014.10.24 14:00	buy	8	0.17	108.168	0.000	0.000	0.00	10356.38
32	2014.10.24 14:00	modify	8	0.17	108.168	107.567	108.714	0.00	10356.38
33	2014.10.27 00:00	modify	8	0.17	108.168	108.168	108.714	0.00	10356.38
34	2014.10.27 02:03	s/l	8	0.17	108.168	108.168	108.714	-0.89	  10355.49
[/size]
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

What a difference a pip makes

Post by snailbeard »

Looking deeper into the spread influence on results, I ran a couple more tests this time using a fat spread of 2 pips and thin spread of 0.5:
Comparing both sets of log files then using file compare utility gave a bit more information about the differences, but only part of the reasons:
diff-usdjpy-VPO-difference-25Sep2014.png
diff-usdjpy-D1ZzReversing-0100-10Oct2014.png
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

Garbage collection

Post by snailbeard »

It seems appropriate that as most of us have to use MetaCrap that there should be a function called garbageCollection(). In modern software development languages garbage-collection (freeing up memory) of temporary variables and classes is automatically detected and recycled. MetaCrap has it's own method of freeing up memory which is to periodically crash. Although this does not completely free up all unused RAM! To fully clean up I find it is necessary close all charts and then restart MetaCrap.
I find MetaCrap can run for weeks without crashing if you avoid using any indicators or EAs!

Captain Jack doesn't require any/many indicators for his naked trading methodology so perhaps this is the correct way to approach trading with MetaCrap.

On the other hand I read with interest that ProTrader 3 people have shot themselves in the foot by failing to attract brokers and allowed cTrader to gain market share. I am following cTrader progress with interest and counted 15 brokers offering it recently.

If I had a picture of Empty4 being dropped into the rubbish bin awaiting garbage-collection I would insert it here but sadly I don't have one yet.

My garbageCollection() is currently quite a slim function:

Code: Select all

//+------------------------------------------------------------------+
//| garbageCollection
//+------------------------------------------------------------------+
void garbageCollection(int iPairIndex, int iPairCountRunning) {

	// delete any obsolete trailing symbol tracking variables
	if( iPairCountRunning == 0 )
	{
		deleteGVNameSymLock( iPairIndex );
	}
}
In the meantime I have been doing quite a lot testing of the entry filters because I have been killing off to many good entries. However, by looking at charts and manually spotting good entries and cross-referencing against the reasons why a trade was dropped I know which filters require more work. This has increased the number of trades per pair per month to about 10 after it had dropped down to 2. Although the failure rate is much higher the net gain is running much higher as well.
I haven't finished going through the latest results yet and I'm sure all the recent changes have added more bugs....
Post Reply

Return to “Automated trading systems”