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

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sun Apr 28, 2024 6:15 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Tue Dec 11, 2012 11:01 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You need to also post the custom indicator to help but first try showing it below and not on top of the chart.


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Wed Dec 12, 2012 6:04 pm 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
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 817 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 718 times


You will have to complile them. Cheers,

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Thu Dec 13, 2012 4:46 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
The indicator builder calls a custom indicator => iCustom(NULL,PERIOD_D1,"LWMA 3",0,i)
We need that custom indicator LWMA 3


Top
 Profile  
 
 Post subject: Custom INdicator
PostPosted: Sun Dec 16, 2012 5:05 pm 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
Whoops, sorry, okay here is that custom indicator:

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


Cheers,

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Wed Dec 19, 2012 10:54 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
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.


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Tue Jan 08, 2013 5:47 pm 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
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.

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Tue Jan 08, 2013 8:33 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Not sure I follow you. Post your final .mol file for me to see it.


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Fri Jan 11, 2013 5:23 pm 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
Here it is

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

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Wed Jan 16, 2013 9:54 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
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.


Top
 Profile  
 
 Post subject: Re: building custom indicator to show a different TF
PostPosted: Wed Jan 16, 2013 11:27 am 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
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

_________________
Building a future with automated trading


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009