+ Reply to Thread
Results 1 to 5 of 5
 0 Attachment(s)    

Thread: Open Trade Question

  1. #1
    Member
    Join Date
    Mar 2009
    Posts
    31

    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 17:37.

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

    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
    Member
    Join Date
    Mar 2009
    Posts
    31

    Default

    Yep, no more then five.

    Thanks, Funyoo.

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

    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
    Member
    Join Date
    Mar 2009
    Posts
    31

    Default

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

+ Reply to Thread

Similar Threads

  1. Open trade on arrow
    By altoronto in forum MQL programming
    Replies: 3
    Last Post: 08-11-2009, 14:22
  2. How can i control MAXPIPS between next open trade ??
    By begu in forum MQL programming
    Replies: 3
    Last Post: 04-04-2009, 11:19
  3. Hello to all of you. Question please ?
    By pips4all in forum General discussion
    Replies: 1
    Last Post: 03-13-2009, 16:27
  4. Universal - Question for funyoo - Please
    By paciola in forum Expert advisors demo statements
    Replies: 8
    Last Post: 03-03-2009, 20:22
  5. Forgot to ask this question as well...
    By gary07 in forum General discussion
    Replies: 3
    Last Post: 01-31-2009, 21:35

Posting Permissions

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