Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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 04-04-2006, 02:01 AM
Junior Member
 
Join Date: Mar 2006
Posts: 3
Fishtank is on a distinguished road
Simple question of determining the time of day

Hi, I need to be able to filter the time of day in my EA. Specifically if it's 7am-11am on my pc, then then execute a certain part of the code. If it's any other time use the other part of the code.

Using an if statement is fine, I read through the time functions in metatrader, from what I can tell they all return the time in the amount of seconds passed since Jan. 1 1970.

I'm not sure what I'm missing here, but how can you manipulate the time to trade certain parts of the code during the same time period every day.

Any help is appreciated!!! Look forward to spending some time in these forums as it seems to be the most active one I have found regarding MT4.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-04-2006, 03:51 AM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
Will this help?

if((TimeHour(Time[0])>=(EntryHourA) && TimeMinute(Time[0])==TimeAMin) &&
(TimeHour(Time[0])<=(EntryHourB) && TimeMinute(Time[0])==TimeBMin))

{

Buy...
Sell...
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-04-2006, 04:12 AM
Junior Member
 
Join Date: Mar 2006
Posts: 3
Fishtank is on a distinguished road
Thx!

Yes it did help, I haven't used any time functions in my ea's until I found the need to today. I was unaware of the TimeHour() function, and it's really all I need to continue on. Thanks for your time, it did help me out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 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 (i think) question RE iMA bwilhite Metatrader 4 3 09-08-2006 04:30 PM
A simple question from a newbye tradetrade Metatrader 4 1 07-18-2006 07:08 AM
my first EA, simple question ycomp Metatrader 4 3 01-24-2006 05:46 PM


All times are GMT. The time now is 06:31 AM.



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