Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2005, 03:33 PM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
Question: Time base exit

Hi,

How can I know the duration expresse by number of bars (in the current chart) for a specific position ?
Actually, I want to close a position automatically after 30 bars (in my expert-advisor)
How can I do that ?

10X !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-16-2005, 03:48 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,160
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
On m1 timeframe one bar will be appeared every one minute.
If m15 - every 15 minutes.
Just 30 multiply by timeframe.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-16-2005, 04:07 PM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
But how can I code this (in mql4)?

I understand what you said, but I still don't know how to code it in mql4.
How can I know the number of bars from the opening of a specific position ?
The timeframe is not important because I simply want to close a posision after X bars (no matter the timeframe)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-16-2005, 04:37 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,160
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Look at Templates to create EAs and Indicators

It is template to create EA. May be you will find it.

I can not write EA from the beginning up to end.
Will wait for the codersguru lessons.

I think Codersguru may answer.

Sorry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-16-2005, 04:54 PM
yaniv_av yaniv_av is offline
Member
 
Join Date: Oct 2005
Posts: 34
yaniv_av is on a distinguished road
I'll put that question at codersguru thread

10X anyway (:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-16-2005, 11:35 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Answered!

yaniv_av,

I've submitted the answer here .

Hope I solved it.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
time question ajk Questions 1 03-23-2007 03:02 AM
Time fucntion question knili Metatrader 4 2 09-18-2006 07:52 PM
Simple question of determining the time of day Fishtank Metatrader 4 2 04-04-2006 04:12 AM


All times are GMT. The time now is 05:48 AM.