Help with MQL4 WPR code
Results 1 to 4 of 34

Thread: Help with MQL4 WPR code

  1. #1
    Hello, I have started learning some MQL4 but I'm running into issues and I can not seem to find a fix.

    I'm only trying to use a simple indior like Willi Twist Range (WPR) to enter and exit trades.

    Prior to a transaction is entered, I would like it to close any open trades.

    The WPR indior is used to brief if price crosses below -20 and long when it crosses above -80. I have put this at the OnTick() section.

    Where can I put the near function so that it is not opening and closing trades on each tick?

    Attached is my code so far. I really don't know if the function that is close is even correct. Any help is appreciated.
    https://www.forexsoutheast.asia/atta...1146696142.mq4

  2. #2

  3. #3
    Quote Originally Posted by ;
    Hi, I've begun learning some MQL4 but I'm running into issues and I can not appear to find a fix. I'm just trying to use a simple indior like Willi Twist Range (WPR) to enter and exit trades. I would like it to close any open trades before there is a transaction entered. The WPR indior is used to brief when price crosses below -20 and when it crosses above -80. I've put this in the OnTick() section. Where can I place the close function so that it's not opening and closing trades on each tick? Attached is my code so far. I don't know if the close purpose...
    Not bad for starting out... here are some improvements... see if you can inform me what was changed and why.
    https://www.forexsoutheast.asia/atta...3976300959.mq4

  4. #4
    Thanks for the improvements.

    Looks like you produced a sign enumerator factor to indie when the trade is long/short/flat.

    The closing code now uses the magical number to identify the particular trade to shut. It's because I don't understand it lol, if I have missed anything!

    I ran it though the egy tested and realised I forgot to create just input on H4 close data. What is the best way to get this done?

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.