molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming
http://www.molanis.com/forum/

building custom indicator to show a different TF
http://www.molanis.com/forum/viewtopic.php?f=8&t=5496
Page 3 of 3

Author:  molanisfx [ Tue Dec 11, 2012 11:01 am ]
Post subject:  Re: building custom indicator to show a different TF

You need to also post the custom indicator to help but first try showing it below and not on top of the chart.

Author:  AlGer [ Wed Dec 12, 2012 6:04 pm ]
Post subject:  Re: building custom indicator to show a different TF

Okay, well I am not following you on this one. First of all, the indicator is shown on the bottom of the chart window -- they all are. Second you can generate the mlq code from the .mol file, can you not? Here it is anyway. the first one shows in the chart window, as shown in my last post. It displays daily values, in the 4 hour chart as if every 4 hour candle was a daily candle.

Attachment:
#MTF LWMA 3 CHART WINDOW.mq4 [5.76 KiB]
Downloaded 872 times


This next one is the same, only displayed in a seperate window as shown previously:

Attachment:
#MTF LWMA 3.mq4 [5.76 KiB]
Downloaded 783 times


You will have to complile them. Cheers,

Author:  molanisfx [ Thu Dec 13, 2012 4:46 pm ]
Post subject:  Re: building custom indicator to show a different TF

The indicator builder calls a custom indicator => iCustom(NULL,PERIOD_D1,"LWMA 3",0,i)
We need that custom indicator LWMA 3

Author:  AlGer [ Sun Dec 16, 2012 5:05 pm ]
Post subject:  Custom INdicator

Whoops, sorry, okay here is that custom indicator:

Attachment:
LWMA 3.mq4 [5.42 KiB]
Downloaded 796 times


Cheers,

Author:  molanisfx [ Wed Dec 19, 2012 10:54 am ]
Post subject:  Re: building custom indicator to show a different TF

If I understand correctly you want to show in any time frame the daily ma with a period of 3. The simpler way to do it is to create one indicator that uses this formula:
iMA(NULL,PERIOD_D1,3,0,MODE_LWMA,PRICE_CLOSE,i)

This is the ma description for metatrader:
iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)

Symbol NULL means any symbol
Timeframe PERIOD_D1 means daily timeframe

To test it put this indicator in a daily chart, and then add the standard ma indicator with the same parameters. Values should be the same.

Author:  AlGer [ Tue Jan 08, 2013 5:47 pm ]
Post subject:  Re: building custom indicator to show a different TF

Hello molanis

Okay I did that, but I am still getting the same problem. it does test out as you say, on the daily chart, and produce the same results there. But as soon as I do down to lower time frames, the values show up as if it was a daily chart producing incorrect results. For example the value on the ninth candle on GBPUSD from today (Dec 27) is 1.6120. As i go down to lower time frames the indicator value on every ninth candle is the same - 1.6120!

So the custom indicator is superimposing itself on the screen and lining up with the candles on any time frame not the dates. In other words, there should be a flat step between each change of value in lower time frames and there isn't.

rjo referrs to these type of indicators as "stepped" indis, because they look like steps on the lower time frames, which is the corrrect way of showing a higher TF value in a lower TF.

So there you have it. Cheers, and hope you had a good Christmas holiday.

Author:  admin [ Tue Jan 08, 2013 8:33 pm ]
Post subject:  Re: building custom indicator to show a different TF

Not sure I follow you. Post your final .mol file for me to see it.

Author:  AlGer [ Fri Jan 11, 2013 5:23 pm ]
Post subject:  Re: building custom indicator to show a different TF

Here it is

Attachment:
LWMA 3 DailyTF.moi [1.94 KiB]
Downloaded 762 times

Author:  molanisfx [ Wed Jan 16, 2013 9:54 am ]
Post subject:  Re: building custom indicator to show a different TF

That indicator is fine, it always show the ma with a period of 3 for a daily timeframe. You can test it adding the ma indicator with the same settings in the daily chart, then move to a different timeframe and see how the indicator stays in the same value. Not sure why you say is wrong. The only thing to be aware is that sometimes you won't see it in the lower time frames. I think I already explained why. Mt4 uses auto scale to show the price so the ma indicator may be out of the scale. i.e ma is 1.3 in daily timeframe while the 1 min timeframe has a price of 1.2. In the 1 min time frame you won't see the indicator due to the big price difference. If you want to see it in all timeframes, change it to plot in a separated chart.

Author:  AlGer [ Wed Jan 16, 2013 11:27 am ]
Post subject:  Re: building custom indicator to show a different TF

With my charts and using MT4, it is not a price scale problem. I understand what that is -- i.e. not seeing the indicator because it is off the chart because the price scale is different. It must be something with my MT4 downloaded from Oanda... I may replace the program download and re-chaeck

Thanks for all your help

Page 3 of 3 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/