Topic: Donchian

I had an issue using the Donchian Channel as an opening Point at this mornings open (EURUSD). The market gapped open above the channel and my strategy Enters Short at the Donchian Channel High. MT4 missed the order as the broker opened late and I thought it would just go short at the next bar but it seems that when using Donchian Channel as an opening point it doesn't do that as the price is outside the band. Any ideas?

Re: Donchian

Post your chart.

Re: Donchian

http://s13.postimage.org/p74biz91v/EURUSD_M15_2012_06_11_20_15_58.jpg

Re: Donchian

Well, this code block covers cases like this in the Donch source code:

if ((dValueUp1 > High[iBar - 1] && dValueUp < dOpen) || // The Open price jumps above the indicator
    (dValueUp1 < Low[iBar -  1] && dValueUp > dOpen) || // The Open price jumps below the indicator
    (Close[iBar - 1] < dValueUp && dValueUp < dOpen) || // The Open price is in a positive gap
    (Close[iBar - 1] > dValueUp && dValueUp > dOpen))   // The Open price is in a negative gap
        dTempValUp = dOpen; // The entry/exit level is moved to Open price

And none of those conditions are true, but there is jumping going on, which should trigger the trade.

This seems like a bug (or lets say clarification in the code is needed) to me, but developer has the final say on this.

Re: Donchian

Maybe this block would be good:

if (dValueUp < High[iBar - 1] && dValueUp > Low[iBar -  1])
dTempValUp = dOpen;

That means if price actually crossed with Donch, like at 2:00 in your case Spiderman, the trade would be opened at the start of the next bar.

BTW, was the signal profitable?

Re: Donchian

I think first "jump" condition is satisfied. The entry should be at the Open price. But what about entry filters?

Re: Donchian

Popov wrote:

I think first "jump" condition is satisfied. The entry should be at the Open price. But what about entry filters?

1:45 Donch value (dValueUp1) is at 1.2519, 2:00 High is at 1.2640, therefore it is not satisfied or am I missing something?

Re: Donchian

We have "up Jump" when:
Previous indicator > previous High AND Current Indicator < Current Open.

Since Indicator appears below Open, entry is executed at Open.
In the SpiderMan's case: Enter short at Up band, this logic makes a better entry.

Re: Donchian

Popov wrote:

We have "up Jump" when:
Previous indicator > previous High AND Current Indicator < Current Open.

No argument there, but that condition is not satisfied:

http://s17.postimage.org/53kp6rh17/up_jump.jpg

Re: Donchian

I have copied the text from the FST log below, as you can see I started FST at 06:40:52 and at 07:00:17 the short order entry was sent. The broker failed to fill the order and FST retried a few times and then gave up. I posted a thread similar about this a while ago regarding what should happen if the order fails and I believe that  this will be addressed in a future release. I think FST should keep on trying until the order gets filled (within certain parameters).

Footon, you asked if the signal was profitable. At this time I would be over 100 pips in profit. I have a fixed profit target of 110 pips which should have been hit and the position would have been nowhere near the stop loss, so yes.


2012-06-11 06:40:52,Automatic trade started.
2012-06-11 07:00:17,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26382, Stop Loss 1.26855, Take Profit 1.25320
2012-06-11 07:00:18,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:24,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26382, Stop Loss 1.26855, Take Profit 1.25320
2012-06-11 07:00:24,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:26,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26382, Stop Loss 1.26855, Take Profit 1.25320
2012-06-11 07:00:27,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:30,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26381, Stop Loss 1.26854, Take Profit 1.25319
2012-06-11 07:00:30,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:31,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26383, Stop Loss 1.26856, Take Profit 1.25321
2012-06-11 07:00:31,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:32,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26381, Stop Loss 1.26854, Take Profit 1.25319
2012-06-11 07:00:33,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:33,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26382, Stop Loss 1.26855, Take Profit 1.25320
2012-06-11 07:00:33,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed
2012-06-11 07:00:34,EURUSD M15 An entry order sent: Sell 0.29 lots at 1.26359, Stop Loss 1.26832, Take Profit 1.25297
2012-06-11 07:00:35,MetaTrader- AxisTrader failed to execute order! Returned: Market is closed

Re: Donchian

footon wrote:

Maybe this block would be good:

if (dValueUp < High[iBar - 1] && dValueUp > Low[iBar -  1])
dTempValUp = dOpen;

That means if price actually crossed with Donch, like at 2:00 in your case Spiderman, the trade would be opened at the start of the next bar.

BTW, was the signal profitable?


At 2:00, as an opening logic condition shouldn't it have opened a position when it crossed the channel, not on the next bar?

Re: Donchian

SpiderMan wrote:

At 2:00, as an opening logic condition shouldn't it have opened a position when it crossed the channel, not on the next bar?

I'm lost now, is it used as Opening Point (Open) or Opening condition (Open.Filter)?

If we are talking about the first one (Open), then no, entry should have been at the start of the next bar due to the use of previous bar value.

Re: Donchian

footon wrote:
SpiderMan wrote:

At 2:00, as an opening logic condition shouldn't it have opened a position when it crossed the channel, not on the next bar?

I'm lost now, is it used as Opening Point (Open) or Opening condition (Open.Filter)?

If we are talking about the first one (Open), then no, entry should have been at the start of the next bar due to the use of previous bar value.

Yes, sorry I got that the wrong way around. Shouldn't it have opened a position when it crossed the channel as it is an opening point?

Re: Donchian

No, it takes the previous bar value of Donch and compares it to current bar price, and if those two match, position is opened at that price.

Re: Donchian

I get much better results using Donchian as an Opening Point rather than using Bar Open and the logic condition Donchian Channel. I would assume that is because the bar often breaks the Donchian Channel and closes below it thus not triggering a trade using bar open. Maybe if there was an additional option in the logic condition like "the bar extended above the higher band but closed below it" and "the bar extended below the lower band but closed above it" then the results should be similar. This might also help the situation where the Opening Point is used and position runs away after it crosses the channel and closes above it. It would be nice to have that to work with.

Re: Donchian

SpiderMan wrote:

Maybe if there was an additional option in the logic condition like "the bar extended above the higher band but closed below it" and "the bar extended below the lower band but closed above it" then the results should be similar. This might also help the situation where the Opening Point is used and position runs away after it crosses the channel and closes above it. It would be nice to have that to work with.

This calls for a custom job, rather easy I expect. My most recent coding project seems to take at least a week more (the result of 3-days-and-it's-sorted type of planning...), so if you're interested I'll put it on my to-do list.

Re: Donchian

footon wrote:
SpiderMan wrote:

Maybe if there was an additional option in the logic condition like "the bar extended above the higher band but closed below it" and "the bar extended below the lower band but closed above it" then the results should be similar. This might also help the situation where the Opening Point is used and position runs away after it crosses the channel and closes above it. It would be nice to have that to work with.

This calls for a custom job, rather easy I expect. My most recent coding project seems to take at least a week more (the result of 3-days-and-it's-sorted type of planning...), so if you're interested I'll put it on my to-do list.

I am definitely interested, put it on your list! Thanks.

Re: Donchian

Alright, here's my version. If price touches a band, position will be opened next bar, if price is out of bands, position will be opened too.

Post's attachments

Custom Donch.cs 26.32 kb, 16 downloads since 2012-06-12 

You don't have the permssions to download the attachments of this post.

Re: Donchian

Thanks Footon, I'll check it out.