#### 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

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

#### Re: **Detect Enough Space Between 2 Moving Average

Hello mr Alireza

I think you can chat easily in Farsi and you are probably an Iranian like me. I have been familiar with Forex Strategy Builder for a while now and I am studying it and practicing a little bit. I think you can use Makdi very well for your purpose.  The MACD indicator shows three moving averages on the chart, usually the average of 12, 26, and 9 and the average of 12.
The mean is fast and twenty-four is slow, and the mean is nine, they call the Makdi line, and a histogram is produced from the difference between slow and fast, and I think it will fulfill your purpose, and of course you can change these numbers. Anyway, Makdi is one of the most famous.  There are indicators
سلام علیرضا جان

فکرکنم شما به زبان فارسی راحت میتونین قحبت کنین و احتمالا مثل من یه ایرانی هستید من مدت کمی هست که با فارکس استراتژی بیلدر آشنا شدم و دارم مطالعه اش میکنم و کمی هم تمرین من تصور میکنم شما برای هدفتون خیلی خوب بتونین از مکدی استفاده کنین، اندیکاتور مکدی سه تا مووین اوریج روی چارت میندازه، بطور عادد میانگین ۱۲   و ۲۶ و ۹ و میانگین دوازده
رو میانگین سریع و بیست و چهار رو کند و میانگین نه رو خط مکدی میگن و از تفاضل کند و سریع هیستوگرام تولید میشه     و فکر میکنم با اون هدف شما برآورده میشه و البته میشه این اعداد رو تغییر داد.به هر حال مکدی از معروف ترین اندیکاتور ها هست

به هر حال هیچ اندیکاتوری نمیتونه آینده ی بازار رو پیشگویی کنه و این از محالاته

Anyway, no indicator can predict the future of the market and this is impossible

موفق باشی
good luck

✋✋✋