script that closes an open position after breaching a trendline
Results 1 to 8 of 8

Thread: script that closes an open position after breaching a trendline

  1. #1
    Hello ma buddies. Do you know of any metatrader script which closes an open position if a trendline is breached/crossed by a candle which had shut beyond this trendline?

    Btw, I shut manually the position and draw manually the trendline.

    Thank you very much for any help and leadership. :-)

  2. #2
    Hello monzulu,

    Does the candle need to just touch the trendline to close the position or does this need to close under/over that the trendline (based on the entry)?

    Regards,

  3. #3
    Quote Originally Posted by ;
    Hello,

    Does the candle need to just touch the trendline to close the position or does it need to close under/over that the trendline (based on the entrance )?

    Regards,
    lucidlamp
    hi lucidlamp,

    the candle has to close under(or over) the trendline.

    I'm thinking of implementing this on the 1H timeframe.

    again, many thanks lucidlamp.

    Best regards,

    mon

  4. #4
    Hi monzulu,

    This should do the job. All you need to do is:

    1: The trendline to be crossed needs to be termed breech.

    2: Put the word breech in the order comment when placing an order. I included this if you intend to conduct other transactions on the exact same pair. Hence that the script won't interfer with, perhaps, transactions placed by an expert, transactions put while scalping, or any other trades. The accession of the comment breech could be removed if you plan to put only 1 trade on the pair while the script is running.

    I haven't tested actual time, but it needs to be fine. I really do suggest, strongly, trying it before running it live though.

    https://www.forexforum.co.za/attachm...7152324412.mq4

    Regards,

  5. #5
    Quote Originally Posted by ;
    Hello,

    This ought to work. All you need to do is:

    1: The trendline to be crossed needs to be named breech.

    2: Put the term breech in the order remark when placing an order. I included this if you intend to run other trades on precisely the exact same pair. Hence that the script will not interfer with, perhaps, trades placed by an expert, trades put while scalping, or some other transactions. The addition of this remark breech could be removed should you plan to place just one transaction on the pair while the script is running.

    I haven't analyzed real time, but it needs to be OK. I do suggest, strongly, attempting it before running it live though.

    Attachment 72987

    Regards,
    lucidlamp
    hi lucidlamp, thank you very much for your help. I can try this and allow you to know how it's doin'. But I'm convinced it's going to be a major tool in my toolbox.

    Christmas has arrived to me earlier!!!

    again lucidlamp thanks very much and merry christmas!

    All the best to you and your loved ones!

    kind regards,

    mon

  6. #6
    Quote Originally Posted by ;
    Hello monzulu,

    This should work. All you have to do is:

    1: The trendline to be crossed needs to be termed breech.

    2: Put the word breech [color=black] from the order remark when placing an order. I included this if you intend to run other trades on the same pair. So the script won't interfer with, possibly, trades placed by an expert, trades put while trading, or some other transactions. The addition of this remark breech can be eliminated should you plan...
    HI this is my first time to post a forum relates to Fx, continues to be using the breech EA and find it really useful

    I was wondering whether its possible to do this EA with if the candle croses the trend line that it coloses the position on the tick count as several times points can be lost waiting for the candle to closes the bar

    or is there a simiuler trend line that can close a trade Just on the tick count
    because it would be convenient for the 1 minute chart

    thanks

  7. #7
    Curious if that EA may be modified to, instead of open and order, call and implement a script that the TL is named after. The appliions of the would be versatile.

  8. #8

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.