MA Crossover shown in price Chart

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

MA Crossover shown in price Chart

Postby robbieyoung » Mon Feb 05, 2018 7:24 pm


As I can have 12 chart windows open at any one time I don't have space to show the MA Crossover chart below the price chart.

I would like an indicator to plot a single line on the price chart itself whereby if the bar closes above this line then I know the fast MA is greater than the slow MA and similarly if the bar closes below this line I know the fast MA is below the slow MA.

ie. the line shows the price where the fast MA will be exactly equal the slow MA.

The equation for the line in the current open bar is:

F = 10 (Fast MA Periods)
S = 20 (Slow MA Periods)

Price = ( S * F * MA(S-1) - S * F * MA(F-1) ) / ( S - F )

Price = ( 20 * 10 * MA(19) - 20 * 10 * MA(9) ) / ( 20 - 10 )

Where MA(19) and MA(9) are the MA of the previous 19 and 9 closed bars respectively.
(Note the MA calculation does not include the current (Open) bar)

I had looked at trying to adapt the MVA and the MACD indicators but quickly realised I dont know enough about lua to even attempt it.

Thanks in advance for any help you might be able to give.
Posts: 19
Joined: Tue Apr 21, 2015 3:12 am

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests