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

Thread: Check for TP take profit script

  1. #1
    Member
    Join Date
    Feb 2009
    Posts
    84

    Default Check for TP take profit script

    Can somebody help me with a script that would make sure tp is specified?
    My ea (ilan) sometimes does not specify tp once order is placed but will once another order after that is placed.

  2. #2
    Member
    Join Date
    Feb 2009
    Posts
    84

    Default

    By increasing Sleep time, will that help to ensure take profits are always set?

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

    Default

    Hi tkaboris,

    It is due to the requotes,

    You should try to copy paste the conditions that modify the SL and to replace NewOrdersPlaced by something that determines the last stop loss, if this stop loss == 0 then apply the global stop loss to all trades.

  4. #4
    Member
    Join Date
    Jan 2009
    Posts
    151

    Default

    You should also include a line which does something similar to this before setting or modifying your SL to prevent any errors resulting from it being too tight:

    Code:
    if(SL>(Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)) SL=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point;
    That line will work for long SLs and you'd just need to modify it slightly for short SLs. Likewise, you can easily modify it for TPs as well.
    Last edited by jezzer1961; 04-20-2009 at 12:46.
    PipRider.com - The home of the PipRider EA. From $100 to over $1m in 10 year backtest, and it works LIVE too!!

+ Reply to Thread

Similar Threads

  1. Fx Profit EA
    By bnbb2004 in forum Ideas for expert advisors
    Replies: 8
    Last Post: 05-18-2012, 19:23
  2. Disable EA form EA or script
    By netmastro in forum MQL programming
    Replies: 3
    Last Post: 11-04-2010, 14:31
  3. Add a profit target
    By funyoo in forum MQL programming
    Replies: 0
    Last Post: 01-28-2009, 15:56
  4. Add take profit and stop loss
    By funyoo in forum MQL programming
    Replies: 0
    Last Post: 09-23-2008, 10:32

Posting Permissions

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