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

Hi,

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.
robbieyoung
 
Posts: 13
Joined: Tue Apr 21, 2015 3:12 am

Re: MA Crossover shown in price Chart

Postby Apprentice » Tue Feb 06, 2018 4:54 pm

User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18098
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 4 guests

cron