How to find if any EA order has been closed by TP - Page 2
Page 2 of 614 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: How to find if any EA order has been closed by TP

  1. #11
    I've'implanted' the checks into your code. Hope it works.
    It believes same magic number and same symbol only.

    Additionally: You really ought to use the new style MQL4; it makes things easier and clearer, because right now you've got a lot local variables that overlay global variables, although they are intended to be the same I guess.

    https://www.nigeriaforextrading.com/...4794220529.mq4

  2. #12
    Quote Originally Posted by ;
    I have'implanted' the checks into your code. Hope it works. It believes same magical number and same symbol only. Additionally: You really ought to use the new design MQL4; it makes things simpler and clearer, since right now you've got a lot local factors that overlay global factors, although they are meant to be the same I guess. file
    God gives you mate. You made my life simpler.
    I will do some testing on weekend and alterations and write you back on Monday with the outcomes.

  3. #13
    I have looked at some orders that have been shut out by SL/TP also it looks like the brokers suggest such a close in the remark of the order.
    So far I have seen the text [sl] and [tp].
    In this case the test for TP strike is accurate and insignificant with OrderComment() == [tp].
    Therefore it is recommended to do it like that.
    Following is a new code taking into account the forementioned and using another approach.
    https://www.nigeriaforextrading.com/...2145272331.mq4

  4. #14
    Quote Originally Posted by ;
    I've looked at some orders that were shut out by SL/TP and it seems that the brokers suggest such a close in the remark of the order. I have seen the text [sl] and [tp]. In such a case the test for TP hit is accurate and trivial with OrderComment() == [tp]. Therefore it is recommended to do it that way. Following is a new code taking into account the forementioned and using another approach. document
    Are you testing your code before submitting it?
    Since OrderComment() == [tp] does not operate in this case
    Take a glance what happens in OrderSend and you will see why it can not operate
    Btw. Can you notice that the EA won't ever have the ability to open a sell trade every time a new batch starts?

  5. #15
    Quote Originally Posted by ;
    Are you analyzing your code before posting it?
    I do if the test case is trivial (or instead static).
    However, this one isn't and I did not, but I have told so.
    I see what you mean, OP already set in a comment - I do not understand what occurs with the comment in this case if sl/tp is struck -
    ideally the waiter would amend the text or fill it if comment is an empty chain (i.e. ).
    Quote Originally Posted by ;
    Btw. Can you observe that the EA will never be able to open a market every time a new batch starts?
    No, I haven't analysed what OP's code actually does. No time for such (note originally he asked for the way to recog. if tp hit).
    He might need to work his code around a'find if tp hit'-mechanism. But he can certainly thank you for pointing that out: )

  6. #16
    Quote Originally Posted by ;
    quote Have you been testing your code before posting it? Since OrderComment() == [tp] does not operate in this case Check out what happens from OrderSend and you will see why it can't work Btw. Did you observe that the EA will never have the ability to open a sell trade every time a new batch begins?
    Thank you for your article.
    If you can help coding this EA properly your help will be appreciated. Mentioning what's wrong is half job but adjusting the error is the one that brings results.

  7. #17
    Quote Originally Posted by ;
    quote I do if the test case is trivial (or instead : static). However, this one isn't and that I did not, but I have told so. I see what you mean, OP already set in a remark - I don't understand what occurs with the remark in this case if sl/tp is hit - ideally the waiter would amend the text or fill it in case remark is an empty string (i.e. ). quote No, I've not analysed what OP's code in fact does. No time for this (note initially he asked for how to recog. if tp hit). He might have to operate his code around a'find if tp hit'-mechanics. However he can...
    Rockit,

    I am quite thankful for the help. The find when tp mechanism I can not code it in my own because if I could I would not start such a thread. Also I noticed that for that which I started the thread isn't so easy in coding because my idea was that if a single order closed in TP then close all of the rest isn't the point.

    So I decided to describe an example to make it easier to know for what I am looking for.
    Lets say I open buy position at 1.30000 and TP 30 pips. If price goes down by 30 pips I would like to open a market position with TP at 30 pips.
    So I have now two open positions a buy at 1.30000 plus a sell at 1.27000 and till the TP is hit I don't wish to open any commerce.

  8. #18
    Quote Originally Posted by ;
    quote Thank you for your article. Your help will be appreciated if you are able to help coding this EA correctly. Mentioning what is wrong is half occupation but adjusting the error is the one that brings results.
    The problem is the following:
    this type of EAs are coded over and over again and all got the same effect: they don't work in the future
    You may make some nice profits, but the day will come where it all blows up
    One might have to emphasise your EA from scratch.
    As an instance I would signal it with SL and TP and do not care about closed trades
    when You Have a buy position and also a sell place the buy should be shut by SL automatically if the market hits TP

  9. #19
    Quote Originally Posted by ;
    quote The issue is the following: This sort of EAs have been coded over and over again and got the exact same effect: they do not work in the future You may earn some nice profits, but the day will come where it blows up One would have to rewrite your EA from scratch. For instance I would code it with SL and TP and do not care about closed trades If you have a buy position and a market position the buy ought to be closed by SL automatically if the market hits TP
    That is about what I search for.
    I know certainly that it will not work in the long term only with the suitable MM it could be profitable. Look I am trading for long time now and I know what I am talking about if I say profitable. I am NOT looking making 100 percent or 200% I've survived in the fairy tail a newbie resides when begins trading.

    In the event that you really want we could cooperate you with communiing and I with my expertise and let us hope that it is going to drive us to somewhere.

  10. #20
    Quote Originally Posted by ;
    There was still a bug in the code. I've re-uploaded the last version (see post #32).
    Man you made my afternoon.

    Promise this is last thing for now is it possible with every next order to double lot until TP is struck like Martingale but this number to be flexible not just two.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.