Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2007, 05:31 PM
carllos's Avatar
Member
 
Join Date: May 2006
Location: Portugal
Posts: 64
carllos is on a distinguished road
Question Close after 5 bars

Please , can anyone tell me the code for this:

"close a trade after 5 bars"

Thankx

Carllos
__________________
"Hoe ur pips mate?"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 05-15-2007, 08:01 PM
Junior Member
 
Join Date: Mar 2007
Posts: 2
Pawel is on a distinguished road
Define static global variable:
static int barsAtStart;

After placing order make an assignment
barsAtStart = Bars;

Then if following condition is true close order:
if(Bars - barsAtStart >= 5)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 05-15-2007, 09:12 PM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
here you go
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 05-15-2007, 10:14 PM
carllos's Avatar
Member
 
Join Date: May 2006
Location: Portugal
Posts: 64
carllos is on a distinguished road
Smile

Thanks Pawel, I just couldnŽt figure out.
Appreciate it.

Asmdev, thanks for nothing. I DID search the forum for this answer. That was really not necessary. If youŽd post an answer or a link, iŽd appreciate it.

Carllos
__________________
"Hoe ur pips mate?"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Appendix 1 - BARS codersguru Lessons 18 11-07-2009 04:42 PM
Open/close trade on same bar's close? WNW Expert Advisors - Metatrader 4 2 03-29-2007 06:37 AM
Inside Bars biggo Metatrader 4 0 01-22-2007 12:56 AM
Day Bars Jonmem Setup Questions 2 12-12-2006 07:31 PM
Trouble with bars pabloschiki Metatrader 4 4 08-29-2006 09:09 PM


All times are GMT. The time now is 03:24 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.