New way of calculating Security Price (Mahesh Moving Averages)

daitya

Active Member
#1
Hello friends,
I have come across through "New way of calculating Security Price (Mahesh Moving Averages)" on some website.
See details...

Introduction

In the current stock market, there is a lot of technical analysis indicator. Some of the popular technical analysis graph which a trader user are

1) Simple Moving Averages (SMA): - this is the most basic graph a trader use to buy/sell any security. SMA is average price of number of days defined. Suppose we want to calculate SMA of 10 days then. The SMA will be of current day is average closing price of current and last 9 days. One of the most useful SMA is SMA 50, SMA 20, and SMA 200. This is widely used and accepted by most of the traders. However, the basic problem with this moving average is it gives equal marks to all days, which some trader thinks is incorrect.

2) Weighted Moving Averages (WMA): - weighted average is any average that has multiplying factors to give different weights to different data points. But in technical analysis a weighted moving average (WMA) has the specific meaning of weights which decrease arithmetically. In an n-day WMA, the latest day has weight n, the second latest n-1, etc, down to zero.

The other important moving averages are Expontial Moving Averages(EMA). Triangle Moving Averages(TMA).

But basic problem with all these moving averages are that these moving averages does not care about volume and historical price and volume of the security. Which are the driving force for any security and using which we can find the average price of the security on which it is traded most. As all we know about Bell curve in which most of the probabilities goes with central part of the bell curve. If using some way if we can find out the average price of the security then we can definitely say how security is behaving.

New way of calculating Security Price (Mahesh Moving Averages)

We all know about SMA, EMA, and WMA etc. Now we take an example of calculating price-using SMA. Suppose we have 100 total share of a security on rate of 100. Now we calculate the average price and SMA with it.

Check this table
Code:
share      Price       new average price   SMA(2)

100        100                100                   
10          110                101                 105.5
20          120                104.8              115         
50          105                104.9              112.5
30          120                109.43             112.5
Here at end column SMA is calculated and in 3rd column price is calculated using this new way of calculating price. If you see it carefully, you will find that 3rd column is having always a price which is very near to average price. Now let me show you why?

We have 100 securities initially with price of 100. Somebody has bought 10 securities on price of 110 from you. So now, you own 90 securities at price of 100 and other one has 10 securities at price of 110. So average price will be 90*100 + 10*110/100 = 101. Therefore, we can confidently say that average price 101 is correct. Now somebody bought 20 securities on price of 120. He may have bought all 20 from you or 10 from other person and 10 from you. However, actual number nobody can guess. But if give equal number to everybody then he the chances of buying from you is 90% and from other guy is 10%, which is already factored in the average price we calculated. Therefore, we can say that he bought 20 shares at price of 120 from you and other person at average price of 101. So new price is going to be calculated like 101*(100 20) + 20*120 /100 = 104.8. see here what we are seeing is that even though market price is 120 but average price is far less than market price which is only 104.8. Which shows that only a small people is buying security on high price and a lot of person is having security on low price. So as bell curve says that most of the rates must follow averages so either volume has to buy security on high price so that average price goes high or price should come down.

Advantage in Using Mahesh Moving Average (MMA)

Therefore, above example shows that how can we find average price of a security. This way of calculation has following advantage over normal Simple Moving Average calculation.

1) Simple Moving Average just shows the current trend of the security. MMA has an average price of security

2) SMA does not care about history of the security. MMA always care of history too, in fact all prices are inbuilt has historical price with it.

3) SMA does not care about volume. Even a low volume day price is equal to same as a high volume day price. MMA is dependent of price and on volume. Both factor works together to create a new price.

How to apply MMA in Security Market

To apply AMA we can think following. Short trend, long-term trend. We can decide following as 10 days, total average can work as a total quantity for short-term period. 40 days can work as long term. To calculate AMA. Following formula can be used
Code:
TAQ (Total Average Quantity (no of days)) = Average Volume * no of days

MMA(m+1) =  ((TAQ  V(m+1))*MMA(m) + P(m+1)  * V (m+1))/TAQ

Here MMA(m+1) denotes price of MMA price at m+1 day. 

V(m) denotes volume at m day

P(m) denotes price at m day
By this formula next days MMA can be calculated. No of days can be 10, 15, 20 or as you want. You can decide different no of days on different security.

After calculating price for each day graph can be plotted on these prices.

Basic Rules for trading using MMA

I use 10 Day MMA and 40 Day MMA for short term and long term trading.

Here are some basic rules which follow.

1. If stocks current price is less than 10 day MMA and 40 day MMA then stock is in bearish mode.

2. If stocks current price is less than 10 day MMA and 40 day MMA and 10 day MMA is less than 40 day MMA then stock is in extreme bearish mode.

3. If stocks current price is higher than 10 day MMA and 40 day MMA and 10 day MMA is higher than 40 day MMA then stock is in extreme bullish mode

4. If the % difference between current price and 10 day MMA is very high it shows that price is high without volume so soon either a huge volume will going to take MMA price up or price is going to down as a very lower % of public has bought the share and most of public is having share of less price. This shows that how price can be inflated by broker or inside trader who knows that something going to come in future and they are just accommodating shares. This is the key graph as no other indicator can show this relation but here in the formula as both volume and price are playing the role it will correctly show that if stock really worth it.

5. If the % difference between current price and 10 day MMA is very low it shows that price is low without volume so soon either a huge volume will going to take MMA price low or price is going to up as a very lower % of public has sold the share and most of public is having share at higher price. This is very critical as after drastically crash stock will going to have pull and at that time when MMA and current price are in moderate range again stock will going to have downward journey. What a trader need to do is buy when a drastically difference has come and price has stopped going down more and sell when MMA and CMP is in moderate range.

6. If a stock was less than 10 day MMA and 40 day MMA and If stock now trading greater than 10 day MMA then it shows that stock is trying to come from bearish mode to bullish mode if it stays above 10 day MMA then it can be a good buy for short term till it break out 40 day MMA line and if it can break out 10 day and 40 day MMA line then the stock is in bullish mode.

7. If CMP curve is very vertical and 10 day MMA is not so vertical it is sign of conspiracy means there is inside trading happening in the stock or broker is just trying to create a hype of stock. You should take very serious consideration of those stocks and if you really want to buy then after doing good research should enter with a strict stop loss as you know that most of public is having stock on very less price and if they decided to sell then price will going to be less soon.

8. If both 10 day MMA and CMP curve is going upward then everybody is having a belief that stock is good and you can enter safely till stock is in bullish mode.

9. If stocks 10 day MMA is higher than 40 day MMA and suddenly CMP is less than 10 day MMA and 40 day MMA and 10 DAY MMAs curve not having too much inclination it shows that stock is still in bullish mode for most of public but a very light volume has sold it on any price. It may be insider has sold it or due to market down turn it went down but still most of public believe in this stock. You should definitely research that stock as it is bargain buy and can consider in buying such stocks.

10. How and why MMA is better and can play significant role If the % difference between current price and 10 day MMA is very high it shows that price is high without volume so soon either a huge volume will going to take MMA price up or price is going to down as a very lower % of public has bought the share and most of public is having share of less price. This shows that how price can be inflated by broker or inside trader who knows that something going to come in future and they are just accommodating shares. This is the key graph as no other indicator can show this relation but here in the formula as both volume and price are playing the role it will correctly show that if stock really worth it.

How and why MMA can play significant role

If you are a trader then if you believe in technical analysis then you know that how many indicators are created for getting buy/sell signal. But most of the signal is based on either volume or CMP or day high/day low price. The stock market runs only and only on demand supply. There are same no of shares in the market and only those shares are bought or sold by trader every day. So if an indicator which can find out exactly what is the average price a share holded by investor then he can play this game very safely and can really make money in the market. The purpose of this indicator is to find out that price but using volume, price, historical volume, historical price which no other indicator can do. The logical way of thinking which we use in our daily life is the key of creation of this indicator.

This single indicator can do all which most of indicator cant. You cant play your card just by using some other indicators. But this indicator is able to get the information which inside trader or broker tries to hide from us or by inflating price they try to fool us. If you use this indicator carefully and make a habit of using it before doing any long term or short term trading you can be better off than other investor.


Can anyone code afl for the MMA..
 

johnnypareek

Well-Known Member
#2
hey ,

just chk below if ur talking bout this. ;)

Period=Param("Period",50,1,100);
agg=0;
for (i=0;i<BarCount;i++)
{
Vama=0;
}
for (i=1;i<BarCount;i++)
{
agg=agg+Volume;
}
ave=agg/(BarCount-1);


johnny


for (i=1;i<BarCount;i++)
{
weight_day=int((Volume/ave)-0.5)+1;
}
agg=0;
for (i=1;i<BarCount;i++)
{
index=i;
Copy_wd=weight_day;
for (j=0;j<Period;j++)
{
if(Copy_wd[index]==0) {index--;};
agg=agg+C[Index];
Copy_wd[index]--;
}
Vama=agg/Period;
agg=0;
}
Plot(Vama,"Vama",ParamColor( "Vama", colorRed),1);
Plot(C,"Price",ParamColor( "Price",colorBlack),1);
Plot(MA(C,Period),"Ma",colorBlue,1);
Short=Cover=0;
Buy=Cross(C,Vama);
Sell=Cross(Vama,C);
 

daitya

Active Member
#3
hey ,

just chk below if ur talking bout this. ;)

Period=Param("Period",50,1,100);
agg=0;
for (i=0;i<BarCount;i++)
{
Vama=0;
}
for (i=1;i<BarCount;i++)
{
agg=agg+Volume;
}
ave=agg/(BarCount-1);


johnny


for (i=1;i<BarCount;i++)
{
weight_day=int((Volume/ave)-0.5)+1;
}
agg=0;
for (i=1;i<BarCount;i++)
{
index=i;
Copy_wd=weight_day;
for (j=0;j<Period;j++)
{
if(Copy_wd[index]==0) {index--;};
agg=agg+C[Index];
Copy_wd[index]--;
}
Vama=agg/Period;
agg=0;
}
Plot(Vama,"Vama",ParamColor( "Vama", colorRed),1);
Plot(C,"Price",ParamColor( "Price",colorBlack),1);
Plot(MA(C,Period),"Ma",colorBlue,1);
Short=Cover=0;
Buy=Cross(C,Vama);
Sell=Cross(Vama,C);


Thank you johnnypareek for your kind help..
However you have posted the VAMA that is Volume Adjusted Moving Average.. and the MMA is not VAMA...as the value differs for both indicator..
 

Sunny1

Well-Known Member
#4
hey ,

just chk below if ur talking bout this. ;)

Period=Param("Period",50,1,100);
agg=0;
for (i=0;i<BarCount;i++)
{
Vama=0;
}
for (i=1;i<BarCount;i++)
{
agg=agg+Volume;
}
ave=agg/(BarCount-1);


johnny


for (i=1;i<BarCount;i++)
{
weight_day=int((Volume/ave)-0.5)+1;
}
agg=0;
for (i=1;i<BarCount;i++)
{
index=i;
Copy_wd=weight_day;
for (j=0;j<Period;j++)
{
if(Copy_wd[index]==0) {index--;};
agg=agg+C[Index];
Copy_wd[index]--;
}
Vama=agg/Period;
agg=0;
}
Plot(Vama,"Vama",ParamColor( "Vama", colorRed),1);
Plot(C,"Price",ParamColor( "Price",colorBlack),1);
Plot(MA(C,Period),"Ma",colorBlue,1);
Short=Cover=0;
Buy=Cross(C,Vama);
Sell=Cross(Vama,C);


Error Plz check and put it again
 
#5
May it help. we can discuss this afl here.

/*

Advantage in Using Mahesh Moving Average (MMA)

Therefore, above example shows that how can we find average price of a security. This way of calculation has following advantage over normal Simple Moving Average calculation.

1) Simple Moving Average just shows the current trend of the security. MMA has an average price of security

2) SMA does not care about history of the security. MMA always care of history too, in fact all prices are inbuilt has historical price with it.

3) SMA does not care about volume. Even a low volume day price is equal to same as a high volume day price. MMA is dependent of price and on volume. Both factor works together to create a new price.

How to apply MMA in Security Market

To apply AMA we can think following. Short trend, long-term trend. We can decide following as 10 days, total average can work as a total quantity for short-term period. 40 days can work as long term. To calculate AMA. Following formula can be used

TAQ (Total Average Quantity (no of days)) = Average Volume * no of days

MMA(m+1) = ((TAQ V(m+1))*MMA(m) + P(m+1) * V (m+1))/TAQ

Here MMA(m+1) denotes price of MMA price at m+1 day.

V(m) denotes volume at m day

P(m) denotes price at m day

By this formula next days MMA can be calculated. No of days can be 10, 15, 20 or as you want. You can decide different no of days on different security.

After calculating price for each day graph can be plotted on these prices.



Basic Rules for trading using MMA

I use 10 Day MMA and 40 Day MMA for short term and long term trading.

Here are some basic rules which follow.

1. If stocks current price is less than 10 day MMA and 40 day MMA then stock is in bearish mode.

2. If stocks current price is less than 10 day MMA and 40 day MMA and 10 day MMA is less than 40 day MMA then stock is in extreme bearish mode.

3. If stocks current price is higher than 10 day MMA and 40 day MMA and 10 day MMA is higher than 40 day MMA then stock is in extreme bullish mode

4. If the % difference between current price and 10 day MMA is very high it shows that price is high without volume so soon either a huge volume will going to take MMA price up or price is going to down as a very lower % of public has bought the share and most of public is having share of less price. This shows that how price can be inflated by broker or inside trader who knows that something going to come in future and they are just accommodating shares. This is the key graph as no other indicator can show this relation but here in the formula as both volume and price are playing the role it will correctly show that if stock really worth it.

5. If the % difference between current price and 10 day MMA is very low it shows that price is low without volume so soon either a huge volume will going to take MMA price low or price is going to up as a very lower % of public has sold the share and most of public is having share at higher price. This is very critical as after drastically crash stock will going to have pull and at that time when MMA and current price are in moderate range again stock will going to have downward journey. What a trader need to do is buy when a drastically difference has come and price has stopped going down more and sell when MMA and CMP is in moderate range.

6. If a stock was less than 10 day MMA and 40 day MMA and If stock now trading greater than 10 day MMA then it shows that stock is trying to come from bearish mode to bullish mode if it stays above 10 day MMA then it can be a good buy for short term till it break out 40 day MMA line and if it can break out 10 day and 40 day MMA line then the stock is in bullish mode.

7. If CMP curve is very vertical and 10 day MMA is not so vertical it is sign of conspiracy means there is inside trading happening in the stock or broker is just trying to create a hype of stock. You should take very serious consideration of those stocks and if you really want to buy then after doing good research should enter with a strict stop loss as you know that most of public is having stock on very less price and if they decided to sell then price will going to be less soon.

8. If both 10 day MMA and CMP curve is going upward then everybody is having a belief that stock is good and you can enter safely till stock is in bullish mode.

9. If stocks 10 day MMA is higher than 40 day MMA and suddenly CMP is less than 10 day MMA and 40 day MMA and 10 DAY MMAs curve not having too much inclination it shows that stock is still in bullish mode for most of public but a very light volume has sold it on any price. It may be insider has sold it or due to market down turn it went down but still most of public believe in this stock. You should definitely research that stock as it is bargain buy and can consider in buying such stocks.

10. How and why MMA is better and can play significant role If the % difference between current price and 10 day MMA is very high it shows that price is high without volume so soon either a huge volume will going to take MMA price up or price is going to down as a very lower % of public has bought the share and most of public is having share of less price. This shows that how price can be inflated by broker or inside trader who knows that something going to come in future and they are just accommodating shares. This is the key graph as no other indicator can show this relation but here in the formula as both volume and price are playing the role it will correctly show that if stock really worth it.

How and why MMA can play significant role

If you are a trader then if you believe in technical analysis then you know that how many indicators are created for getting buy/sell signal. But most of the signal is based on either volume or CMP or day high/day low price. The stock market runs only and only on demand supply. There are same no of shares in the market and only those shares are bought or sold by trader every day. So if an indicator which can find out exactly what is the average price a share holded by investor then he can play this game very safely and can really make money in the market. The purpose of this indicator is to find out that price but using volume, price, historical volume, historical price which no other indicator can do. The logical way of thinking which we use in our daily life is the key of creation of this indicator.

This single indicator can do all which most of indicator cant. You cant play your card just by using some other indicators. But this indicator is able to get the information which inside trader or broker tries to hide from us or by inflating price they try to fool us. If you use this indicator carefully and make a habit of using it before doing any long term or short term trading you can be better off than other investor.



*/


/*
TAQ (Total Average Quantity (no of days)) = Average Volume * no of days

MMA(m+1) = ((TAQ V(m+1))*MMA(m) + P(m+1) * V (m+1))/TAQ

Here MMA(m+1) denotes price of MMA price at m+1 day.

V(m) denotes volume at m day

P(m) denotes price at m day
*/


barvisible = Status("barvisible");
FVB = barvisible AND NOT Ref( barvisible, -1 );
CVB = ValueWhen( FVB,C) ;
Leftbar=ValueWhen(Ref(barvisible,-1)==0 AND barvisible,DateTime() );
Rightbar=LastValue(DateTime() );
DateSpan = EndValue(BarIndex()) - BeginValue(BarIndex());
Range = DateSpan ;
StartDate = BeginValue(BarIndex());
EndDate = EndValue(BarIndex());



NoOfDays = Param("No of days",10,1,100);

if (BarCount > NoOfDays) //Neu du Lieu it, ko Lam gi, neu du Lieu du Lon bat dau xu ly
{
TAQ = 0;
agg =0;
for (i=1;i<BarCount;i++)
{
agg=agg+Volume;
}
ave=agg/(BarCount-1);

for (j =0;j<BarCount; j++)
{
MMA[j] = 0;
}
for (j = NoOfdays; j < BarCount; j ++){
/* for (i = j - NoOfDays; i < j; i ++)
{
TAQ = TAQ + V;
}*/

TAQ = ave*NoOfDays;

MMA[j] = ((TAQ -V[j])*MMA[j-1] + C[j]*V[j])/(TAQ);

}

Plot(MMA,"MMA(" + NoOfDays + ")" ,ParamColor( "MMA", colorRed),1);



}
 

johnnypareek

Well-Known Member
#9
Thank you johnnypareek for your kind help..
However you have posted the VAMA that is Volume Adjusted Moving Average.. and the MMA is not VAMA...as the value differs for both indicator..
hi,

then u use the adjusted closing of script, average traded value, nse provide this. if u have access to odin or like that ternninal u can c that. just use that value. nnay be i ann wrong. just chk that

johnny
 

Similar threads