• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:57pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:57pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

One Indicator calling another indicator in MQL4 3 replies

How to program the std indicator to take to take price from other indicator windows 0 replies

Adding an indicator to an indicator 10 replies

Indicator/Trendline Pips indicator 2 replies

add indicator to an Indicator 4 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 5
Attachments: Indicator of the indicator
Exit Attachments
Tags: Indicator of the indicator
Cancel

Indicator of the indicator

  • Post #1
  • Quote
  • First Post: Aug 14, 2009 11:10pm Aug 14, 2009 11:10pm
  •  toyotoyo
  • | Joined Jan 2008 | Status: Member | 63 Posts
Hi guys, do you know of an indicator that will compute and plot chart of an indicator?

the formula is this:

[TODAY'S READING - LOWEST READING(say in the last 20days)]
--------------------------------------------------------------------------------------- X 100
[HIGHEST READING(say in the last 20days) - LOWEST READING(say in the last 20days)]

variables are:
var1: any indicator e.g. MACD, CCI, RSI, ADX, MFI etc
var2: last X days

any ideas guys?

thanks for any help.
  • Post #2
  • Quote
  • Aug 17, 2009 8:32pm Aug 17, 2009 8:32pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting toyotoyo
Disliked
Hi guys, do you know of an indicator that will compute and plot chart of an indicator?

the formula is this:

[TODAY'S READING - LOWEST READING(say in the last 20days)]
--------------------------------------------------------------------------------------- X 100
[HIGHEST READING(say in the last 20days) - LOWEST READING(say in the last 20days)]

variables are:
var1: any indicator e.g. MACD, CCI, RSI, ADX, MFI etc
var2: last X days

any ideas guys?

thanks for any help.
Ignored
Got your PM. Will look at this when I get some spare time, maybe in a week or two. Meanwhile somebody else might be able to code it for you.
 
 
  • Post #3
  • Quote
  • Aug 17, 2009 9:05pm Aug 17, 2009 9:05pm
  •  gbppip
  • | Additional Username | Joined Nov 2006 | 362 Posts
There are some compass indicators out there that someone could modify to do what you wanted.
 
 
  • Post #4
  • Quote
  • Aug 18, 2009 3:40am Aug 18, 2009 3:40am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Apologies, the attached isn't super-flash, but it does cover everything that you provided in your spec.

Valid entries for the Indicator parameter:

  1. A = ADX(NULL,0,20,PRICE_CLOSE,0,shift);
  2. C = CCI(NULL,0,20,PRICE_CLOSE,shift);
  3. MA = MACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,shift);
  4. MF = MFI(NULL,0,20,shift);
  5. R = RSI(NULL,0,14,PRICE_CLOSE,shift);
  6. S = Stochastic(NULL,0,5,3,3,MODE_SMA,0,PRICE_CLOSE,shift);


If you want to change the indy settings (e.g. the 12,26,9 for MACD), you'll need to modify and recompile the code.

The value plotted is:
(N – Lowest N in last X bars) / (Highest N in last X bars – Lowest N in last X bars) x 100

where N is the value of the indicator, e.g. MACD(12,26,9)
and X is the value you entered into the LastXBars parameter

Attached File(s)
File Type: mq4 Toyotoyo.mq4   5 KB | 679 downloads
 
 
  • Post #5
  • Quote
  • Aug 18, 2009 5:15pm Aug 18, 2009 5:15pm
  •  toyotoyo
  • | Joined Jan 2008 | Status: Member | 63 Posts
Quoting hanover
Disliked
Apologies, the attached isn't super-flash, but it does cover everything that you provided in your spec.

Valid entries for the Indicator parameter:

  1. A = ADX(NULL,0,20,PRICE_CLOSE,0,shift);
  2. C = CCI(NULL,0,20,PRICE_CLOSE,shift);
  3. MA = MACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,shift);
  4. MF = MFI(NULL,0,20,shift);
  5. R = RSI(NULL,0,14,PRICE_CLOSE,shift);
  6. S = Stochastic(NULL,0,5,3,3,MODE_SMA,0,PRICE_CLOSE,shift);


If you want to change the indy settings (e.g. the 12,26,9 for...

Ignored
Hi Hanover, first of all I would like to thank you for your time and effort in helping me. I really appreciate it.

I've tried this indicator and put in the Inputs tab in the variable/indicator bit some indicators like CCI, RSI etc but the Toyotoyo indicator doesn't seem to chart/graph anything. It's just dashed line on the 100 and 0 level.

I tried also inputting R for RSI etc but no luck. Am I missing something in the setup? Im sorry for being so thick.

Once again thank you very much.
 
 
  • Post #6
  • Quote
  • Aug 19, 2009 4:28am Aug 19, 2009 4:28am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting toyotoyo
Disliked
Hi Hanover, first of all I would like to thank you for your time and effort in helping me. I really appreciate it.

I've tried this indicator and put in the Inputs tab in the variable/indicator bit some indicators like CCI, RSI etc but the Toyotoyo indicator doesn't seem to chart/graph anything. It's just dashed line on the 100 and 0 level.

I tried also inputting R for RSI etc but no luck. Am I missing something in the setup? Im sorry for being so thick.

Once again thank you very much.
Ignored
Not sure what the problem is.

Here is a screenshot of an EURUSD H1 chart where I've attached the indy 4 times: white line is MACD; blue is CCI; red is RSI; yellow is MFI. LastXBars = 20 in each case.
Attached Image (click to enlarge)
Click to Enlarge

Name: toyo1.gif
Size: 24 KB
 
 
  • Post #7
  • Quote
  • Aug 19, 2009 3:19pm Aug 19, 2009 3:19pm
  •  toyotoyo
  • | Joined Jan 2008 | Status: Member | 63 Posts
hi hanover, when i restarted metatrader, it seems to work now.

thank you very much.

ive been trying some indicators but i was not successful in incorporating those to your code. how am i going to insert into your code if i also want to include this indicator? http://codebase.mql4.com/source/12447

(im sorry for being such a pain)
 
 
  • Post #8
  • Quote
  • Sep 6, 2009 6:57pm Sep 6, 2009 6:57pm
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,603 Posts
hey toyotoyo..... got the pm..... sure.... anytime.....

we can't pm files so will post here.....

i can't test the WILLSPREAD cause it is using gold, which is not available to me..... resave that indicator and rename to WILLSPREAD.....

also resave the cmo indicator and rename CMO.....

to add additional indicators to hanovers code, use iCustom...... be sure change the name to capitol letters only and no spaces for simplicity.....h
Attached File(s)
File Type: mq4 Toyotoyo.mq4   5 KB | 591 downloads
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #9
  • Quote
  • Sep 7, 2009 4:59pm Sep 7, 2009 4:59pm
  •  toyotoyo
  • | Joined Jan 2008 | Status: Member | 63 Posts
Quoting hayseed
Disliked
hey toyotoyo..... got the pm..... sure.... anytime.....

we can't pm files so will post here.....

i can't test the WILLSPREAD cause it is using gold, which is not available to me..... resave that indicator and rename to WILLSPREAD.....

also resave the cmo indicator and rename CMO.....

to add additional indicators to hanovers code, use iCustom...... be sure change the name to capitol letters only and no spaces for simplicity.....h
Ignored
oh thank you so very much hayseed. it's working perfectly!!!

you are so helpful. have a very nice day!
 
 
  • Post #10
  • Quote
  • Sep 11, 2009 4:34pm Sep 11, 2009 4:34pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Toyotoyo, my apologies, I replied to your last PM in haste - had about 25 of them to get thru after returning from vacation. Anyway, it looks like you have your answer now - that's great
 
 
  • Post #11
  • Quote
  • Sep 15, 2009 8:33pm Sep 15, 2009 8:33pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
If the indicator is to be plotted over (for example) 10,000 bars, and each plotted point requires averaging of 20 bars, then the number of iterations will be 10,000 x 20 = 200,000. I can't see any way around the multiplication; it is, after all, an 'indicator of an indicator'. Re-coding using MT4's IndicatorCounted() function will only help the speed after MT4 has been loaded and the indy is up and running on the chart.

However, I've attached two new versions of the indicator. Both include a new parameter, TotalBars. If you set this (for example) to 100, then only the last 100 bars will be claculated/plotted. If LastXBars is 20, then this would require only 100 x 20 = 2,000 iterations (hence it should run approx 100 times faster).

Of the two versions, Toyotoyo1 is the original version that I posted, without CMO and WILLSPREAD. Toyotoyo2 includes CMO and WILLSPREAD, the way Hayseed coded them using MT4's iCustom function. I have never used iCustom before, but I suspect that it calls the other indicator and runs through the entire calc for that indy. Hence any inefficiency or complexity in that calculation will obviously affect speed accordingly, and of course in this case it must be performed once for every iteration. Try the two versions, and if Toyotoyo2 is a lot slower, then at least you know why.

Will make this my last modification; this is about as much time as I can afford to spend on a freebee.
Attached File(s)
File Type: mq4 Toyotoyo1.mq4   5 KB | 631 downloads
File Type: mq4 Toyotoyo2.mq4   5 KB | 686 downloads
 
 
  • Post #12
  • Quote
  • Last Post: Sep 17, 2009 1:50pm Sep 17, 2009 1:50pm
  •  toyotoyo
  • | Joined Jan 2008 | Status: Member | 63 Posts
Quoting hanover
Disliked
If the indicator is to be plotted over (for example) 10,000 bars, and each plotted point requires averaging of 20 bars, then the number of iterations will be 10,000 x 20 = 200,000. I can't see any way around the multiplication; it is, after all, an 'indicator of an indicator'. Re-coding using MT4's IndicatorCounted() function will only help the speed after MT4 has been loaded and the indy is up and running on the chart.

However, I've attached two new versions of the indicator. Both include a new parameter, TotalBars. If you set this...
Ignored
Thanks very much Hanover.
 
 
  • Platform Tech
  • /
  • Indicator of the indicator
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023