Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2006, 02:05 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Cool High CCI

Hi all. I was recently experimenting with the highest function and the icci function. what i am intending to do is to find the highest point of the cci back about 6 bars, starting one bar back. it compiles perfectly, but the problem is that when i run it through the tester i get weird numbers, which should actually be in the hundreds. check it out!

2006.12.12 19:56:58 2004.01.12 11:06 Power Bit EA v1 EURUSD,Daily: CCI2 = 1.29

here's the string of code being used.

PHP Code:
       double CCI2 High[iHighest(NULL,0,iCCI(NULL,0,CCIPERIOD,MODE_CLOSE,0),6,1)];
  Print(
"CCI2 = ",CCI2); 
just so everyone knows, CCIPERIOD is an integer i assigned to 14 in my global variables.
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-14-2006, 02:00 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
any coders out there have an answer to this problem???
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-14-2006, 02:21 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Value is fine. Description of iHighest http://docs.mql4.com/series/iHighest
'iHighest' returns highest BAR and 'High' its value.
iCCI has nothing to do with iHighest

if you want highest iCCI you need a loop, looping from starting bar util the end

Last edited by asmdev; 12-14-2006 at 02:24 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-14-2006, 02:23 AM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
I believe you have to use iCCIOnArray as iHighest works on arrays.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-14-2006, 02:24 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Quote:
Originally Posted by asmdev
Value is fine. Description of iHighest http://docs.mql4.com/series/iHighest
'iHighest' returns highest bar and 'High' its value.
iCCI has nothing to do with iHighest
ok. that's been one thorn of confusion in my side, with the whole, "Returns shift". which i've kinda guessed how to figure out.

do you happen to know a way i can return the highest point of a cci?
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-14-2006, 02:25 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Quote:
Originally Posted by Maji
I believe you have to use iCCIOnArray as iHighest works on arrays.
Thanks for the reply. I appreciate your input everyone.

so your saying something like this?

PHP Code:
High[iCCI(NULL,0,CCIPERIOD,MODE_CLOSE,5)]; 
and that will give me the highEST point back 5 bars
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-14-2006, 02:31 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Quote:
Originally Posted by asmdev
if you want highest iCCI you need a loop, looping from starting bar util the end
Thanks for the speedy replies everyone.

so in other words, i have to create a custom array?

boy oh boy. looks like no matter how hard i try, i have to use an array at least somewhere. (a friend of mine loves arrays but they take too long for me to program sometimes)
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-14-2006, 03:42 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by Eaglehawk
find the highest point of the cci back about 6 bars, starting one bar back
double maxVal = -99999;
for(int i=0; i>=5; i++) maxVal = MathMax(maxVal, iCCi(NULL,0,CCIPERIOD,MODE_CLOSE,i) );

//maxVal is your highest cci value at the end of loop.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-14-2006, 03:46 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
double maxVal = -99999;
int bar = 0;
for(int i=0; i>=5; i++){
double cci = iCCi(NULL,0,CCIPERIOD,MODE_CLOSE,i) ;
if(cci > maxVal){
bar = i;
maxVal = cci;
}
}

"bar" is the bar where cci is max and maxVal is your highest cci at the "bar".

I never used iCCIOnArray but you can give it a try. You'll need to define array somewhere.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-14-2006, 03:47 AM
Eaglehawk's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 141
Eaglehawk is on a distinguished road
Quote:
Originally Posted by asmdev
double maxVal = -99999;
for(int i=0; i>=5; i++) maxVal = MathMax(maxVal, iCCi(NULL,0,CCIPERIOD,MODE_CLOSE,i) );

//maxVal is your highest cci value at the end of loop.
wow! let me tell you. with so many people pointing me back to a "math" function like mathmod, mathmax, i think that should be my next area of study, lol.

Thanks for your assistance, it's nice to learn new functions like this. every once in a while, several problems wash away from one answer. I LOVE IT!
__________________
"One's ability to accomplish his or her goals is limited only by the ingenuity of how one uses what he or she already knows."- Eaglehawk
REMEMBER,
"Genius is nothing but a greater aptitude for patience." –Benjamin Franklin

____________________________________

Have a simple ea you just can't figure out how to code??? Odds are you can make it here. Just remember to push complete when you're done, NOT SAVE!!!

http://sufx.core.t3-ism.net/ExpertAdvisorBuilder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Martingale and other high risk high reward systems TraderGeek General Discussion 15 05-03-2007 05:59 AM
High-High/Low-Low indicator trevman Indicators - Metatrader 4 5 01-07-2007 04:39 AM
High/Low value? benitohau Questions 1 09-16-2006 07:04 PM
Function for high and low maje Setup Questions 3 05-16-2006 12:23 PM
High/Low EA forexpipmaster Metatrader 4 1 02-12-2006 07:37 AM


All times are GMT. The time now is 01:24 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.