Take Profit Increment - Help please
Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23
 7 Attachment(s)    

Thread: Take Profit Increment - Help please

  1. #21


    The EA will compile OK, but that alone doesn't mean that it won't produce errors. These lines are from the EA when it sends your buy orders:

             if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;
             if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;
             //Normalise your SL & TP in these lines and adjust for broker's minimum order distance before sending the order
             Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
    Neither the stop-loss nor the take profit is being normalised before the order is being sent. The same applies to your sell orders. Similarly, you should check that the SL/TP values are not tighter than the minimum allowed by your broker and adjust them if this is the case.

    I can also see that the lot sizes are not being normalized either before the orders are being sent. This is something else that you should think about implementing in future even if it isn't the cause of your current problem.

    Please search some of the posts on the MQL4 forum which explain some of the common problems involved with sending orders.
    Last edited by jezzer1961; 06-21-2009 at 14:43.

  2. #22
    Join Date
    May 2009
    Gold Coast, Australia



    I have checked all the broker side of things numerous times and have made sure all my presets are well away.
    I will look into what you have said and try to search them down, I did try to code the normalise side of things before which compiled ok but to the same result. I'll try again.

    Trade well,


  3. #23

    Thumbs up

    My TPI is working now, I am attaching an "EA" without any signal condition just for you take look at the TPI code.

    Copyrights: I got the code of this "EA" from here and the TPI I've found here: Manage Take Profit - Forex Factory *- but I've made some changes in the code.

    *I don't know if I can post a link from another forum, but if the admin doesn't allow it, please remove it.

    Happy trading!
    Attached Files Attached Files

Similar Threads

  1. Replies: 6
    Last Post: 02-18-2016, 20:12
  2. EA źNetwork For Profit╗.
    By NetworkFP in forum Commercial expert advisors
    Replies: 19
    Last Post: 08-24-2012, 18:35
  3. Fx Profit EA
    By bnbb2004 in forum Ideas for expert advisors
    Replies: 8
    Last Post: 05-18-2012, 19:23
  4. (REQ) Add a take profit feature to an EA
    By Meister_Propper in forum Ideas for expert advisors
    Replies: 1
    Last Post: 05-24-2010, 10:37
  5. Trailing stop/TP increment - Help please
    By szmvscla in forum MQL programming
    Replies: 4
    Last Post: 06-11-2009, 02:21

Tags for this Thread

breakeven, broker, brokers, change, color, eas, eur, eur/usd, live, low, magic, mql, mql5, mt4, profit, sells, signal, slippage, stop, system, thank you, time, trading, trailing, trailingstep, trailingstop, usd

Posting Permissions

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

Take Profit Increment - Help please