Entry Issue with Donchian Channel
  #1 (permalink)  
Old 05-26-2008, 02:37 AM
Freshman
 
Join Date: Jun 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
albrightsteve is on a distinguished road
Default Entry Issue with Donchian Channel

My entry technique: I intend to enter long or short when the current price bar closes above or below a Donchian Channel (50 day market high or low)

......

double DonchianLowerEntry = iCustom(NULL,0,"DonchianChannel2",2400,3,-2,0,100,0,0); // Entry for Lower Donchian Channel - 50 days, 2400
double DonchianUpperEntry = iCustom(NULL,0,"DonchianChannel2",2400,3,-2,0,100,1,0); // Entry for Upper Donchian Channel - 50 days, 2400
double ClosingPrice = iClose(NULL,0,0); //Closing Price of current bar

......

if(ClosingPrice>DonchianUpperEntry) // Closing price is greater than the Donchian upper channel
{
if(trend>0) // Trend is up - MACD indicator filter
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-TrailingStop,0,"Alcatraz: Long Order Placed",16384,0,Green); // Open Long order

.....

Expert Advisor is opening a trade when bar penetrates Donchian Channel, but does not close above the Channel. It should be opening trade only when it CLOSES above the channel. Does anyone know why this might be happening?
Reply With Quote
  #2 (permalink)  
Old 05-26-2008, 08:59 PM
bossxero's Avatar
Forex Leader
 
Join Date: Nov 2006
Posts: 454
Thanks: 110
Thanked 87 Times in 53 Posts
bossxero has a spectacular aura aboutbossxero has a spectacular aura about
Send a message via ICQ to bossxero Send a message via MSN to bossxero Send a message via Yahoo to bossxero Send a message via Skype™ to bossxero
Default

if(ClosingPrice>DonchianUpperEntry)

The ClosingPrice should be for bar 1 and not bar 0 (current tick)

I guess thats what causing the error ...
__________________
F r e e___F o r e x___E b o o k s___a n d___S t u f f s

-> Cheap MQL Coding service for your EA/indicator is Here <- <-

Reply With Quote
The following users have thanked bossxero for useful post above:
  #3 (permalink)  
Old 05-27-2008, 05:11 AM
Forex Warrior
 
Join Date: Feb 2007
Posts: 261
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by bossxero View Post
if(ClosingPrice>DonchianUpperEntry)

The ClosingPrice should be for bar 1 and not bar 0 (current tick)

I guess thats what causing the error ...
Good eyes Boss

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor
developed by Spiritfriends and coded by FerruFx ... more info
Reply With Quote
  #4 (permalink)  
Old 05-28-2008, 02:35 AM
Freshman
 
Join Date: Jun 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
albrightsteve is on a distinguished road
Default

You're right, Boss. That did the trick! Thanks!
Reply With Quote
no connection on my metatrader terminal
  #5 (permalink)  
Old 05-30-2008, 07:58 AM
mamee's Avatar
Freshman
 
Join Date: May 2008
Posts: 25
Thanks: 3
Thanked 12 Times in 6 Posts
mamee is on a distinguished road
Default no connection on my metatrader terminal

hello Bossxero...
I have problem .cant you tell me why trading terminal metatrader disconnect..what is problem it?

Thank u...
__________________
#X-Low level student #
Reply With Quote
  #6 (permalink)  
Old 05-31-2008, 02:14 AM
Forex Warrior
 
Join Date: Feb 2007
Posts: 261
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by mamee View Post
hello Bossxero...
I have problem .cant you tell me why trading terminal metatrader disconnect..what is problem it?

Thank u...
Check your internet connection or it is a broker server problem.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor
developed by Spiritfriends and coded by FerruFx ... more info
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Entry EA Tribulus Trading Systems 0 05-25-2008 02:57 AM
timeframe calculating issue Libros MetaTrader and ZeroCode 1 08-03-2007 08:25 AM
'Dynamic' Shi Channel fleshmorph Indicators 1 12-15-2006 02:43 AM
Historical data issue Damir1105 General Trading Talk 1 10-26-2006 01:33 AM
Double entry rules TraderSeven MetaTrader and ZeroCode 5 06-23-2005 05:54 AM


All times are GMT. The time now is 12:18 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now