:) In programming the Williams %R to buy/sell when it crosses the trigger line, I am having a problem with the fact that on a H1 chart, The Williams % R value may dip down below/above the trigger line for a split second, trigger the order, and then immediatley come back above/below the trigger line. How do I program the EA so that it doesn't signal an order until the Williams CLOSES above/below trigger line?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
:) In programming the Williams %R to buy/sell when it crosses the trigger line, I am having a problem with the fact that on a H1 chart, The Williams % R value may dip down below/above the trigger line for a split second, trigger the order, and then immediatley come back above/below the trigger line. How do I program the EA so that it doesn't signal an order until the Williams CLOSES above/below trigger line?
Here's the piece of code for a buy signal
williamsrcurrent = iWPR (NULL, 0, 50, 0);
williamsrprevious = iWPR (NULL, 0, 50, 1);
isBuying = (williamsrprevious < -80 && williamsrcurrent > -80);
Thanks folks :)
Pat