Results 1 to 2 of 2
 0 Attachment(s)    

Thread: How to TRAIL more than 1 open trade if total of open trades is in profit

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    9

    Default How to TRAIL more than 1 open trade if total of open trades is in profit

    hello

    i`m a beginner of MQL programming and have try to program this but without success
    example:
    trade 1 -20 profit
    trade 2 -8 profit
    trade 3 +35 profit
    if total profit > +7 profit - for this example (optional value - extern variable: extern int profit=7) - now TRAIL ALL open trades
    i know it`s a "for" - loop code but found no solution ........

    thanks for help and sorry for my bad english

    regards

    forex 2006

  2. #2
    Member
    Join Date
    Jan 2009
    Location
    Austria
    Posts
    325

    Default

    Quote Originally Posted by begu View Post
    hello

    i`m a beginner of MQL programming and have try to program this but without success
    example:
    trade 1 -20 profit
    trade 2 -8 profit
    trade 3 +35 profit
    if total profit > +7 profit - for this example (optional value - extern variable: extern int profit=7) - now TRAIL ALL open trades
    i know it`s a "for" - loop code but found no solution ........

    thanks for help and sorry for my bad english

    regards

    forex 2006
    hi,

    1) select all buy + sell orders
    2) summarize it to double
    3) check against a starting trail profit value, if higher
    4) mark and enable a virtual marker to your trail start profit
    5) if it moves higher, forward the virtual trail marker
    6) if price falls back to your last virtual marker, execute a closeall()
    IXBONE
    Business Internet Services | IX Trader Forex Software
    Registered Internet Service Provider (Ripe: AS 16195)

Similar Threads

  1. I need an EA to open trades at a specific time
    By Johntrader in forum Scripts and other tools
    Replies: 0
    Last Post: 07-27-2012, 14:51
  2. Replies: 2
    Last Post: 04-15-2010, 16:44
  3. Replies: 2
    Last Post: 05-25-2009, 17:59
  4. Automatic closing of all open trades
    By Neo-Rio in forum Ideas for expert advisors
    Replies: 1
    Last Post: 05-07-2009, 10:00
  5. Close all open trades after every x profit
    By begu in forum MQL programming
    Replies: 1
    Last Post: 04-09-2009, 19:03

Tags for this Thread

beginner, color, how to, mql, profit, programming

Posting Permissions

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