help needed with code
  #1 (permalink)  
Old 08-23-2008, 12:46 AM
Freshman
 
Join Date: May 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
denexer is on a distinguished road
Default help needed with code

i need help with the following code at the moment it only opens a order if AC is above or below zero and i want it to open if red changes to green and visa verser

double AC1 = iAC(NULL, 0, Current + 0);
double AC2 = iAC(NULL, 0, Current + 1);

if ((AC1 < AC2)) Order = SIGNAL_CLOSEBUY;

Last edited by denexer : 08-23-2008 at 12:52 AM.
Reply With Quote
  #2 (permalink)  
Old 08-25-2008, 01:45 PM
Forex Warrior
 
Join Date: Feb 2007
Posts: 261
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by denexer View Post
i need help with the following code at the moment it only opens a order if AC is above or below zero and i want it to open if red changes to green and visa verser

double AC1 = iAC(NULL, 0, Current + 0);
double AC2 = iAC(NULL, 0, Current + 1);

if ((AC1 < AC2)) Order = SIGNAL_CLOSEBUY;
If you want avoid the current bar repainting:

Quote:
double AC1 = iAC(NULL, 0, 1);
double AC2 = iAC(NULL, 0, 2);

if(AC1 > AC2) --> Exit Short and Entry Long
if(AC1 < AC2) --> Exit Long and Entry Short
Hope that helps.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor
developed by Spiritfriends and coded by FerruFx ... more info
Reply With Quote
  #3 (permalink)  
Old 08-26-2008, 02:43 AM
Freshman
 
Join Date: May 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
denexer is on a distinguished road
Default

no i want to change to use the colors not not wether its above or below zero
i think i am on the right track now, but when i compile it i get error ACRed variable not defined :this is the code
double ACGreen = iAC(NULL, 0, Current + 0);
double ACRed = iAC(NULL, 0, Current + 1);
i see any difference between the green and the red, can somebody help me
Reply With Quote
  #4 (permalink)  
Old 08-27-2008, 03:29 PM
Forex Warrior
 
Join Date: Feb 2007
Posts: 261
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by denexer View Post
no i want to change to use the colors not not wether its above or below zero
i think i am on the right track now, but when i compile it i get error ACRed variable not defined :this is the code
double ACGreen = iAC(NULL, 0, Current + 0);
double ACRed = iAC(NULL, 0, Current + 1);
i see any difference between the green and the red, can somebody help me
The code I posted is for color change.

Look at your chart and you will see that when histo start to increase, it change red to green ... when it start to decrease, it change green to red.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor
developed by Spiritfriends and coded by FerruFx ... more info
Reply With Quote
  #5 (permalink)  
Old 08-27-2008, 11:49 PM
Freshman
 
Join Date: May 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
denexer is on a distinguished road
Default

FerruFX
I would like to thank you for the help you are giving me, it seems i did not explain what i mean't very well, the color can change from red to green but its still under the 50 line what i need is when the color changes from red to green i want the green to be above the above the 50 line and below when it changes back to red,so its not the ea i should be looking at but changing the indicator, could you tell me how i do that.
Reply With Quote
  #6 (permalink)  
Old 08-28-2008, 02:47 AM
Forex Warrior
 
Join Date: Feb 2007
Posts: 261
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by denexer View Post
FerruFX
I would like to thank you for the help you are giving me, it seems i did not explain what i mean't very well, the color can change from red to green but its still under the 50 line what i need is when the color changes from red to green i want the green to be above the above the 50 line and below when it changes back to red,so its not the ea i should be looking at but changing the indicator, could you tell me how i do that.
I think you mean 0 line not 50 line.

Attached the version I just modified.

FerruFx
Attached Files
File Type: mq4 Accelerator_modified.mq4 (3.2 KB, 5 views)
Sponsored Links EA Shark - Automated System
We Turned $9,100 Into $109,606
Since January 2007. See Real Records
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor
developed by Spiritfriends and coded by FerruFx ... more info
Reply With Quote
  #7 (permalink)  
Old 10-30-2008, 12:17 AM
therumpledone's Avatar
Senior
 
Join Date: Jun 2007
Posts: 144
Thanks: 0
Thanked 4 Times in 4 Posts
therumpledone is on a distinguished road
Default



I think you wanted to know when the direction changed, as well as, when the price crossed the 0 line.

ACCELERATOR indicator, including source code, attached.
Attached Files
File Type: zip Accelerator_TRO_Mod.zip (4.3 KB, 2 views)
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Metatrader code work needed agrosso122 MetaTrader and ZeroCode 5 05-12-2007 08:28 PM
EA needed renasdad MetaTrader and ZeroCode 8 03-22-2007 11:01 PM
Trend strategy EA code needed discomania Trading Systems 0 01-16-2006 10:14 AM


All times are GMT. The time now is 08:04 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now