MultiTimeframe MultiPeriod Moving Average Indicator

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

MultiTimeframe MultiPeriod Moving Average Indicator

Postby gg_frx » Sun May 16, 2010 4:08 am

ok .. now explain the title of the thread ...
i use different moving average( simple, exponential ... ) with different periods ( 10, 20, 50, 200 ...) on various timeframes ( 2', 5', 10', 15' ..... 4h .. all ).
To see all levels that i need i have two ways:
- set up multiple windows with all timeframes (for instance: ema 10, 30, 100 on a 5' chart, on a 15' chart, on a 1h chart ....)
- set up one window with the same parameter but with continuous timeframe changes to see the levels.

So what i need is an indicator that plots, whatever the timeframe i choose, all levels that i see on different windows ... on one chart window only.

So ... if this is possible, there are more questions developing such indicator:

1)
Best to code one simple indicator that i insert multiple times on the same chart or a complex indicator with multiple switch ?

In my mind there are this options in the parameter window:
choose moving average
choose time frame
choose period1
color1 ( to identify chosen period .. 10, 20, 50 ... color-coded in my mind ... )
label1 ( to plot custom info about this level, like chosen timeframe or other info, useful with multiple insert of the same indicator)
choose period2
color2
label2
choose period3
color3
label3


2)
plotting the curve what i really need are the levels on last few bars, not all the curve .. but anyway the possibility to show all the curve is appreciated (like history mode in pivot points) so another options will be added:
show all the curve
or
show only last xx bars



Well
that's all for now ..
what do you think ? Is this a dream or ... ? :D
gg_frx
FXCodeBase: Confirmed User
 
Posts: 38
Joined: Thu Dec 17, 2009 8:42 am

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby Nikolay.Gekht » Mon May 17, 2010 4:07 pm

This is not a dream with one exception - there is no simple way to show the moving average applied on the smaller time frame, e.g. 5 minute moving average on 1 hour. It is not limitation of the marketscope, just I have no idea how to draw it. The best thing I can guess is to draw small "candles" displaying open, high, low and close values of the moving average inside the hour.

Without this feature (i.e. if we show only the same or bigger time frame) - all we need is a bigger time frame moving average.

I also do not think that an idea to add many moving averages into one indicator is the best way. There is the "template" functionality in the marketscope, so, you can apply any set of indicators, then save this set as a template and them open this template as many times as you wish only changing the instrument.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby Nikolay.Gekht » Mon May 17, 2010 4:49 pm

How it could look:
mf_ma.png


bigger frame moving average beta:
MF_MA.lua
(9.28 KiB) Downloaded 1316 times


template with 3 MF_MA indicators:
mf_template.cht
(3.05 KiB) Downloaded 1241 times


Go to the "File" menu of the marketscope and choose "Open File". The template is the default file type. Just choose the mf_template.cht. A chart with 3 indicators will be opened.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby aarons_alive » Wed May 19, 2010 4:51 pm

ok Nikolay, i hope this simple example clears up any theoretical issues you might be suffering!

Say for example i calculated a 21 period EMA on a 4hr timeframe, the EMA value is 1.23598 at 3pm on a 4hr eur/usd timeframe, and the spot price is below this average. Now, say for example i also calculated a 21 period EMA on a 1hr timeframe, its value is 1.23125 at 3pm, and the spot price is above this average. If i was looking at the 1hr timeframe, and my aim was to sell when the spot price approaches the 4hr 21EMA, i would need either need to navigate to the 4hr window to note the value of the 4hr EMA, or i would need to open both windows; i would actually need to open 3 windows because i use a 15m window for entries.

So here is the requirement; the option to place an EMA on the 1hr window, where that particular EMA takes it calculation from the 4hr data. Visually, a 21 period EMA from the 4hr window used in the 15m window might take on similar values as a 100EMA based on 15m candles, say. Its not an intuitive concept, and its a thing of convenience more than anything....to save screen space, to save clicks and to save time. Think about it this way, if i could look at a weekly EMA, a daily EMA and 4hr EMA all on a 1hr timeframe, this would be optimal.
aarons_alive
 
Posts: 13
Joined: Mon Apr 19, 2010 10:50 am

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby Nikolay.Gekht » Wed May 19, 2010 5:17 pm

If I get you right - you can do it using the MF_MA indicator I published above.

See the snapshot below, there are three EMA(21) applied on H1 (darkest line), H4 and D1 (lightest line) data. You can change the timeframe (but not shorter than the chart time frame), MA type, and the price to apply MA.

EMA1.png
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby a135711 » Thu May 20, 2010 6:20 am

can we now consolidate the functions of period shift (shift_MA.lua) and large frame period (MF_MA.lua) into the same indicator, with the shift function optional as well? great work thus far.
a135711
 
Posts: 39
Joined: Fri Apr 30, 2010 12:01 pm

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby Nikolay.Gekht » Thu May 20, 2010 9:46 am

Should it shift in terms of the bigger time frame or time frame applied to? e.g. if I have 1 hour chart and 4-hour MA applied and the specify 1 bar shift - shall it be shifted by 1 1-hour bar or 4-hour bar?
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby a135711 » Thu May 20, 2010 10:56 am

Should it shift in terms of the bigger time frame or time frame applied to? e.g.
if I have 1 hour chart and 4-hour MA applied and the specify 1 bar shift - shall it be shifted by 1 1-hour bar or 4-hour bar?

it should shift in terms of the bigger time frame

interestingly, with decimal input, then you could satisfy either since to specify .25 bar shift of a 4 hr bar is equal 1 bar shift of a 1 hr time period.
a135711
 
Posts: 39
Joined: Fri Apr 30, 2010 12:01 pm

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby gg_frx » Sun May 23, 2010 9:53 am

thank you nik ... ..the dreams come true .... :mrgreen:

Nikolay.Gekht wrote:This is not a dream with one exception - there is no simple way to show the moving average applied on the smaller time frame, e.g. 5 minute moving average on 1 hour.

for me this point isn't important, usually i use a 5' so all bigger tineframes are plotted correctly

Nikolay.Gekht wrote:I also do not think that an idea to add many moving averages into one indicator is the best way. There is the "template" functionality in the marketscope, so, you can apply any set of indicators, then save this set as a template and them open this template as many times as you wish only changing the instrument.

my idea to group the options that i posted above is :
download and read one time the price data of 5' (or 15' or 30' ... weekly) than calculate ema 10, ema 40 , ema 125 ...
adding several time the same indicator for the same timeframe i think that is an overload for tradestation ... note .. i think ... i don't know how tradestation works ;)

another little problem is that for great period, like sma 200 or bigger, you must scroll the chart to the right so more data are downloaded redrawing correctly the curve.
i don't know if can be resolved

anyway, this indicator for me is ok, waiting more suggestions from other users
thank you again 8-)
gg_frx
FXCodeBase: Confirmed User
 
Posts: 38
Joined: Thu Dec 17, 2009 8:42 am

Re: MultiTimeframe MultiPeriod Moving Average Indicator

Postby sabrumea » Sun Sep 05, 2010 3:54 pm

so cool, is it possible to have the same for PPMA?? :?:
User avatar
sabrumea
 
Posts: 34
Joined: Thu Aug 26, 2010 6:15 pm

Next

Return to Discussions

Who is online

Users browsing this forum: No registered users and 10 guests