Bug fix

I recently discovered a recurring error that was not always apparent. The sampling functions are built from arrays that store the data for each market state. These arrays are redimensionalized on a periodic basis to refresh market data using the most limiting market state to set the size of the arrays. Under certain circumstances, the EAs were collecting so much data in a given state that the redimensionalizing process was resulting in memory overflow errors. This in turn resulted in incomplete sampling functions.

This was a particularly insidious error in that it did not cause an all-out crash, instead, the EAs would keep running with incorrect or incomplete sampling functions, and unless I noticed the memory allocation error in the log, I would not know anything was wrong. I suspect this may have been a contributor to the inconsistent performance recently.

This bug has now been fixed. We will now perform a forward test and see if performance improves.

Now broadcasting on Collective2

Monte Carlo Forex Statistical Arbitrage is now available on Collective2. You can now have this unique system autotrade on your account. You can even trade on a demo account absolutely free if you want to test the waters first without risking any real money.

Now broadcasting on Myfxbook

I’ve started yet another broadcast today.  I decided that some of you may want to dig a little deeper into my testing and may even feel inclined to independently verify my results.  Therefore, my testing history is now posted at Myfxbook.  Of course, it may not make much sense without the accompanying descriptions of each experimental setup located in the Results –> Experiment [#] section.

For ease of reference, all experiments to date are documented here:

Experiment 2 (4/10 – 4/20)
Experiment 3 (4/25 – 5/12)
Experiment 4 (5/22 – 6/10)
Experiment 5 (6/14 – 6/24)
Experiment 6 (6/27 – 7/08)
Experiment 7a (7/18-7/22)
Experiment 7b (8/1-8/12)
Experiment 8 (9/5-9/16)

In addition, I’m continuing to broadcast a live video feed through livestream. 

Current Events and Path Forward

As you (the one visitor a day I occasionally get) could imagine, I’m currently in the middle of Experiment 6 (E6).  I’ve been conducting this test all of last week and will conclude it at the end of this week.  I previously noticed that a number of EAs would only hold their positions open for an hour or two, even though the forecasts are 4 hours in the future.  I decided to test the prior setups versus 2-hour forecasts setups, and use the extra computational margin gained to run more histories.  This way I halved the forecast length and doubled the number of histories, to keep the total number of random samples equal.  The results so far indicate that the 2-hour forecasts do have a significant edge over the 4 hour configuration.  It’s still premature, and I won’t post results until the end of E6, but that’s the indication so far.

After E6, E7 will test a variety of entry and exit configurations for the DMA variant in a 2hr forecast mode (if E6 results remain consistent until the end of the week).  I’m currently testing an entry of PN>0.18 and exit of PN<.03 or TP/SL at 2 SD, whichever comes first.  E7 will test entries of 0.2 and 0.5 and exits of PN<0 with 2SD TP/SL, exit on TP/SL or opposite entry, and exit on opposite entry only (no TP/SL).  I haven’t had a chance to explore different entry/exit setups since I’ve been comparing different EAs against each other, but my recent work is indicating that DMA 1-5-15 2hr 2SD gives the best results.  I’m excited to run E7 and see how my DMA EA behaves under these conditions.  Even though it is profitable, I’ve noticed it often leaves a lot on the table by exiting too quickly, so these alternate conditions will test a less jittery EA against itself.

After E7, I think i’ll have narrowed down the EA’s profitable and safe operational parameters enough to start exploring other currencies.  I’ll be using the results of E7 to configure the DMA EA in E8 to test its behaviour in EURUSD, USDJPY, USDCHF, USDCAD, GBPUSD, and AUDUSD.  This selection is somewhat arbitrary and may change before E8.  Ideally, I’d like to test everything under the sun, but i have limited computational resources.

As a side note, I’l like to mention that I don’t plan on posting experimental updates as independent blog posts anymore, since experimental results are all documented as pages under the “Results” section.  I am however, planning to continue broadcasting the live video on livestream.com/gatornuke, although I admit this broadcast has not been uninterrupted.

Experiment 5

This week we started the next experiment in the series.  The results of Experiment 4 were encouraging, and they seemed to indicate that the 1-5-15 timeframe was the most profitable.

For this experiment, we’ll use the MACD, DMA and MAFR versions at the 1-5-15 timeframe, but we’ll test whether the 1 SD exits are better or worse than the 2SD exit triggers.

Results indicated that the 2 SD DMA EA is the way to go.  See results here.

Experiment 4

This week we started the next experiment in the series.  The results of Experiment 3 were inconclusive, and now we’re setting out to investigate additional capabilities of the EAs.

Up until now we were placing trades at a constant 0.1 lot size.  For Experiment 4 we’ll use the EA’s predicted standard deviation envelopes to determine the lot size.  In order to accomplish this, we’ll hold the bet amount at a constant $100.  This means that when the SL (set at 1 SD) is larger, the lot size will be smaller and on the flip size, we’ll bet larger lots for a smaller SL.  This results in larger bets as the EAs have more confidence in a move.

We’re also increasing the PN entry trigger to 0.3 to try and reduce false entries.  In addition, we’re increasing the limit of open orders to 5,000, to be closed either by TP, SL or change of bias.  Other than that, the EAs are set up consistent with Experiment 3 as shown:

Where:

Mode A is the original operational mode previously studied.  The entry trigger is PN=0.3, and statistics are segregated by session and day of the week in addition to indicator states
Mode B is the same as A, but there is no day of week segregation.  Only the session data is kept separate
Mode C uses no segregation between day of week or session.  The only data bins are those defined by the indicator states.

This experiment is now complete.  Detailed results are here.  It indicated that MACD-A was the most profitable setup.  It also indicated that the most profit was realized for MACD-A with an entry PN = [4.5 , 5.5].

Experiment 3

This week we started the next experiment in the series.  The results of Experiment 2 indicated that the MACD 1/5 EA was better than the rest, and the results were statistically significant.  In addition, we saw some indications that the shorter timeframes were more profitable, and that the MACD and DMA versions were better than the MAFR version, although not all of these results were statistically significant.

Given the above, Experiment 3 focuses on the MACD and DMA versions, both at the short timeframes, and in different operational modes as shown in the figure.

Where:

Mode A is the original operational mode previously studied.  The entry trigger is PN=0.2, and statistics are segregated by session and day of the week in addition to indicator states
Mode B is the same as A, but there is no day of week segregation.  Only the session data is kept separate
Mode C uses no segregation between day of week or session.  The only data bins are those defined by the indicator states.

This experiment is complete.  See the results here.

Experiment 2 (4/10 – 4/20) completed

This experiment was cut short due to a power outage the morning of 4/20.  We had a terrible windstorm overnight, and it disrupted electric service.  The battery backup kept the computer, router and modem working, but the backup generator failed to start.  I couldn’t figure out what was wrong with the generator before the battery backup ran out and I had to leave for work anyways.  Instead of restarting the experiment when I got home and running it one more day, I decided to just go with the data collected thus far and move on to the next phase next week.

This experiment tested the DMA, MAFR, and MACD versions in the 1/5/15 and 1/30/60 timeframes.  We collected data on each gain/loss for every configuration and proceeded to make a Student’s t-test for unequal sample size and unequal variance.  The degrees of freedom were calculated using the Welch–Satterthwaite equation.

The following are selected experimental results, noting only the significant findings.  Please go to the Metrics page for the rest.

Results

The following data was obtained during the duration of the experiment:

Cumulative pips during the test period

Average pips per trade

Analysis

Ho2: The difference between any one configuration and the aggregate of the rest is due to randomness  (α=0.05)

We reject the null hypothesis.  The MACD 1/5 configuration is statistically significantly different from the rest of the configurations as an aggregate given the chosen probability criterion.

Conclusions

Most of the results were inconclusive, however, the MACD 1/5 version had an average of 5 pips/trade, finished the test period with 170 accumulated pips, and the results were statistically significant when compared with all other results.

The next phase of the experiment will focus on the MACD 1/5.  We will test this configuration further under a wider variety of conditions and see if it can be improved further.

Metrics posted for 4/10 – 4/17

This week ended with somewhat mixed results, but no major technical issues to speak of.  Metrics are posted, and they show that although DMA1/5/15 appeared to have the best results with an average gain of ~7 pips per trade, the results are not statistically significant.

Additional EA added

I’ve added an additional EA to the fray.  This one uses MACD states to define the market states.  I’m only using 2 timeframes in this case, because if I were to use three I’d wind up with 4,096 market states with very rarified statistics.

As a result of the new addition, I’ve rearranged things a bit.  There are now two columns and three rows in the broadcast.  The left column has the 1/5/15 timeframes, and the right column shows the 1/30/60 timeframes.  The rows show the DMA, MAFR, and MACD versions from top to bottom respectively.

I accidentally left the multiple order setting active for the MAFR 1/5/15 version on Monday, with pretty disastrous results.  Suffice it to say that this EA is no longer in the positive.  As for the new guy on the block, the MACD 1/5 version got off to a good start, being already up 43 pips since its debut last night on only 2 trades.  I should mention its second trade did a great job of nailing the rise in EURUSD today between 14:57 and 17:28 GMT.

Another thing I noticed is that the SL and TP levels were not being dynamically updated in certain EAs, and some were missing their exit signals.  I figured out where the bug was and fixed it, but I can’t implement it until tonight.  I’ve also tightened up my configuration control procedures to try and keep these issues from reoccurring.

Stay tuned…

 

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: