Q:
I’d like to open a buy trade if the value of the Stochastic Oscillator of the present bar is higher than the value the Stochastic Oscillator had with the previous bar.
How can I get these values?
A:
Just use the “shift” parameter to get the correct value – for the current candle, and any other candle.
When you change the shift value, save the function with a new name that makes sense, like “stoch_current”, “stoch_last”, etc.
There is more info on shift here:
http://www.iexpertadvisor.com/what-is-the-metatrader-shift-parameter2/
Eample for current bar:
Example for Last Fully formed Bar:
Example for value from two bars ago:
You can access these values using the Choose button with your Logic Element to create this Logic:

The Drawing with Elements will look something like this:

To get notified about the latest questions and answers, follow us!
Follow @iExpertAdvisor