| Author |
Message |
   midge
Member
Username: midge Post Number: 284 Registered: 10-2002Rating: N/A Votes: 0
|
| | Saturday, July 24, 2004 - 11:17 am: | 
|
Timeframes... If you believe, as I do, that an instrument (forex spot) has as much chance of going up than going down, it doesn't augur well as a trading instrument, especially in that unlike many other instruments (stocks, cfd's, options etc.) they cannot rise forever or fall forever (specially the majors) since they all balance each others, or move “relatively” to each others. In theory, over a long period of time there should be as many ups as downs. It doesn't augur well, unless we can somehow exploit some characteristics of the movements. What I was looking for when developing this system was an exploitable movement characteristic, namely the length of a trend. The basic assumption was that if half the average length of a trend provided a gain sufficient in relation to the amount at risk (assuming that half the trends would be longer than the average and thus profitable), then it was a tradeable characteristic since it would have a positive expectancy to enter all trend changes. The system also had to work across most pairs and over all types of market conditions (hence the use of 20years+ back tests). The only thing left to do was to look for time frames where the trends were sufficiently long or offered sufficient potential gains. Looking at forex charts, it is very obvious that pairs are trending a long time on the weekly and daily charts. These are obviously tradeable even discounting the time to get a positive trend identification after the apex of a change in the trend. By this I mean the amount of pips that you don't take from the apex (top or bottom) waiting for a positive signal, waiting for a positive identification of a trend change. If the rules identify too late, you miss a lot of the beginning of the trend and give back a lot at the end, too early and you get stopped out and miss the rest of the trend. This system seems to work well on some smaller time-frames as well, at least down to 1H, maybe 30min., and some of the parameters could be twigged to suit the smaller time frames better, but I use it of the daily charts and use smaller time frames for timing of entry or exits sometimes. Now that the time frame is established, my next installment will be on how to generate trend start and end signals. I must say that in developing a system and back testing, past results are not guarantee of future results. So caveat emptor... MidGe
|
   midge
Member
Username: midge Post Number: 285 Registered: 10-2002Rating: N/A Votes: 0
|
| | Saturday, July 24, 2004 - 12:18 pm: | 
|
Trend, Entry and Exit signals Part 1 A classic way to identify trends is with breakouts (a higher high or lower low). This is the basis of the legendary turtle system amongst others. I ran some optimisation based on close > highest high for last N periods, or close < lowest low for last N periods. Effectively trying out a few thousand combinations of values for N to find the optimum ones over many simulations. For identification of trend start long I found 27 periods the better for a number of reasons/fits, and for shorts 20 periods was the choice. For identification of trend end long, 10 periods was the best and for trend end short 7 periods. Metastock formulas: LongEntryTrigger := CLOSE > Ref(HHV(H,27), -1) AND Fml( "MdG_BULL_TREND") ; LongExitTrigger := (LOW < Ref(LLV(L,10), -1)) OR Cross(Mov(MACD(),9,E) , MACD()) ; ShortEntryTrigger := CLOSE < Ref(LLV(L,20), -1) AND Fml( "MdG_BEAR_TREND") ; ShortExitTrigger := (HIGH > Ref(HHV(H,7), -1)) OR Cross(MACD(), Mov(MACD(),9,E) ) ; As you can see I have added a MACD crossing to the exit signal formula. This avoids a fair bit of retracement at the end of a trend. I also refer to the formulae MdG_BULL_TREND and MdG_BEAR_TREND. Those are other signals that signal whether or not trades should be taken within a broader context. A long trade should only be taken if the MdG_BULL_TREND is giving a “true” value. The absence of such a signal doesn't mean exiting the open longs. Conversely, A short trade should only be taken if the MdG_BEAR_TREND is giving a “true” value. The absence of such a signal doesn't mean exiting the open shorts. I'll give the details and formulae for MdG_BULL_TREND and MdG_BEAR_TREND in my next post. Meanwhile, past performance etc... is not guarantee of future performance. Cheers MidGe
|
   midge
Member
Username: midge Post Number: 286 Registered: 10-2002Rating: N/A Votes: 0
|
| | Saturday, July 24, 2004 - 01:12 pm: | 
|
Screenshot Here is a screenshot of the system applied to USDJPY, notice that it doesn't trade from late november 99 to November 2000 as the market gets range bound (asc triangle). Also, the first visible sell signal is during a brief period where the context is bearish as indicate in the lower bar by some hachured red (green for bull and magenta for neutral).
Cheers MidGe (Message edited by Midge on July 24, 2004)
|
   midge
Member
Username: midge Post Number: 287 Registered: 10-2002Rating: N/A Votes: 0
|
| | Saturday, July 24, 2004 - 08:50 pm: | 
|
MdG_BULL_TREND, MdG_BEAR_TREND These two indicators aim to identify the trends in the larger picture, allowing us to take advantage of the epicyclic nature of price movements. I have used the 27*5 and 20*5 type notation to emphasize the portion of the indicator whose realm is the weekly chart. It returns a true of false value with respect as to whether there is a bull or bear trend in the next higher time frame (weekly). Long trades as indicated by the primary breakout signal described in earlier posts are only activated if the corresponding MdG_XXX_TREND indicator returns true. If neither the Mdg_BULL_TREND or the Mdg_BEAR_TREND returns true the system is in neutral mode and no new trades are entered regardless of primary signals. Here are the MetaStock formulae: MdG_BULL_TREND If(CLOSE > Ref(HHV(H,27), -1) AND ( BarsSince( HHV(H,27*5)>Ref(HHV(H,27*5), -1)) < BarsSince( LLV(L,20*5)<Ref(LLV(L,20*5), -1)) > 0), 1, If(LOW < Ref(LLV(L,7), -1) OR Cross(Mov(MACD(),9,E) , MACD() ) > 0, 0, PREV) ); MdG_BEAR_TREND If(CLOSE < Ref(LLV(L,20), -1) AND ( BarsSince( HHV(H,20*5)>Ref(HHV(H,20*5), -1)) > BarsSince( LLV(L,20*5)<Ref(LLV(L,20*5), -1)) > 0), 1, If(HIGH > Ref(HHV(H,7), -1) OR Cross(MACD(),Mov(MACD(),9,E)) > 0 , 0, PREV) ); This is the system. The next level is how to improve the performance by timing the entries. I'll explain this in another post if enough interest, Meanwhile I am happy to answer any questions about this system. I have the code for a Metastock Expert for the BULL/BEAR_TREND also and most parts, or at least parts, of the system for the following platforms: Metastock, MetaTrader, VisualTrading, TradingSolution, TradeSim if anyone has a particular interest, Cheers, MidGe
|
   justice
Member
Username: justice Post Number: 262 Registered: 01-2003Rating: N/A Votes: 0
|
| | Sunday, July 25, 2004 - 11:46 am: | 
|
midge, Thanks so much for bearing it all.I have inevitably for you, just a few more questions. Is there a source for the historical and live data feed that drives this puppy. Is a DDE interface supported. What are the MACD parameters? 12,26,9 34,5,5 ?? What is the literal meaning of: (I do not use Metastock) Ref(HHV(H,27), -1) Is it: High of previous period is the highest high of the last 27 periods. ?? Cross(Mov(MACD(),9,E) , MACD() ) > 0, 0, PREV) ?? NOT: BarsSince( HHV(H,27*5)>Ref(HHV(H,27*5), -1) simply, BarsSince actual number of bars. ?? Have I missed anything? Cheers, Ice. (Message edited by justice on July 25, 2004)
Faber est suae quisque fortunae. Each man is the smith of his own fortune.~ Appius Claudius Caecus
|
   midge
Member
Username: midge Post Number: 288 Registered: 10-2002Rating: N/A Votes: 0
|
| | Sunday, July 25, 2004 - 12:14 pm: | 
|
justice, Here is the answer to your questions. “Is there a source for the historical and live data feed that drives this puppy.” It is not driven live as it is based on an EOD signal. I get the historical data from a number of sources. My main one being the one available thru Metatader, which is free. “Is a DDE interface supported.” No, but it should not be difficult to do on the basis of the formulae I have given. “What are the MACD parameters? 12,26,9 34,5,5 ??” MACD() returns the value of the MACD indicator (i.e., the solid line). The formula "mov(macd(),9,E)" returns the value of the MACD's signal line (i.e., the dotted line). The MACD is the “standard” MACD. The indicator is really the difference between 0.15 and 0.075 exponential moving averages (whereas, when expressed in decimal form, the 12- and 26-day exponential moving averages are actually 0.153846 and 0.076923 exponential moving averages). “What is the literal meaning of: (I do not use Metastock) Ref(HHV(H,27), -1) Is it: High of previous period is the highest high of the last 27 periods. ??” Yesterdays highest high of the previous 27 days. “Cross(Mov(MACD(),9,E) , MACD() ) > 0, 0, PREV) ??” if the MACD signal line crosses above the MACD indicator, returns False else return the previous day value. “BarsSince( HHV(H,27*5)>Ref(HHV(H,27*5), -1) ??” Returns the number of periods since which the highest high of the last 135 days was higher than the previous day value. (That is a breakout). Hope this help. Cheers MidGe
|
   justice
Member
Username: justice Post Number: 266 Registered: 01-2003Rating: N/A Votes: 0
|
| | Sunday, July 25, 2004 - 03:50 pm: | 
|
midge, You'd said that the system was perhaps applicable to 30min and 1H timeframes also, so I had thought you may use intraday data as well and you had the Metastock script running every 30mins (for example) I assume it has DDE. _MetaTrader_ has a DDE interface. If it had a script language or could export historical data also, it would be perfect simply on it's own. Thanks again, all that's clear. justIce (Message edited by justice on July 25, 2004)
Faber est suae quisque fortunae. Each man is the smith of his own fortune.~ Appius Claudius Caecus
|
   midge
Member
Username: midge Post Number: 289 Registered: 10-2002Rating: N/A Votes: 0
|
| | Sunday, July 25, 2004 - 04:29 pm: | 
|
justice, I think you will need different values for the period parameters, but I suspect you will positive performance on smaller time frames, My simple explorations indicated so. I like the daily because I think it is easier to trade and I like it's rhythm. It allows for plenty of reflection Yes I have access to intraday data as well (in any case you can download it from Metatrader). I must add, that I use different platforms for my simulations, tests and optimisations, and I am not too concerned about exact performance but simply to know that there is an edge is sufficient. I am currently trading this system, with small variants. I have two open positions and none of the other pairs are close to giving a signal, they are all in neutral. I think the system can be significantly improved by trying to buy on retracement and on a bounce of the stop. It gives a much RR ratio and probably adds 70 pips for both side (entry and exit - 30-40 pips each on average)of the trade. That's how I use it. I trail the price during a retracement with a stop entry to catch it's reversal. Cheers MidGe
|
   snifter
Member
Username: snifter Post Number: 586 Registered: 11-2002Rating: N/A Votes: 0
|
| | Sunday, July 25, 2004 - 10:39 pm: | 
|
Midge Thanks for going to so much trouble to tell us about your system - although I have to admit you've baffled me with science!! However, looking at your chart it appears that basically you're buying after an uptrend dips finishes and the uptrend resumes, and I presume reversing the process for short entries during downtrends? Cheers, Snifter
|
   snifter
Member
Username: snifter Post Number: 587 Registered: 11-2002Rating: N/A Votes: 0
|
| | Monday, July 26, 2004 - 08:17 am: | 
|
Looking at my post above, due to a typo I realise its a bit confusing. What I meant to say is that Midge's system appears to go long after there's a dip during an uptrend...the system enters when the pullback is over and the uptrend resumes. And uses the mirror image of that strategy to go short. Is that basically correct Midge? Cheers, Snifter
|
   midge
Member
Username: midge Post Number: 290 Registered: 10-2002Rating: N/A Votes: 0
|
| | Monday, July 26, 2004 - 07:10 pm: | 
|
hi snifter, The backbone of the system is to enter a long only if the weekly trend (my definition) is bullish and short if the weekly trend is bearish. 1) I define the trend via highest high value and lowest low value, using different parameters for entry and exit (periods 27 [HHV] & 10 [LLV] for longs and 20 & 7 for shorts). 2) I do essentially the same for the daily charts. Of course the parameters here are number of days rather than number of weeks. 3) I refine the signal (earlier exit) based on the MACD, etc. 4) I discretionarily time my entry following a fresh signal (as long as the weekly trend is on). Here I try to place the order on retracement by trailing the price with a stop buy for longs and a stop sell for shorts. This reduce my risk and increase my reward. The result of the simulation above are based on non-discretionary entries, meaning the entry is based on open the day after the signal is first issued. Discretionary entries are supposed to improve the results and I am trying a number of ways to program this right now. You could say that I am trying to take advantage of the epicyclic characteristic of price movements. Hope this makes it clearer. Cheers MidGe
|
   snifter
Member
Username: snifter Post Number: 592 Registered: 11-2002Rating: N/A Votes: 0
|
| | Tuesday, July 27, 2004 - 01:17 pm: | 
|
Midge Thanks - your willingness to share your knowledge and strategies is appreciated by all on this forum. Cheers, Snifter
|
   staybaker
Member
Username: staybaker Post Number: 40 Registered: 03-2003Rating:  Votes: 1
| |