Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Expert Advisors - 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 08-03-2006, 03:44 AM
Senior Member
 
Join Date: Jan 2006
Posts: 80
jyrik is on a distinguished road
How to add hour to hour trade on an ea?

How to add hour to hour trade on an ea?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-03-2006, 05:12 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
can u explain more about your question?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-03-2006, 04:36 PM
Junior Member
 
Join Date: Jan 2006
Posts: 2
ndisyh is on a distinguished road
I have the same question (may be), for example : I want to trade every 30 minutes or every 1 one hour
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-03-2006, 05:30 PM
Senior Member
 
Join Date: Jan 2006
Posts: 80
jyrik is on a distinguished road
I want to add to ea option to trade on gmt 12-15
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-04-2006, 07:59 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
Quote:
Originally Posted by ndisyh
I have the same question (may be), for example : I want to trade every 30 minutes or every 1 one hour
you can use the iTime() function

like this
PHP Code:
      bool allowtrade=true;
      for (
int cnt cnt OrdersTotal() ; cnt++)
      {
         
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
         if (
OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNo)
         {    
            
int lastopentime OrderOpenTime();
            if(
lastopentime>iTime(Symbol(),PERIOD_H1,0))
                     
allowtrade false;
         }   
      }

      
//---------

      
if(allowtrade)
      {
          
OrderSend(..........);
      } 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-04-2006, 08:08 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
Quote:
Originally Posted by jyrik
I want to add to ea option to trade on gmt 12-15
do you mean, you want to trade only after 00:00 O'clock of your gmt 12 time?

anyway

1st you need to know the server time

then convert it to the gmt time

and use the iTime(Symbol(),PERIOD_D1,0) as a reference ,
it's the 00:00 O'clock of the server time

if server time is on gmt +2
then only allow to trade only after iTime(Symbol(),PERIOD_D1,0)+(10*60*60)

like

if(CurTime()>iTime(Symbol(),PERIOD_D1,0)+(10*60*60 ))
{
OrderSend(.....);
}

-------------
hope it helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-05-2006, 01:46 PM
Junior Member
 
Join Date: Jan 2006
Posts: 2
ndisyh is on a distinguished road
Thank you phoenix...
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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Market hour svirgo Metatrader 4 2 05-14-2007 05:48 AM
Hour buy and sell EA jyrik Expert Advisors - Metatrader 4 0 12-12-2006 02:40 PM
4 hour data fxdk Metatrader 4 2 05-02-2006 02:22 PM
How to use Hour() function Maury74 Questions 3 12-28-2005 01:35 PM
24 hour devider Audio Metatrader 4 9 12-05-2005 02:56 PM


All times are GMT. The time now is 02:52 PM.



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