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
  #421 (permalink)  
Old 08-12-2008, 05:10 PM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Quote:
Originally Posted by ichanz View Post
Friends,

I have been learning to code MQL4 on the past few weeks, it's not easy I thought, but it's really worth to try ( hopefully will paid off soon )

Right now, I am stuck on coding for openning position of multiple currencies, since sendorder() function only knows symbol() for the running chart.
Please someone give me some sample on how to code that subject.

The Idea of my EA is to open position of several pairs on particular time ( ie. EURUSD, USDJPY at 4AM ).

Thanks before.
If you need open a position for a pair which is different than the chart you attach the EA, the Symbol() function must be replaced by the pairs you need (ie "EURUSD" "EURJPY" ... etc).

Dont forget to add the "m" or whatever is after the pair name if your broker add.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #422 (permalink)  
Old 08-17-2008, 07:09 PM
Junior Member
 
Join Date: Aug 2008
Posts: 7
takis76 is on a distinguished road
Red face How do I know I a new bar added

Hi ,

How could I calculate if some new bar added to my chart in any timeframe?

Thank you very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #423 (permalink)  
Old 08-17-2008, 09:18 PM
Senior Member
 
Join Date: Nov 2006
Posts: 215
luxinterior is on a distinguished road
This function will do the trick...

Code:
bool NewBar() {

	static datetime LastTime = 0;

	if (Time[0] != LastTime) {
		LastTime = Time[0];		
		return (true);
	} else
		return (false);
}
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
  #424 (permalink)  
Old 08-18-2008, 01:15 AM
Junior Member
 
Join Date: Aug 2008
Posts: 7
takis76 is on a distinguished road
Smile

Thank you very very much!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #425 (permalink)  
Old 08-19-2008, 03:16 AM
Junior Member
 
Join Date: Apr 2008
Posts: 3
icwalter is on a distinguished road
How to close open positions at Friday market close

How can I know when the market is say an hour from the Friday closing or right at market close? I use demo accounts with two different brokers and they are on different server times and I would like to code my EA to close all open positions before the Friday market close. This is just for testing puposes but it is something I would like to know regardless. I don't want to hard code a time due to the fact that different brokers use different server times. Is this possible? I know I can detect market opening but due to the gap behavior seen at times on market openings I would be more comfortable closing positions before the Friday market close.
Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #426 (permalink)  
Old 08-19-2008, 02:59 PM
Junior Member
 
Join Date: Aug 2008
Posts: 7
takis76 is on a distinguished road
Smile How to pass a variable from indicator to EA

Hi ,

Is any way to pass one indicator variable to an expert advisor?

For example if I have 2 moving averages and one cross the other or one is greater than other and store them in 2 variables in my indicator as MA1 and MA2.

Is it possible to call these variables to expert advisor?

Note: I don't want to put the code of Moving averages in the expert advisor , generally I want to take some variables from indicator and put in an expert advisor. (Something like read the variable from memory).


Thank you very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #427 (permalink)  
Old 08-21-2008, 03:00 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Quote:
Originally Posted by takis76 View Post
Hi ,

Is any way to pass one indicator variable to an expert advisor?

For example if I have 2 moving averages and one cross the other or one is greater than other and store them in 2 variables in my indicator as MA1 and MA2.

Is it possible to call these variables to expert advisor?

Note: I don't want to put the code of Moving averages in the expert advisor , generally I want to take some variables from indicator and put in an expert advisor. (Something like read the variable from memory).


Thank you very much.
You must use the iCustom() function in your EA to call the different indicator buffers.

Or for the standard indicators, use their standard functions. Example for MA: iMA(......);

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #428 (permalink)  
Old 08-27-2008, 02:10 PM
Junior Member
 
Join Date: Jul 2008
Posts: 6
TLBreak is on a distinguished road
How to remove text from Custom Indicators

Hi,

Just a quick question, does anyone know if there is a piece of code I can use so the text and values do not appear on the custom indicator window, as in the pic below.

thanks
Attached Images
File Type: jpg question.jpg (45.6 KB, 66 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #429 (permalink)  
Old 08-27-2008, 02:53 PM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 3,322
Blog Entries: 46
Linuxser has disabled reputation
Quote:
Originally Posted by TLBreak View Post
values do not appear on the custom indicator window, as in the pic below.
By giving a NULL value to the desired buffer: SetIndexLabel(X,NULL);
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #430 (permalink)  
Old 08-27-2008, 03:59 PM
Junior Member
 
Join Date: Jul 2008
Posts: 6
TLBreak is on a distinguished road
Thanks for your very fast reply, you have just made an old man very happy, and made my life at least 10 times easier
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 12:31 PM.



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