Lets find 3 SMA(simple moving average)
Market closed on say dates below(i.e closing price)
1 May at 5000
2 May at 3000
3 May at 4000
4 May at 5000
SO when u calculate SMA on 3 rd MAY, u will need 3 days closing which u have now as on dated 3rd may,(1,2,3may).
SMA(3) = close price of(may 1 + may 2 + may 3)/3(as 3 three SMA)
=5000+3000+4000/3 = .....
EMA is exponential, similar to SMA but more weighatage is given to recent closing CANDLES, that is more value is given in some way to 3rd May than 2nd May and so on.
Link mentioned above will know be more easy for u to understand.
IF u calculate 3 SMA on 4may, it will be,
SMA(3) = 3000+4000+5000/3
=......
Hope this will help u to get started.