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 Tue May 14, 2024 9:54 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Indicator Not Working
PostPosted: Sun Aug 14, 2011 8:58 pm 
Offline

Joined: Sun Aug 14, 2011 8:43 pm
Posts: 4
Hi Sorry this still doesn't work. This is what I did.

I wrote the (High[i]) with the Highest and 9 period

I wrote the (Low[i]) with the Lowest and 9 period.

and I created individual indicators out of them and put them on MetaTrader on the Nasdaq 100 daily chart.

The numbers I get for the Highest High for the last 9 days is 2320, which is correct. I get 1973 for the lowest low of the last 9 days, also correct.

Then I plug in the code you supplied (iCustom(NULL,0,"High 9",0,i)-iCustom(NULL,0,"Low 9",0,i))

I cut and paste this and triple-checked to see that it's correct. I created an indicator out of it, expecting to get 2320-1973= 347
However for some reason the indicator gives me 77, which is exactly what I got before I changed the code to what was suggested. This is 270 points off, and I've tried to figure out where in the code 270 could have come from but can't.

I am trying to build an indicator that gives me the following parameters-

(Open 8 bars ago - this bar's close) / Highest high in last 9 periods - Lowest Low in last 9 periods ) * 100

Thanks for the help.


Attachments:
File comment: I think this is the problem file. It works individually as Highest High of last 9 periods minus Lowest Low of Last 9 periods, but when you put it together it doesnt' work.
High9MinusLow9.moi [1.56 KiB]
Downloaded 395 times
File comment: ( This is Open 9 bars ago- This periods close/Highest high of last 9 periods - lowest low of last 9 periods ) * 100 but it doesn't work.
Proxy 4.moi [1.64 KiB]
Downloaded 391 times
File comment: This Works Okay and gives the Open 9 periods ago - this periods close.
Open9Close.moi [1.44 KiB]
Downloaded 396 times
Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Mon Aug 15, 2011 7:27 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
The indicator for Open[i+9]-Close[i] is ok
The indicator (iCustom(NULL,0,"High 9",0,i)-iCustom(NULL,0,"Low 9",0,i)) is wrong unless you have 2 other indicators that you did not post called High 9 and Low 9. If you have them, then is ok
Finally, Open[i+9]-Close[i]/Open[i+9]-Close[i]/(iCustom(NULL,0,"High 9",0,i)-iCustom(NULL,0,"Low 9",0,i)) is wrong. You need to use () to maintain the order of operations. Go to this page http://book.mql4.com/basics/expressions and read the title Order of Operations.

Your original equation is (Open 8 bars ago - this bar's close) / Highest high in last 9 periods - Lowest Low in last 9 periods ) * 100 which is missing a (. The right one should be :

( (Open 8 bars ago - this bar's close) / (Highest high in last 9 periods - Lowest Low in last 9 periods ) ) * 100

So the equation in the indicator builder should be:
( (Open[i+9]-Close[i]) / ( iCustom(NULL,0,"High 9",0,i)-iCustom(NULL,0,"Low 9",0,i) ) ) * 100 - at this point I believe you have the High 9 and Low 9 indicators.


Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Mon Aug 15, 2011 9:32 pm 
Offline

Joined: Sun Aug 14, 2011 8:43 pm
Posts: 4
Hi I tried the formula that you supplied me with, but it still doesn't work. However I did figure out what the problem is, but I don't know how to solve it.

When I write the “High 9” formula (highest high for last 9 periods) I use High [i] with the advanced highest and period 9. However this ends up giving me a value 1 and a value 2. Value 1 is the high for that bar, Value 2 is the high for 9 periods.

I do the same thing for the “Low 9” formula. So when I subtract “High 9” from “Low 9” I am trying to get the Highest high of the last 9 periods -the lowest low of the last 9 periods (so the value 2's)

Instead what I am getting is the high for that bar -the low for that bar (the value 1's).

I have tried rewriting the formula like this “High” (so no i) with the advanced formula highest period 9, but when I create the indicator it just gives me a blank indicator space on MT4.

How do I fix it so that I get the value 2's instead of the Value 1's?


Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Tue Aug 16, 2011 1:40 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Please post your indicators file .moi file "High 9" and "Low 9"


Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Tue Aug 16, 2011 5:13 pm 
Offline

Joined: Sun Aug 14, 2011 8:43 pm
Posts: 4
here are the indicators,


Attachments:
Low 9.moi [1.45 KiB]
Downloaded 393 times
High 9.moi [1.45 KiB]
Downloaded 413 times
High9MinusLow9.moi [1.56 KiB]
Downloaded 378 times
Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Thu Aug 18, 2011 8:14 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Please pay attention when you generate the indicators. In the screen it shows this:
//***Read this first: Integration with Molanis Strategy Builder***
/*To integrate this indicator with Molanis Strategy Builder use the following modes:
Mode 1 = Lowest of (Low[i]) with period 9;
*/
For the other indicator:
//***Read this first: Integration with Molanis Strategy Builder***
/*To integrate this indicator with Molanis Strategy Builder use the following modes:
Mode 1 = Higest of (High[i]) with period 9;
*/

It tells you when using the indicator use Mode 1 to get the signal, you are using Mode 0 so you are not getting the right signals. If you want to understand more about mt4 indicators, signals, modes and shift, read this:
viewtopic.php?f=3&t=162


Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Thu Aug 18, 2011 10:25 am 
Offline

Joined: Sun Aug 14, 2011 8:43 pm
Posts: 4
I don't have the strategy builder, only the indicator builder. Is there anyway that i can build this indicator and use it without strategy builder or will it only work with it?


Top
 Profile  
 
 Post subject: Re: Indicator Not Working
PostPosted: Thu Aug 18, 2011 11:18 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
The indicator builder will generate the indicator, you can use it in metatrader or import it in the strategy builder to create an expert advisor.
The indicator builder creates custom indicators, the strategy builder creates experta dvisors.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

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:  
Powered by Molanis © 2009