Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
 7 Attachment(s)    

Thread: Take Profit Increment - Help please

  1. #11

    Default

    You need to implement the modifications that I outlined previously for it to work. The EA contains the same flawed code as yesterday.

    Please read my posts 2 and 6 and implement those changes first exactly as I described. I'm happy to help, but please make the changes yourself and I will then look at it if there is still a problem.

  2. #12

    Default

    Try this. I haven't tested it, but it compiles OK.
    Attached Files Attached Files
    Last edited by jezzer1961; 06-18-2009 at 12:01.

  3. #13

    Thumbs up

    Quote Originally Posted by jezzer1961 View Post
    Try this. I haven't tested it, but it compiles OK.
    I will try it, thank you very much!

  4. #14
    Member
    Join Date
    May 2009
    Location
    Gold Coast, Australia
    Posts
    55

    Default

    Quote Originally Posted by jezzer1961 View Post
    Try this. I haven't tested it, but it compiles OK.
    Thanks jezzer1961.....szmvscla,

    I added jesser1691's code to my code and removed szmvcla's 5 digit addins (I am with a 5 digit broker but just prefer adding the extra '0' to my code).

    I changed some of the pip and step distances as I was getting a '1', and 130 error, "ordersend", it stoped to a degeee .
    Anyway I got the Buy side of things to work apart from the trailing at 70pips.
    I couldn't get any of the Sell side of things to work, I changed the > to < in the sell logic but the > had nothing happen and the change to < caused the Sell to trail straight away, no step.

    Anyway I have added my EA, it goes on the 30M EUR/USD. None of it is optimised as I'd like to get this bit of code to work first. Only pieces of code that relate to the EA in my code are in the varriable ligics at the top, Int start area and at the very end of page.
    Any help appreciated but only if you have the time.,
    Thanks.
    Attached Files Attached Files

  5. #15

    Default

    The Trailing Stop feature isn't working properly because I had accidentally missed a *Point after the 70(0) from the conditions. It's no excuse, but I did say that it's easy to make mistakes when you just type a piece of code quickly and don't check it.

    The sell stop-loss system isn't working properly because you're using the < symbol instead of the > symbol within your conditions.

    Also please look at lines 265 and 277 where there is another mistake. You have not multiplied the value by 10 for 5-digit brokers.

  6. #16
    Member
    Join Date
    May 2009
    Location
    Gold Coast, Australia
    Posts
    55

    Default

    Thanks for all your time and help jezzer1961.
    At most the code all works as I had wanted it too, lines 265 and 276 were ment to be that low as to be like a breakeven.

    I still get an error '1' code.

    When running the tester in visual mode every now and then only on Sell orders the S/L is displayed as a "_" on the chart but not the usual "--------" across the chart. The price will move through the stop and it wont be triggered at all. This continues to occur randomly with Sells being opened and not closed until the tester ends and closes them.

    I did notice though, if the Sell/s that this occured on come back into play by the trailing step function, they would be closed. To me this would suggest there could be a conflict with the original S/L and the new code but in saying that it doesn't occur on long entries. Also (if related) no matter what pip values I change (for the error '1' code) it dosn't seem to fix the problem.

    I have attached the updated EA.

    Thanks again.
    Attached Files Attached Files
    Last edited by Dono; 06-19-2009 at 14:25.

  7. #17

    Default

    Try this. I've added a couple of extra lines and normalised the double in the OrderModify() function.
    Attached Files Attached Files

  8. #18
    Member
    Join Date
    May 2009
    Location
    Gold Coast, Australia
    Posts
    55

    Default

    Thanks jezzer1961,

    The code helped with the error codes but the S/L on sells still acted strangely by showing the original S/L as "_" and a working one now at 10 pips??.

    Seeing your code I was able to do fix the problem and it all works as needed. I'm sure if I have errors in my code as I now get constant error '1' and '130' codes. I don't know the ramifications of the codes in a live situation as in the visual tester mode everything works prefectly. 130 relates to invalid stops but I have moved all my values again to no effect. Goodness knows what the error 1 relates to, I couldn't find anything specific on it.

    If possible if you or anyone else following the thread could have a look to see if there is a quick fix in the code to stop the errors, apart from that it works fine.

    Attached is version 3 (N.B this EA was used to test the code, not to make money, lol)
    EDIT----> removed EA see V4
    Last edited by Dono; 06-21-2009 at 04:51.

  9. #19

    Default

    I noticed that your OrderSend() functions were sending stop-losses without them being normalised to the digits first. This can cause errors.

    You should maybe start by addressing this matter and then retest the EA.

    If it is still generating errors in the tester, you need to work out at what stage the errors are being generated (eg. Are they occuring when the orders are being first sent, or when they are being modified later?).

    Unfortunately I don't have time to test EAs for errors myself. I am happy to paste up the odd block of code and to see if it compiles in the editor, but I don't really have the time to debug it I'm afraid unless I notice something blindingly obvious.

  10. #20
    Member
    Join Date
    May 2009
    Location
    Gold Coast, Australia
    Posts
    55

    Default

    Thanks jezzer1961 for your time and patience.

    I have tried your suggestion with my limited knowledge but if I coded it correctly or not, it compiled ok but to no change in the out come.

    szmvscla might come back on the scene and have a better idea than me, he started the thread so might put some more time into it. If I keep going MQL5 will be out before I finish.

    Thanks.

    EDIT-------->>

    Sorry big time jezzer1961, but my last EA file was wrong (my changes had not been saved before the upload). So my last post would relate to the newly attached....................I can understand if you don't want to look at it.
    Attached Files Attached Files
    Last edited by Dono; 06-21-2009 at 04:45.

Similar Threads

  1. Replies: 6
    Last Post: 02-18-2016, 21:12
  2. EA źNetwork For Profit╗.
    By NetworkFP in forum Commercial expert advisors
    Replies: 19
    Last Post: 08-24-2012, 19:35
  3. Fx Profit EA
    By bnbb2004 in forum Ideas for expert advisors
    Replies: 8
    Last Post: 05-18-2012, 20: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, 11:37
  5. Trailing stop/TP increment - Help please
    By szmvscla in forum MQL programming
    Replies: 4
    Last Post: 06-11-2009, 03: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
  •