Moving Average - page 13

spiritbreezer
259
spiritbreezer  

Indi that displays value of moning average?

Hi all

I have searched but have been unable to find an indicator that displays the value of a moving averages or averages on the chart.

Is there such one available?

Thank you

turdusmerula
4
turdusmerula  

Small bug in my indicator

Hello,

I've done my first piece of code, it a small MA indicator which is red when the curve is growing, blue when it's lowering and white when there's no revelant variation.

The problem is that when i show this indicator it works well on data already shown in the window but it alway shows a red curve on new real time data.

Can someone give me an idea to solve this?

Files:
variator.mq4 5 kb
etrader58
337
etrader58  
newdigital:
EmaAngleZero indicator. Posted 3rd time already.

newdigital,

isn't it available for other types of MA ?

Sergey Golubev
Moderator
113446
Sergey Golubev  
etrade:
newdigital, isn't it available for other types of MA ?

I changed it. I have no idea how it will work as I did not test it.

1st separate window is AngleTreshold=0.7 and MODE_MA=1 (EMA).

2nd separate window: AngleTreshold=0.7 and MODE_MA=0 (SMA).

3rd separate window: AngleTreshold=0.7 and MODE_MA=2 (SMMA).

etrader58
337
etrader58  
newdigital:
I changed it. I have no idea how it will work as I did not test it.

1st separate window is AngleTreshold=0.7 and MODE_MA=1 (EMA).

2nd separate window: AngleTreshold=0.7 and MODE_MA=0 (SMA).

3rd separate window: AngleTreshold=0.7 and MODE_MA=2 (SMMA).

Oh many thanks for this, but I meant LWMA, as it is a common MA in MA crossing indicators

Sergey Golubev
Moderator
113446
Sergey Golubev  
etrade:
Oh many thanks for this, but I meant LWMA, as it is a common MA in MA crossing indicators

MODE_MA=3 (LWMA).

etrader58
337
etrader58  
newdigital:
MODE_MA=3 (LWMA).

Many thanks for this, and sorry for my failure not to test the indicator before, as I judged about the list of types you quoted.

I wonder if there is a similar indicator estimating the angle of a MA with another MA. I mean predicting a forthcoming MA crossing.

etrader58
337
etrader58  
newdigital:
I changed it. I have no idea how it will work as I did not test it.

1st separate window is AngleTreshold=0.7 and MODE_MA=1 (EMA).

2nd separate window: AngleTreshold=0.7 and MODE_MA=0 (SMA).

3rd separate window: AngleTreshold=0.7 and MODE_MA=2 (SMMA).

wow, I tested....

it works properly

many thanks for this

etrader58
337
etrader58  

When I try to use a negative value for EndEMAShift, the history of the chart is OK, but the last few bars not working.

Can anyone let me know what is the problem ?

Files:
Sergey Golubev
Moderator
113446
Sergey Golubev  
etrade:
When I try to use a negative value for EndEMAShift, the history of the chart is OK, but the last few bars not working. Can anyone let me know what is the problem ?

I am not sure exactly but I think thast negative value of EndEMAShift will not work. Because EndEMAShift is just a shift. Number of bar.

Look at here:

fEndMA=iMA(NULL,0,EMAPeriod,0,MODE_EMA,PRICE_MEDIAN,i+EndEMAShift);

fStartMA=iMA(NULL,0,EMAPeriod,0,MODE_EMA,PRICE_MEDIAN,i+StartEMAShift);

fAngle = mFactor * (fEndMA - fStartMA);

i+StartEMAShift and i+EndEMAShift are number of bars on the chart. For example: bar #0, bar #1 and so on.

And all bars on the chart is counted starting from zero (0):

- bar #0 is current bar which you see on the chart. It is open bar in most of the cases.

- bar #1 is previous bar.

Bar # -1 is future bar which does not exist yet. So the bar number can not have negative value.

Of course sometimes some coders are coding for future bars especially but it is very special cases. For example well-known case with Future-is-not-set indicator based on DayImpulse indicator is such a case.