1 (edited by alireza_nil 2020-05-28 07:17:15)

Topic: **Detect Enough Space Between 2 Moving Average

Hello Friends

How can Detect Enough space between 2 moving Average?
I have a SMA(A) and SMA(B) in my strategy
i need open position when SMA(A) Cross SMA(B)  like --> X (Multiply)
But Sometime in Sideways Market These SMA cross Together in less space  like --->~ (worm)
So I need open position when Market have good degree up or down trend and SMA(A) and SMA(B) Crossed together ، even These crossed happened on 1 or 2 previous bars


i hope my meaning be clear

Thanks

Re: **Detect Enough Space Between 2 Moving Average

You may wish to use ADX

My 'secret' goal is to push EA Studio until I can net 3000 pips per day....

Re: **Detect Enough Space Between 2 Moving Average

You can use "MA Oscillator".

The MA Oscillator is the difference between Fast MA and Slow MA. The actual "distance" is the "Level" parameter.

You can try "MA Oscillator is higher than the Level line", where Level is in the price of the chart currency.


            double[] maFast = MovingAverage(fastPeriod, 0, maMethod, Price(basePrice));
            double[] maSlow = MovingAverage(slowPeriod, 0, maMethod, Price(basePrice));
            var oscillator = new double[Bars];

            for (int bar = firstBar; bar < Bars; bar++)
            {
                oscillator[bar] = maFast[bar] - maSlow[bar];
            }

Re: **Detect Enough Space Between 2 Moving Average

Many Thanks For your Guide

Popov wrote:

You can use "MA Oscillator".

The MA Oscillator is the difference between Fast MA and Slow MA. The actual "distance" is the "Level" parameter.

You can try "MA Oscillator is higher than the Level line", where Level is in the price of the chart currency.


            double[] maFast = MovingAverage(fastPeriod, 0, maMethod, Price(basePrice));
            double[] maSlow = MovingAverage(slowPeriod, 0, maMethod, Price(basePrice));
            var oscillator = new double[Bars];

            for (int bar = firstBar; bar < Bars; bar++)
            {
                oscillator[bar] = maFast[bar] - maSlow[bar];
            }

Re: **Detect Enough Space Between 2 Moving Average

Thank you Sir
i will try it

Blaiserboy wrote:

You may wish to use ADX