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

Thread: Add comments

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

    Default Add comments

    Here is an example :

    After extern parameters, add :

    Code:
    extern bool Comments=true;//|--------------------allow comments on chart
    Before start(){, add :

    Code:
    int init()
    {
      if(Comments)Comment("\nLoading...");
      return(0);
    }
    
    //|---------deinitialization
    
    int deinit()
    {
      return(0);
    }
    After start(){, add :

    Code:
    if(Comments)
    {
       Comment("\nCopyright © 2009, TradingSytemForex",
               "\n\nL o t s                   =  " + DoubleToStr(Lots,2),
               "\nB a l a n c e         =  " + DoubleToStr(AccountBalance(),2),
               "\nE q u i t y            =  " + DoubleToStr(AccountEquity(),2));
    }

  2. #2
    Junior Member
    Join Date
    Nov 2008
    Posts
    25

    Default

    Funyoo, is this the script to add Comments to the trade order?

    I am running about 6 EAs on the same platform and about 4 of them do not include a "Comments" section so it is difficult to determine which EA is making the trades

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

    Default

    Quote Originally Posted by webicknell View Post
    Funyoo, is this the script to add Comments to the trade order?

    I am running about 6 EAs on the same platform and about 4 of them do not include a "Comments" section so it is difficult to determine which EA is making the trades
    For the trade order's comment, you have to modify the red part in the OrderSend function :

    OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SL,TP,"Expert Advisor Name",Magic,0,Blue);
    OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SL,TP,"Expert Advisor Name",Magic,0,Red);

    If there is a parameter instead of this red part (like EAName), you have to modify it at the begininning of the code :

    #define EAName "Expert Advisor Name"

  4. #4
    bt2
    bt2 is offline
    Member
    Join Date
    Feb 2009
    Posts
    51

    Smile More info in order comments

    Quote Originally Posted by webicknell View Post
    Funyoo, is this the script to add Comments to the trade order?

    I am running about 6 EAs on the same platform and about 4 of them do not include a "Comments" section so it is difficult to determine which EA is making the trades
    Me too, so I doctered 1 of Funyoo's EAs lines to show magic number & ea name like this:

    Ticket1=OrderSend(Symbol(),OP_BUYSTOP,ILots1,BuyPr ice1,Slippage,SL,TP,"mn"+Magic1+" "+EAName,Magic1,Expire,Blue);

    The "mn" is just text in front of the magic number.

    cheers bt2

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    3

    Default

    Quote Originally Posted by funyoo View Post
    Here is an example :

    After extern parameters, add :

    Code:
    extern bool Comments=true;//|--------------------allow comments on chart
    Before start(){, add :

    Code:
    int init()
    {
      if(Comments)Comment("\nLoading...");
      return(0);
    }
    
    //|---------deinitialization
    
    int deinit()
    {
      return(0);
    }
    After start(){, add :

    Code:
    if(Comments)
    {
       Comment("\nCopyright © 2009, TradingSytemForex",
               "\n\nL o t s                   =  " + DoubleToStr(Lots,2),
               "\nB a l a n c e         =  " + DoubleToStr(AccountBalance(),2),
               "\nE q u i t y            =  " + DoubleToStr(AccountEquity(),2));
    }

    Thank you very much for your many helpful codes, I really appreciate it.
    If I want to implement the following, any suggestion/sample?

    if (Hour()>=end)
    {Comment("EA is INACTIVE... No trading until 10:00 (Servertime)"); return(0);}
    if (Hour()>=start)
    {Comment("EA is ACTIVE... Waiting for trade setup."); return(0);}


    Thanks for any help.
    Oddvin

+ Reply to Thread

Similar Threads

  1. Comments on trade for 2 days
    By hymera in forum Manual systems demo statements
    Replies: 9
    Last Post: 02-11-2010, 10:07

Posting Permissions

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