+ Reply to Thread
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
    310

    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
    Forex VPS, IX Trader Forex Software
    Business Internet Services
    Registered Internet Service Provider (Ripe: AS 16195)

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 05-25-2009, 16:59
  2. Automatic closing of all open trades
    By Neo-Rio in forum Ideas for expert advisors
    Replies: 1
    Last Post: 05-07-2009, 09:00
  3. Close all open trades after every x profit
    By begu in forum MQL programming
    Replies: 1
    Last Post: 04-09-2009, 18:03
  4. Replies: 12
    Last Post: 03-19-2009, 18:28

Posting Permissions

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