Stochastic Oscillator and moving average
-
I am having trouble with two things. I would like to create an expert advisor where there are 2 conditions.
Condition one, check where is the price, if price is below the 200 EMA I would only be interested in selling. And if price is above the 200 EMA I am interested in only buying.
After checking condition one, proceed to condition two.
Condition two, is about the stochastic oscillator, where the %k is 15, %d is 5, slowing is 5. When the %k crosses the %d, at a level either above 80 or below 20 then open position. But do remember that position are opened based on condition one, (if price is above the 200 EMA then we are only interested in buying as in where the %k crosses the %d below 20 on the stochastic oscillator, and vice versa when the price is below the 200 EMA, I am only interested in selling, when the %k crosses the %d above the 80.
Kindly note that crossover between the %k and the %d should be found only if it is above the 80 or bellow 20 in order to open a position.Your earlies response is much appreciated.
-
@ramimoujaes No problem. Do you have a project to begin with?
-
@l-andorrà yes, this is all what I have. I know I have something wrong and missing. I appreciate your help as well.

-
@ramimoujaes Sorry I meant sharing the link to it. The screenshot is not enough to review it, if you don't mind.
-
@l-andorrà oh, honestly I do not know how to share the link
-
@ramimoujaes Easy. Do this:

-
-
@ramimoujaes Ok. You just need to insert a condition block immediately above the current stochastic ones. There you can specify the EMA condition. That way, the stochastic condition will be checked if, and only if, the previous one is true. On the other hand, I would recommend to duplicate that 'no position' block on top: one for buys only and another one for sells only.
-
@l-andorrà Great, thank you so much
-
@ramimoujaes You're welcome.
-
@ramimoujaes Hi, can you please show me the final project
-
Hello everyone, please I kindly need your assistance in setting a stop loss to myEA. The EA is working perfectly as I wanted, all I need now is how to set the stop loss as follows. I want
to set stop loss for buy trade when stochastic oscillator 21,1,1 crosses below value 40, also I want to set stop loss for sell trade when the same stochastic oscillator crosses above value 60. Please I need to know how to go about this. Thank you