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

MA Cross with TF agreement based MM
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=212
Page 2 of 4
Author:  ironrick [ Thu Jan 05, 2012 7:51 pm ]
Post subject:  Re: MA Cross with TF agreement based MM

Khalaad wrote: ... lots of pseudo experts around! Fourier is for the mathematically inclined. My advise is to read JM Hurst’s Profit Magic of Stock Transaction Timing.

Similarly, for optimization, I would only read, and lean from, an acknowledged authority. Robert Pardo, for instance. The use of technical analysis (or any other form of analysis) is to gain an edge; a properly optimized system can help one along. So, don’t be put off by if you read things rubbishing optimization. 8-)
OH NO!! HELP!! I am stuck in an amazon.com book buying frenzy and I can't get out!!!!! :ugeek:

Seriously though, these look amazing! Especially The Evaluation and Optimization of Trading Strategies by Robert Pardo. ($73 though. Ouch!) I can't wait to get my hands on that book!! I think it should be required reading for most of us wanting to participate in this forum! :D

Thanks for pointing me in the right direction!

Off topic: I think there needs to be a new section on the forum that is devoted to book recommendations (especially if they are from Khalid!) Just like there is one dedicated to thoughts and articles on money management.

Actually I would like to see a section just dedicated to thoughts and resources etc on optimization too. Could be very helpful!

R
Author:  garyfritz [ Fri Jan 06, 2012 5:07 am ]
Post subject:  Re: MA Cross with TF agreement based MM

Khalaad wrote:With regards to Tradestation: Gary is wonderful with EasyLanguage, but EasyLanguage has a very clumsy way of handling multiple time frames. :(
It's not too terrible. You just set up a chart with multiple-TFs -- so one chart contains e.g. M15, H1, H4. You can hide any TFs you don't want to see. Then you refer to e.g. the EMA of data series 1, or the EMA of data series 2, etc. There are a few tricks to understand to make it work, and it can definitely drive you mad if you don't know how to make it jump through its hoops, but it's no worse than any of Empty4's foibles!! :lol: It definitely isn't as flexible as Empty4, though. E.g. you can't reference arbitrary TFs from MQL. You can only reference what's set up in the chart.

Let me make sure I understand, Rick: each TF generates a bullish/bearish "vote." That vote is based on the MAs? E.g. if the fast is above the slow, it's bullish? Or are you acting more on the MA-cross event?

Unfortunately I am swamped. If I get a chance I'll take a look at it but I'm already way behind on a project I have to deliver this month.
Author:  ironrick [ Fri Jan 06, 2012 9:17 am ]
Post subject:  Re: MA Cross with TF agreement based MM

garyfritz wrote:
Khalaad wrote:With regards to Tradestation: Gary is wonderful with EasyLanguage, but EasyLanguage has a very clumsy way of handling multiple time frames. :(
It's not too terrible. You just set up a chart with multiple-TFs -- so one chart contains e.g. M15, H1, H4. You can hide any TFs you don't want to see. Then you refer to e.g. the EMA of data series 1, or the EMA of data series 2, etc.
//begin-venting// I called Tradestation today to find out if I could have a demo of the trading platform so that I could take a look at easylanguage and backtesting features etc .... The sales guy (who was something of a very pushy jerk) said you have to have a $2000min deposit for you to be able to look at it -- even to demo it. So frustrating. He said we would have to "come to a revenue nuetral agreement... since the platform software costs us so much". A quote from a movie: "I really don't like that man."

I have done all my real money trading though Thinkorswim -- Tradestation's biggest/er competitor (by a lot)-- and they have NO platform fees... and you can open as many demo accounts as you want!

I am not really saying anything against Tradestation, I just have a bad taste in my mouth as a potential customer. //end-venting// :x

garyfritz wrote:Let me make sure I understand, Rick: each TF generates a bullish/bearish "vote." That vote is based on the MAs? E.g. if the fast is above the slow, it's bullish?
Yes and yes.
garyfritz wrote:Or are you acting more on the MA-cross event?
It is sort of both/and. It involves the cross but (the default strategy) does not do anything at the MOMENT of the cross event itself.

Theoretically, all time frames COULD be polled at any point to be able to get a read of their composite signals. (In fact this is a variation I have requested as an option for the EA.) However, the DEFAULT strategy is that this is (only) done once at the opening of the lowest TF's new bar. That is when each timeframe is asked "have you changed your vote from the last time we checked?"
garyfritz wrote:Unfortunately I am swamped. If I get a chance I'll take a look at it but I'm already way behind on a project I have to deliver this month.
I know how that is! I am an impatiently patient man. I can wait. :) Please don't do anything to risk your current projects!

I am super grateful to everyone who is involved and has offered suggestions and helps!!

I can't wait to do more Khalid-inspired "official" testing. ;)

Cheers,
Rick
Author:  ironrick [ Fri Jan 06, 2012 9:57 pm ]
Post subject:  Re: MA Cross with TF agreement based MM

Khalaad wrote: The first thing to do here is to define risk. My experience is (also) that moving average crosses and stops do not go together very well. Hence I would define risk as average loss for individual pairs you wish to trade measured through back tests over a sufficiently large sample of trades.
Khalid
I have been thinking through how to do this.

This system is built on the fact that there could be/are many orders created during 1 particular trading run (based on the order signals each TF gives at any given point). Just take a peek at George's MillerCross indicator.

This means that we cannot simply look at all the INDIVIDUAL, stand-alone trades in the history and say XX many were positive and YY many were negative and the ratio between them is yy/xx and average loss on negative trades is ZZ.

The trades/orders must be grouped as a composite just as the signals are. In this way we will be able to see if the whole POSITION was profitable or not and what average POSITION losses are.

Basically, how well did the whole position follow this trend?

The only way I can think to do that is to group all the orders taken starting at a reversal from a net long/short position and ending at the next reversal to the opposite net long/short position -- which would then be the start of the next grouping of trades and so on.

(Another way of stating/visualizing this would: using the MillerCross indi, group all orders together starting with a cross above or below the zero line in the histogram and ending the group with a cross in the opposite direction.)

In cases where the strategy is not using an always-in approach, the trade sequence would end when there was a neutral/net zero position and start again on the first long/short order that brings us back in the markets.

All Orders from the history could then be brought into a spreadsheet and grouped manually to do any analysis.

BUT, in order to do that grouping, we would have to know what orders belong to what group. My suggestion is to put a comment in the first order to note when the beginning of each new sequence of orders began: "first order comment" to the next ("first order comment"-1) is our group of orders belonging to that POSITION.

That position is then +/- XX pips and so on. This would give us what we need to measure expectancy/profit factor, win rate, risk sizing etc.

Am I missing something? Does this sound right and seem workable?
Author:  gaheitman [ Fri Jan 06, 2012 10:22 pm ]
Post subject:  Re: MA Cross with TF agreement based MM

ironrick wrote:
Khalaad wrote: BUT, in order to do that grouping, we would have to know what orders belong to what group. My suggestion is to put a comment in the first order to note when the beginning of each new sequence of orders began: "first order comment" to the next ("first order comment"-1) is our group of orders belonging to that POSITION.
It would probably be easier to just increment the MagicNumber for each grouping.
Author:  ironrick [ Fri Jan 06, 2012 11:14 pm ]
Post subject:  Re: MA Cross with TF agreement based MM

gaheitman wrote:
ironrick wrote:
Khalaad wrote: BUT, in order to do that grouping, we would have to know what orders belong to what group. My suggestion is to put a comment in the first order to note when the beginning of each new sequence of orders began: "first order comment" to the next ("first order comment"-1) is our group of orders belonging to that POSITION.
It would probably be easier to just increment the MagicNumber for each grouping.

Yes. That is a much better idea. Same mechanics, but better notation/identification.

In fact, your way is much better when trying to put the data into a spreadsheet - much less data formatting to get it ready for analysis. I think it makes possible the use of a pivot table.... Hmmm.

Excellent.

R
Author:  gaheitman [ Fri Jan 06, 2012 11:45 pm ]
Post subject:  Re: MA Cross with TF agreement based MM

ironrick wrote: BUT, in order to do that grouping, we would have to know what orders belong to what group. My suggestion is to put a comment in the first order to note when the beginning of each new sequence of orders began: "first order comment" to the next ("first order comment"-1) is our group of orders belonging to that POSITION.
gaheitman wrote:
It would probably be easier to just increment the MagicNumber for each grouping.
ironrick wrote:
Yes. That is a much better idea. Same mechanics, but better notation/identification.

In fact, your way is much better when trying to put the data into a spreadsheet - much less data formatting to get it ready for analysis. I think it makes possible the use of a pivot table.... Hmmm.

Excellent.

R
It would also allow us to easily manage the grouping as a basket in case we wanted to react to max profit/loss of a grouping, or maybe max trades for a grouping. All kinds of options.

As I think about the system, I can't help but feel like the simple score isn't enough information to make the decision. For example, consider the following scenario:

Code: Select all

      1 hr   8 hr   Daily  Units
1     Up     Up     Dn     +
2     Up     Up     Up     +++
3     Dn     Up     Up     +
4     Up     Up     Up     +++
5     Dn     Up     Up     +
6     Dn     Dn     Up     -
In step 2, the daily finally turned up and we added two positions. Then in step 3, the hourly flipped and we close two positions. Then, in step 4, the hourly flips again and we add two positions. I feel much better about this step than step 2, since it seems like we had a retracement on the hourly chart and then the trend continued.

It "feels" like we should either weight the scores by timeframe or perhaps require the trades to only be in the direction of the uppermost time frame. I know this goes against the scaling in part and only increasing the trade when you are more confident, but like I said, I don't have the same confidence at step 2 and step 4, but I am taking the same action.

Anyhow, just typing what I've been thinking about.

George
Author:  ironrick [ Sun Jan 08, 2012 9:06 am ]
Post subject:  Re: MA Cross with TF agreement based MM

gaheitman wrote: It "feels" like we should either weight the scores by timeframe or perhaps require the trades to only be in the direction of the uppermost time frame... ...I don't have the same confidence at step 2 and step 4, but I am taking the same action.

Anyhow, just typing what I've been thinking about.

George

Hey! Sorry it took so long to respond -- away from the computer for too long... I actually tried to answer from my phone but got too frustrated with getting my thoughts down... :P

So thoughts about thinking, er, your thoughts -- stream of consciousnesses style.


1) The actual strategy as being LIVE traded uses a lowest TF of 4h, whereas your example uses a 1h.

This does not necessarily go against the ESSENCE of your point and concern, but I do think it important to point out. If part of you point is that there are way too many PA reversals that would happen too often at that lower TF that would NOT match higher TF Trends, then I agree. There is too much difference between a 1h TF and an 8h or 24h TF.

I think a partial solution is to use TFs that are a bit closer together (and together in their ratios). 4h, 8h 24h... 8 is 2x the 4 and the 24 is only 3 times the 8h. **Please see my next post for some comments about testing options regarding this.**

2) The above being said, however, following/examining your description and signals table DOES show that we were still actually correctly aligned in our trades for the Price Action - except for those lower TF PA reversals. To find out if this was a problem...

3) ...Your trade description/table does not show the trade DURATION -- i.e. how long and how big was the trend we were actually following. For how many pips were we on the right side of a +3 position, versus the wrong side of a +1 postion?

Again, how many pips did we actually capture with our variable trading positions within a particular trading sequence. Only then will we know if the system is able to "harvest" enough pips to last through the "winters" of ranging, whipsaws, MA lag, and those times where we really are long when we just shoulda been short and yet do we still come out ahead?

What are your thoughts about my thoughts? :)

I am just trying to interact with your concerns. Did I assuage any?

Rick
Author:  ironrick [ Sun Jan 08, 2012 9:17 am ]
Post subject:  Re: MA Cross with TF agreement based MM

All,

Some thoughts on [edit: my requested] options and testing...

Note: There is the main, official, as-live-traded strategy which is described in the trading idea description.

AND then there are some specifications to the system that *I* requested.

I have tried to make it obvious which is which, but since the default strategy had to be coded to test anyway, I thought about how to generically be able to add a few options to make it so we can test several other ideas/pieces/theories/bits regarding the overall default strategy.

How would each of these changes/ideas affect [edit: the system] as compared to the default "control group" strategy?
1) Which MA mode to use?
2) Which MA periods to use? --something less than the default 10/30 is almost certainly required on any chart that uses the lower TFs.
3) Which time frames to use beyond the the default of 4h, 8h, 24h. What about 6h, 12h, 24h?
4) What are the good ratios of TFs?
5) What about much lower TFs? such as a 1h, 2h, 6h? or even lower 15m, 30m, 2h?
6) What about MORE TFs to compare? I came up with the 7 TF number because it seemed a reasonable max number to work with and still allowed us to play with whether any particular version was "always in" (either short or long -- an odd number of TFs) or NOT always in (Short, long, neutral an even number of TFs).
7) What happens when you combine #2 and #3 and #4? Multiple TFs that span from the very low, say 15m, that go all the way up to 24h. (7 TFs total.)
8) What is the best way to start the trading sequence when first running the EA? Or, if only running 24/5, at the beginning of every week?
9) 24/7 vs. 24/5 performance?
10) Which trade to close when updating a sequence but not fully switching from long to short?

I am probably forgetting something but thought this little summary might be helpful.

Let me know what you think or if you have more ideas.

R

Edit 1-9-12:

In defense, I do not consider any of the above to be related to optimization except perhaps the testing of MA mode and periods.

The rest is an experiment that I wanted to conduct to see whether the entire trading strategy could be EXPANDED. Not optimized. Not curve fit. EG, if 3 TFs are good, what about having 7? I would consider it the difference of developing a potential strategy vs. curve fitting an existing one.

I am not asking anybody to do anything -- except of course to help a non-coder with some coding. The only help/contribution to that effort that I can provide then is to be absolutely crystal clear about what I need. Hence all my overly long posts... :) Plus, it seemed a lot easier to simply create one generic EA with all its foundational and related bits, rather than lots of separate bits in lots of separate EAs.

Numbers 8 and 10 above were never defined to me in the first place because they had/have no relevance if you are trading manually on the Thinkorswim platform (Which we all were/are). So I had to think of several ways to answer the question algorithmically. Don't know what the repercussions are of each choice, hence the need to do some testing...

I am perfectly willing to do ALL of the testing. I am not asking for help with that. (Unless someone really WANTS to help.)
Author:  ironrick [ Mon Jan 09, 2012 2:18 am ]
Post subject:  Re: MA Cross with TF agreement based MM

Khalaad wrote:
Optimisation is a very devisive issue. Those who, like me, cannot do it properly generally think it is a con :!:

Please learn to do it quitely; unless you are sure there is an expert optimiser amongst us. :roll:

Khalid

Not quite sure how to respond to this. So I won't.
All times are UTC Page 2 of 4