Indicators - Moving Averages-702294

Embed Size (px)

Citation preview

  • 7/30/2019 Indicators - Moving Averages-702294

    1/5

    Description

    SMA(A): Simple Moving Average (Closing price shown in formula for simplicity.

    The offset function returns a cell range which is just A Cells which need to be summated.

    The offset funciton could also be used to select which price column is used (open, high, low,

    close, volume) but is not shown.

    Parameter A sets the time period for the SMA

    SMAR(A) is a simple moving average of the price range. The sum of the differences between the

    high and low for each day is mathematically equivalent to taking the difference between the sum

    of the highs and the sum of the lows. Or even the difference between an SMA of the Highs and an

    SMA of the lows.

    EMA(A): Exponential Moving Average

    Note for a Wilder implementation of the Wilder EMA see my spreadsheet on DMS.

    The problem with an EMA is that unless it has been calculated in finitem the result is not accurate

    because the formula requires historical values. This implementation uses an SMA as the initial

    value for the EMA. The 3 columns - Seed data calculate the SMA for each seed period. Whilst it

    looks confusing at first, the EMA calculation checks if there are sufficient days to calculate an

    EMA accurately, if not it uses the SMA value instead as the previous value.

    Parameter A is the time period for the EMA

    Parameter B is a formula optimisation

    Paramater C allows for the conversion of the EMA to a Per Unit Calculation

    For the EMA to be calculated in Per Units rather than price, place the current price or reference

    price in this cell.

  • 7/30/2019 Indicators - Moving Averages-702294

    2/5

    Stock Price Data and Formula notes

    This row indicates which Formula is in useParam SMA(A)/C

    SMA(A)

    RangeParameters (A,B,C,D,E) are used A 20 20

    by each algorithm in each Column B

    System Results may also be calculated in these rows C 1.0000 1.0000

    DE

    F

    G

    H

    J

    K

    L

    M

    N

    P

    Code TradeDate Open High Low Close Result

    Code TradeDate Open High Low Close Volume SMA (20) SMAR(20)FGL 5/7/2004 4.70 4.72 4.67 4.68 4751120 4.68 0.075

    FGL 5/6/2004 4.74 4.74 4.65 4.70 4713918 4.67 0.075

    FGL 5/5/2004 4.71 4.76 4.71 4.75 3874019 4.65 0.075

    FGL 5/4/2004 4.82 4.82 4.72 4.73 5898108 4.64 0.074

    FGL 5/3/2004 4.85 4.86 4.80 4.82 6244101 4.62 0.070

    FGL 4/30/2004 4.76 4.90 4.75 4.89 23298620 4.60 0.069

    FGL 4/29/2004 4.72 4.76 4.71 4.75 8022286 4.57 0.063

    FGL 4/28/2004 4.75 4.77 4.74 4.74 2690305 4.56 0.061

    FGL 4/27/2004 4.73 4.79 4.72 4.76 3567889 4.54 0.062

    FGL 4/26/2004 4.75 4.75 4.72 4.72 762291 4.53 0.060

    FGL 4/23/2004 4.79 4.81 4.72 4.73 6699094 4.51 0.062

    FGL 4/22/2004 4.79 4.80 4.75 4.79 6165833 4.50 0.058

    FGL 4/21/2004 4.76 4.90 4.75 4.80 15332080 4.48 0.057

    FGL 4/20/2004 4.64 4.77 4.64 4.75 19343000 4.46 0.051

    FGL 4/19/2004 4.58 4.61 4.52 4.61 7308155 4.44 0.046

    FGL 4/16/2004 4.49 4.57 4.49 4.55 6838404 4.43 0.046

    FGL 4/15/2004 4.45 4.49 4.43 4.49 6033271 4.42 0.044

    FGL 4/14/2004 4.45 4.47 4.42 4.44 1403029 4.42 0.045

    FGL 4/13/2004 4.47 4.47 4.42 4.44 2890764 4.42 0.044

    FGL 4/8/2004 4.43 4.48 4.42 4.48 3976386 4.42 0.043

    FGL 4/7/2004 4.37 4.43 4.37 4.42 17023520 4.41 0.043

    FGL 4/6/2004 4.41 4.42 4.33 4.38 12085540 4.41 0.042

    FGL 4/5/2004 4.41 4.43 4.40 4.42 4069024 4.41 0.038

    FGL 4/2/2004 4.41 4.41 4.39 4.39 6837315 4.41 0.039FGL 4/1/2004 4.39 4.42 4.39 4.40 16193840 4.41 0.039

    FGL 3/31/2004 4.41 4.42 4.39 4.39 6601374 4.41 0.040

    FGL 3/30/2004 4.43 4.43 4.41 4.41 5234586 4.40 0.040

    FGL 3/29/2004 4.45 4.46 4.41 4.42 11270850 4.40 0.041

    FGL 3/26/2004 4.46 4.48 4.45 4.48 8962088 4.40 0.041

    FGL 3/25/2004 4.40 4.46 4.40 4.45 9529200 4.40 0.042

    FGL 3/24/2004 4.41 4.42 4.40 4.40 5024256 4.39 0.040

    FGL 3/23/2004 4.42 4.42 4.40 4.42 4866177 4.17 0.039

  • 7/30/2019 Indicators - Moving Averages-702294

    3/5

    FGL 3/22/2004 4.39 4.42 4.39 4.41 5767930 3.95 0.038

    FGL 3/19/2004 4.40 4.43 4.39 4.39 8824880 3.73 0.037

    FGL 3/18/2004 4.47 4.47 4.38 4.40 11466880 3.51 0.035

    FGL 3/17/2004 4.43 4.46 4.42 4.44 3953599 3.29 0.030

    FGL 3/16/2004 4.37 4.45 4.37 4.43 6082748 3.07 0.028

    FGL 3/15/2004 4.41 4.42 4.39 4.39 3300617 2.85 0.024

    FGL 3/12/2004 4.40 4.40 4.38 4.40 2125319 2.63 0.023FGL 3/11/2004 4.38 4.43 4.36 4.42 12596020 2.41 0.022

    FGL 3/10/2004 4.36 4.39 4.35 4.38 3274963 2.18 0.018

    FGL 3/9/2004 4.35 4.36 4.34 4.36 3030341 1.97 0.016

    FGL 3/8/2004 4.39 4.39 4.35 4.37 2562125 1.75 0.015

    FGL 3/5/2004 4.38 4.41 4.38 4.41 7240259 1.53 0.013

    FGL 3/4/2004 4.34 4.39 4.34 4.38 10639450 1.31 0.012

    FGL 3/3/2004 4.35 4.35 4.32 4.33 10868530 1.09 0.009

    FGL 3/2/2004 4.32 4.36 4.32 4.35 6965415 0.87 0.008

    FGL 3/1/2004 4.37 4.41 4.36 4.41 7091303 0.66 0.006

    FGL 2/27/2004 4.34 4.37 4.32 4.37 7062791 0.44 0.003

    FGL 2/26/2004 4.33 4.34 4.32 4.34 5171122 0.22 0.001

  • 7/30/2019 Indicators - Moving Averages-702294

    4/5

    EMA(A)/C

    20

    0.0952

    1.0000

    Day Seed EMASeed EMA(20)

    50 4.51 4.46

    49 4.51 4.44

    48 4.50 4.41

    47 4.50 4.37

    46 4.49 4.33

    45 4.49 4.28

    44 4.48 4.22

    43 4.47 4.16

    42 4.46 4.10

    41 4.46 4.03

    40 4.45 3.96

    39 4.44 3.88

    38 4.43 3.79

    37 4.42 3.68

    36 4.42 3.57

    35 4.41 3.46

    34 4.41 3.34

    33 4.40 3.22

    32 4.40 3.09

    31 4.40 2.95

    30 4.40 2.79

    29 4.40 2.62

    28 4.40 2.43

    27 4.40 2.2226 4.40 2.00

    25 4.40 1.74

    24 4.40 1.46

    23 4.40 1.15

    22 4.40 0.81

    21 4.39 0.42

    20 4.39 0.00

    19 4.39 0.00

  • 7/30/2019 Indicators - Moving Averages-702294

    5/5

    18 4.39 0.00

    17 4.39 0.00

    16 4.39 0.00

    15 4.39 0.00

    14 4.38 0.00

    13 4.38 0.00

    12 4.38 0.0011 4.37 0.00

    10 4.37 0.00

    9 4.37 0.00

    8 4.37 0.00

    7 4.37 0.00

    6 4.36 0.00

    5 4.36 0.00

    4 4.37 0.00

    3 4.37 0.00

    2 4.36 0.00

    1 4.34 0.00