TradingView
Kurbelklaus
Apr 21, 2015 2:21 PM

KK_Intraday MAs 

Euro Fx/U.S. DollarFXCM

Description

Hey guys,

today I was browsing through intraday Charts looking at some moving averages. Basically what I wanted to see was whether the currency pair was trading below or above the moving average of the day/week/month. For a better understanding: The daily MA on a 15 minute Forex Chart would be the 96 MA.

I encountered the problem that i always had to change the settings for my MAs when changing the Time Interval, so I coded this here up. It is pretty simple but maybe somebody else has the same problem and can put it to use.

The script has some settings as listed below:
  • Choice which MAs to plot, (Daily, Weekly, Monthly)
  • Choice which type of MA to use (Simple, Exponential, Weighted)
  • Neccesary Settings for the correct calculation (e.g. Number of trading hours per day). These settings depend on the instrument you are using and should always be checked before using this script.


There are a few things to Note when using this script:
  • This script works for intraday charts only.
  • The monthly MA doesn't work on any Time Interval smaller than 15 minutes. Can't do anything about it unfortunately.


This is my first published Script, use it with caution and let me know what you think about it!
Comments
raja74sekhar
Not working error coming
miaomiao18
These 2 MAs from this indicator shown on chart. it's actually same as MA30 and MA130 on 4H.
In case anybody wanna use it on TF smaller than 15min, can do the hour into minute calculation.
More