Page 1 of 5

Centred moving average

PostPosted: Mon Oct 15, 2012 12:20 pm
by Apprentice
CMA.png

This indicator is basically a simple moving average,
if compared with the original, there is a notable reduction in lag time,
last Period/2 values are just a projection of possible future SMA values.
CMA.bin
Supports SMA(MVA)
(1.26 KiB) Downloaded 2698 times

OCMA.bin
Supports SMA(MVA), EMA, LWMA, TMA, SMMA, KAMA, VIDYA, WMA
(1.55 KiB) Downloaded 1591 times

CMA.png

CMAD.lua
CMA difference
(3.78 KiB) Downloaded 1563 times

CMAD Histogram.lua
(5 KiB) Downloaded 1032 times

CMAD = CMA1 -CMA2
CMAS.lua
CMA speed
(4.07 KiB) Downloaded 1528 times

CMAS Histogram.lua
(4.36 KiB) Downloaded 1008 times

CMAS = CMA-CMA[-1]

CMAD Momentum.png

CMAD Momentum = CMAD- CMAD N Perods Ago
CMAD Momentum.lua
(4.36 KiB) Downloaded 1514 times

Re: Centred moving average

PostPosted: Tue Oct 16, 2012 12:16 pm
by Apprentice
Two Averages Oscillator.png

TAO= MA1-MA2
Two Averages Oscillator.lua
(5.8 KiB) Downloaded 1768 times


Centred moving average is one of the moving averages used.
As Centered moving average repaint,
when CMA is used, TAO will also repaint.
However i have included Static / Dynamic Mode Selector also.

Re: Centred moving average

PostPosted: Mon Oct 22, 2012 4:22 pm
by lucmat
Hi Apprentice!
Your works are always good!!

Do you think it's possible to build "cyclical indicator" (seehttp://fxcodebase.com/code/viewtopic ... +indicator) with this centered moving average?

Thanks

Lucmat

Re: Centred moving average

PostPosted: Tue Oct 23, 2012 7:15 am
by Apprentice
I post your simplified version in the Indicator Request subforum.
I have not had time for you first integral version.

Re: Centred moving average

PostPosted: Thu Nov 08, 2012 6:21 am
by Davids0869
Hi Appendice, Hello, I would like to know if it is possible at first to have a program which gives a signal of purchase or sale according to three different oscillators in the same graph. A first signal of purchase (1 lot) when 2 two average oscillator are increasing and the second (3 lots) when 3 are increasing. You've an interpretation in this following graph for a short.


Apprentice wrote:
The attachment Two Averages Oscillator.png is no longer available

TAO= MA1-MA2
The attachment Two Averages Oscillator.png is no longer available


Centred moving average is one of the moving averages used.
As Centered moving average repaint,
when CMA is used, TAO will also repaint.
However i have included Static / Dynamic Mode Selector also.

Re: Centred moving average

PostPosted: Fri Nov 09, 2012 6:14 am
by Apprentice
Yes, this is possible.
But i am not sure, CMA is best choice.
Because CMA repaints,
Historical, backtest is meaningless,
trading, in current (last) period is possible...
But I guess with lot of changes in indications.
Write trading algorithm conditions, we can try...

Re: Centred moving average

PostPosted: Fri Nov 09, 2012 2:14 pm
by Davids0869
Thank you Apprentice, I propose that (for short):

Code: Select all
Value for CMA1 = N
Value for CMA2 = 2*N     ,       TAO1=CMA1-CMA2     
Value for CMA3 = 4*N     ,       TAO2=CMA2-CMA3
Value for CMA4 = 8*N     ,       TAO3=CMA3-CMA4

Period = 4*N

Maximum = MAX[PERIOD](close)
Minimum = MIN[PERIOD](close)

G = (CMA2 + CMA3 + CMA4) /3

IF close > G then
C = 1
else C = 0
Endif

IF CMA2 < CMA2[1] then
   C1 = 1
   Else C1 = 0
Endif

IF CMA3 < CMA3[1] then
   C2 = 1
   Else C2 = 0
Endif

IF CMA4 < CMA4[1]  then
   C3 = 1
   Else C3 = 0
Endif

X = C1 + C2 + C3

IF X = 2 and C = 1 and not short on market then
sell 1 lot
Target = G 
Endif

IF X = 3 and C = 1  then
sell 2 lots
Target = 2* G  - MAXIMUM
Endif

The same for long with condition ">" in place of "<", and C = 0  and  MINIMUM in place of MAXIMUM to calculate Target when buy 2 lots.


If you have any question don't hesitate to contact me.

David.


Apprentice wrote:Yes, this is possible.=
But i am not sure, CMA is best choice.
Because CMA repaints,
Historical, backtest is meaningless,
>Gtrading, in current (last) period is possible...
But I guess with lot of changes in indications.
Write trading algorithm conditions, we can try...

Re: Centred moving average

PostPosted: Sun Nov 11, 2012 6:19 am
by Davids0869
Maybe there is a particular condition for the calculation of G (and of course the new target). It is a mobile point and I think that we could fix it when the price crosses G. At this moment there we shall have defined the new target of exit of the trade.

Re: Centred moving average

PostPosted: Sat Nov 24, 2012 6:26 am
by Tigre3
Could you make a version that shows with a different type of line where there's projection of the MA?

For example
If you have a CMA(10) the last 5 value is just a projection, right? Well, I'm looking for an indicator that shows this projection with a different type of line such as if the CMA is a line, the projection will be a dotted line.. in this way I can know where the will probably repaint.


The options should be like this:
Type of line: [listbox with the different kind of line]
Type of projection: [listbox with the different kind of line]

Thanks :)

Re: Centred moving average

PostPosted: Sat Nov 24, 2012 6:42 am
by Apprentice
This is possible.
But i will prefer different Color, not Style difference, compatibility issue,
for line style i have to use two streams, not one as now.
Is this satisfactory.