Forex



Go Back   Forex Trading > Downloads > Expert Advisors - 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
  #111 (permalink)  
Old 06-23-2009, 06:15 AM
Junior Member
 
Join Date: Jun 2009
Posts: 3
nsolomon is on a distinguished road
Time-of-day order

Hi, im using mt4 and i would like to know how to open trade at a specific time period? Is there any ea? Thanks.
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
  #112 (permalink)  
Old 06-24-2009, 05:23 AM
Junior Member
 
Join Date: Jun 2009
Posts: 3
nsolomon is on a distinguished road
Talking

Quote:
Originally Posted by matrixebiz View Post
Hello, I have this TimeBased EA that opens trade at a specific time;
Code:
//+------------------------------------------------------------------+
//|                                                  TimeBasedEA.mq4 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
//changed by:       "forex4capital@yahoo.ca"

// Time frame: M5 and higher

extern int     MagicNumber = 20080122;
extern int     OpenHour     = 8;        
extern int     OpenMinute   = 55;      
extern double  TakeProfit  = 10;
extern double  StopLoss    = 10;
extern double  Lots        = 0.1;
extern bool    OpenBuy     = true;
extern bool    OpenSell    = false;
extern int     NumBuys     = 1;
extern int     NumSells    = 1;
extern int     Slippage    = 3;

//+------------------------------------------------------------------+
//|                        S T A R T                                 |
//+------------------------------------------------------------------+
int start()
  {
   int cnt, ticket, total;
   //int ct;
//-------------------------------------+
   if(Bars<100)
     {
      Print("bars less than 100");
      return(0);  
     }
//-------------------------------------+
   if(TakeProfit<10)
     {
      Print("TakeProfit less than 10");
      return(0);  // check TakeProfit
     }
//-------------------------------------+
   //ct = Hour() * 100 + Minute();
   total=OrdersTotal();
   if(total<1) 
     {
      // no opened orders identified
      if(AccountFreeMargin()<(1*Lots))
        {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);  
        }
      // check for long position (BUY) possibility
      if (Hour()==OpenHour && Minute()>=OpenMinute && OpenBuy)
      //if(ct == StartHour && Close[1]>Open[1] && OpenBuy)
      //if(ct == StartHour && High[1]<Open[0] && OpenBuy)
        {
         for ( cnt = 0; cnt < NumBuys; cnt++)
         {
           ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Bid-StopLoss*Point,Ask+TakeProfit*Point,"",MagicNumber,0,Blue);
           if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
           else Print("Error opening BUY order : ",GetLastError()); 
         }
         return(0); 
        }
      // check for short position (SELL) possibility
      if (Hour()==OpenHour && Minute()>=OpenMinute && OpenSell)
      //if(ct == StartHour && Close[1]<Open[1] && OpenSell)
      //if(ct == StartHour && Low[1]>Open[0] && OpenSell)
        {
         for ( cnt = 0; cnt < NumSells; cnt++)
         {
           ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Ask+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,Red);
           if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
           else Print("Error opening SELL order : ",GetLastError());
         } 
         return(0); 
        }
     }
   return(0);
  }
// the end
How do I add in Close code to Close the trade at another specific time?
Code:
//---- Close input parameters
extern int   CloseHour     = 7;      // Время закрытия, часы
extern int   CloseMinute   = 0;      // Время закрытия, минуты
bool  UseCurrSymbol = True;  // Использовать только один инструмент
extern color clCloseBuy    = Blue;   // Цвет закрытия покупки
extern color clCloseSell   = Red;    // Цвет закрытия продажи.....

.............

  if (Hour()==CloseHour && Minute()>=CloseMinute) {
    for (int i=OrdersTotal()-1; i>=0; i--) {
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
        if (!UseCurrSymbol || OrderSymbol()==Symbol()) {
          if (OrderType()==OP_BUY) {
            pBid=MarketInfo(OrderSymbol(), MODE_BID);
            OrderClose(OrderTicket(), OrderLots(), pBid, Slippage, clCloseBuy);
          }
          if (OrderType()==OP_SELL) {
            pAsk=MarketInfo(OrderSymbol(), MODE_ASK);
            OrderClose(OrderTicket(), OrderLots(), pAsk, Slippage, clCloseSell);
          }
        }
      }
    }
  }
}
Thanks
Thank you bro, actually im looking for tis.
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
  #113 (permalink)  
Old 07-21-2009, 11:23 PM
Junior Member
 
Join Date: Mar 2008
Posts: 2
RomanDG is on a distinguished road
close orders at specific time

Hi folks,

I'am searching for a simple EA which closes all open trades at a specific time.

any ideas?

thank you very much in advance!

regards,

Roman
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
  #114 (permalink)  
Old 07-22-2009, 02:17 AM
1Dave7's Avatar
Senior Member
 
Join Date: Aug 2007
Posts: 183
1Dave7 is on a distinguished road
Smile

To my simple ea friend. The type of EA you are desiring not only needs to close the trades that are open, but also put your ea to sleep so it does not open up new trades. What you really need is your present ea modified to close out all open trades, plus stop it from trading. This takes internal code additions and modifications.

Dave
<><<<
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
  #115 (permalink)  
Old 07-31-2009, 01:54 AM
Junior Member
 
Join Date: Jul 2009
Posts: 1
bernie7 is on a distinguished road
GMT offset for EA

I am interested in adding a "GMT offset" function to this EA. If anyone is up to the task, please let me know.

Basically I want the user to be able to change when the daily bar closes, regardless of what the server time is.
Attached Files
File Type: txt EA1.txt (12.6 KB, 11 views)
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
  #116 (permalink)  
Old 07-31-2009, 09:46 PM
Junior Member
 
Join Date: May 2009
Posts: 4
Sidney76 is on a distinguished road
Hi!

Maybe this strategy is based on the same thought and You are also interested in this one:

24h *Swing Trading* System

Lets improve it toghether..


Sidney
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
  #117 (permalink)  
Old 09-23-2009, 09:18 PM
Junior Member
 
Join Date: Aug 2009
Posts: 2
horlique is on a distinguished road
PLEASE I NEED A forex STRADDLE SCRIPTS(OR EA)

hello fellow traders,

Due to my trading strategy, i need a good straddle

Please i urgently need a Straddle script that will place 2 opposing
pending orders at a specific time.

The straddle scripts(or EA) should have the following inputs/features:

1. Lots= number of lots to set
2. Stop loss point=
3. Entry pips= number of pips away from current price
4. Take profits=
5. Buy stop= true or false
6. Sell stop= true or false
7. Date at which the orders will be place= year/month/day/time in hrs/mins
8. Trailing stop=
9. pips to break even points= number of pips to move the stop loss to break even

And lastly it should work with meta4 brokers.

please iwill be very glad and grateful if anyone can help me with it.
just post it here
this will really aid me in my trading.

u can email me at: horliquegold@yahoo.com
i awaits your soonest reply.
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
  #118 (permalink)  
Old 10-30-2009, 04:07 PM
Junior Member
 
Join Date: Nov 2006
Posts: 4
coocosnest is on a distinguished road
Hello,

I'm trying all the EAs posted in this thread, but seems that I could make them work only with 4 digit broker.. with 5 digit broker, they never opened one position at my specified time.. did it happen to someone else? and would it be possible to fix it?

thanks a lot
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
  #119 (permalink)  
Old 10-30-2009, 09:16 PM
Junior Member
 
Join Date: Oct 2009
Posts: 8
drago24 is on a distinguished road
hello

hello to all.. I was wondering if you can make an EA out of an indicator that is a EX4 file?
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
  #120 (permalink)  
Old 11-01-2009, 01:02 AM
Junior Member
 
Join Date: May 2006
Posts: 2
jsenne is on a distinguished road
simple ea

is there a EA that opens trades at set time, and allows exit stratagy...other variables?
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

Tags
buy sell ea, correlation, currenttime(), grid ea, how to write an ea, how to write an EA for metatrader, how to write EA, how to write forex ea, orderclosetime(), straddle ea, time ea, timebasedea, wait time, WNV EA


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
Buy/sell EA excite2 Expert Advisors - Metatrader 4 84 08-17-2009 09:47 PM
Detecting price trend independent of a specific time frame gee Metatrader 4 4 02-24-2007 05:53 PM
Anyone want to write a simple EA? Kaper Suggestions for Trading Systems 6 10-29-2006 11:36 PM
Simple question of determining the time of day Fishtank Metatrader 4 2 04-04-2006 05:12 AM


All times are GMT. The time now is 01:58 PM.



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