Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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
  #431 (permalink)  
Old 09-02-2008, 12:14 AM
Senior Member
 
Join Date: Sep 2007
Posts: 310
jturns23 is on a distinguished road
EA question

I'm writing an EA. I have a couple indicators I want to use that I would like to trade if they change colors. For instance, if the indicator is green, buy. If the indicator is yellow, sell. Any help would be appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #432 (permalink)  
Old 09-02-2008, 12:29 AM
Senior Member
 
Join Date: Oct 2007
Posts: 224
Dave137 is on a distinguished road
Smile

Use iCustom statement such as:

Note: PM1 or PM2 is variable name - can be changed.

int BuyValue=0, SellValue=0;

PHP Code:
  PM1=iCustom(NULL,60,"SSL_fast_mtf",0,0);// "SSL . . " is name of custom indicator file name - Buffer 0.
  
PM1_1=iCustom(NULL,60,"SSL_fast_mtf",0,1);//Buffer 0, 1-Back. 
PHP Code:
  PM2=iCustom(NULL,60,"SSL_fast_mtf",1,0);//Buffer 1.
  
PM2_1=iCustom(NULL,60,"SSL_fast_mtf",1,1);//Buffer 1, 1-Back. 
Then logic statement:

if(PM1>PM2 && PM1_1<PM2_1) {

BuyValue=1;

}

if(PM1<PM2 && PM1_1>PM2_1){

SellValue=1;

}

When Buy or Sell Value=1, then Buy or Sell Statement to open ticket.

Dave

P.S. Up is normally Buffer 0, Dwn is normally Buffer 1!

Last edited by Dave137; 09-02-2008 at 12:39 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #433 (permalink)  
Old 09-02-2008, 02:15 AM
Senior Member
 
Join Date: Sep 2007
Posts: 310
jturns23 is on a distinguished road
Perfect. Thanks for your help Dave!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #434 (permalink)  
Old 09-03-2008, 03:32 AM
Senior Member
 
Join Date: Sep 2007
Posts: 310
jturns23 is on a distinguished road
Ok, I've been trying to get my EA to work. I just want it to trade when the indicator changes from one color to another. I don't think it should be that hard but I make everything difficult. Does anyone have a simple EA that trades based on only one indicator changing color? For an example, so I can see how horrible my programming skills really are.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #435 (permalink)  
Old 09-11-2008, 04:13 AM
MANSTIR's Avatar
Senior Member
 
Join Date: Nov 2007
Posts: 143
MANSTIR is on a distinguished road
Hi, what is code alert (sound ) for indicator 4 timeframe Bar....?

anyone?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #436 (permalink)  
Old 09-11-2008, 05:18 PM
Junior Member
 
Join Date: Sep 2008
Posts: 2
mdd1169 is on a distinguished road
Looking for someone who could write mt4 code

hello, I know nothing about codes but was curious to know if it would be possible to write a code using info from a stoc and a cci on a 5 and 15 min time frame and when they line up for some type of alert go off. IS this possible, and does anyone know anyone who could do it?

please advise.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #437 (permalink)  
Old 09-11-2008, 05:48 PM
Junior Member
 
Join Date: Aug 2008
Posts: 5
xerof123 is on a distinguished road
Please can someone explain to me how can I get rid of an "OrderModify error 1" problem. I been looking and it seams I need to NormalizeDouble(), but I've normalized everything from here to the moon and still I'm getting the error.

Once I understand it I think I'll be able to figure it out, please can someone help. thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #438 (permalink)  
Old 09-13-2008, 08:30 AM
Junior Member
 
Join Date: Sep 2008
Posts: 4
kk81 is on a distinguished road
How to combine 2 indicators

Hi guru & friends....

I want to create EA...Can u guys help me how to combine 2 indicators..izit possible?

TQ....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #439 (permalink)  
Old 09-13-2008, 09:05 AM
Senior Member
 
Join Date: Nov 2006
Posts: 215
luxinterior is on a distinguished road
Take a look in the MQLEditor help file at the icustom function and/or do a search here for it.

Good luck

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #440 (permalink)  
Old 09-17-2008, 01:12 PM
Junior Member
 
Join Date: Sep 2008
Posts: 1
laranjaquadrada is on a distinguished road
Arrow HLP CLOSE Order When Profit reach some value Command.

Hi,

I'm building/modfying some EAS.

What is the comand that I need to use to CLOSE some BUY or SELL Order if my Profit reaches some value.

Lets say I want to Close every order that reaches the PROFIT = +30.00


How Can I do that??


thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4, learning mql4

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
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 07:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 09:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 06:29 PM


All times are GMT. The time now is 08:43 AM.



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