Results 1 to 5 of 5
 0 Attachment(s)    

Thread: Open Trade Question

  1. #1

    Default Open Order Question

    Hi guys, can someone give me example how to open lets say 5 orders per currency per day?

    Thank you in advance.
    Last edited by altoronto; 04-14-2009 at 18:37.

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by altoronto View Post
    Hi guys, can someone give me example how to open lets say 5 orders per currency per day?

    Thank you in advance.
    Hi altoronto,

    You mean no more than 5 orders per currency per day ?

  3. #3

    Default

    Yep, no more then five.

    Thanks, Funyoo.

  4. #4
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by altoronto View Post
    Yep, no more then five.

    Thanks, Funyoo.
    In the extern parameters :

    Code:
    extern int MaxTradesPerDay=5;
    In the start body :

    Code:
       int orders=HistoryTotal();
       int DailyTrades;
       
       for(int i=orders-1;i>=0;i--)
       {
          if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)
          {
             Print("Error in history!");break;
          }
          if(TimeDay(OrderCloseTime())!=TimeDay(CurTime()))continue;
          
          //----
          
          if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && (OrderProfit()<0||OrderProfit()>=0))DailyTrades++;
       }
    In-line, in the BUY/SELL conditions :

    Code:
     && DailyTrades<MaxTradesPerDay
    You need to replace "MagicNumber" by your magic number parameter.

  5. #5

    Default

    Thank you Funyoo, I'll try tonight. You Rulez

Similar Threads

  1. Replies: 1
    Last Post: 09-03-2011, 21:22
  2. Replies: 0
    Last Post: 10-02-2010, 10:10
  3. Open trade on arrow
    By altoronto in forum MQL programming
    Replies: 3
    Last Post: 08-11-2009, 15:22
  4. Open question 2 all // whats the worst performing ea??
    By forex9 in forum Expert advisors live statements
    Replies: 5
    Last Post: 06-05-2009, 18:19
  5. Busy open trade
    By przem81621 in forum MQL programming
    Replies: 0
    Last Post: 05-08-2009, 22:24

Tags for this Thread

how to, magic number, thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •