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 (1) Thread Tools Display Modes
  #361 (permalink)  
Old 09-17-2007, 01:14 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
There really is no need to use a custom indicator for this. Just use:

DayHigh = iHigh(NULL,Period_D1,x); // x being the days back
DayLow = iLow(NULL,Period_D1,x); // ditto
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #362 (permalink)  
Old 09-17-2007, 02:15 PM
1Dave7's Avatar
Member
 
Join Date: Aug 2007
Posts: 82
1Dave7 is on a distinguished road
Smile

Fantastic - You made my week!!!!!!!!!!! Thanks a Bunch!!!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #363 (permalink)  
Old 09-17-2007, 02:23 PM
1Dave7's Avatar
Member
 
Join Date: Aug 2007
Posts: 82
1Dave7 is on a distinguished road
Red face

Quote:
Originally Posted by omelette View Post
There really is no need to use a custom indicator for this. Just use:

DayHigh = iHigh(NULL,Period_D1,x); // x being the days back
DayLow = iLow(NULL,Period_D1,x); // ditto
Question my friend. How do I define Period_D1?

Meta editor is asking this. Period_D1=?? Figured out the answer -- Period_D1=1440;

Dave

Last edited by 1Dave7; 09-17-2007 at 02:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #364 (permalink)  
Old 09-17-2007, 02:38 PM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
@coz;

It sounds to me like you may be using the qoutes from one currency to set your entry prices on another. So if GBP hits 2.0500 and you place a EUR order with Ask and EUR is trading at 1.xxxx you are trying to get a price that is WAY off qoutes. What you have to do is get the proper quotes for different symbols using the MarketInfo() function.

double eur_ask=MarketInfo("EURUSD",MODE_ASK);

Quote:
Originally Posted by coz View Post
Hi all,

I'm new to MQL and I am trying to write a program that will open an order on two different pairs at one time. For example, when GBP/USD ask hits 2.0500, open a short on both GBP/USD and EUR/USD. I can only get the position to open correctly on the pair that has the EA attached to it. On the other pair I receive Error 129 (outdated prices). I have tried to use RefreshRates() and it doesn't seem to help, but I could be doing it wrong (I've read the documentation, but didn't get much from it). Can anyone point me to some information that can help me out or post some basic code to get this to work?

I posted this question over at MQL4.com and haven't gotten a response yet so I thought I would try the good group here. I'm sure there's something posted already on this but I just can't find it.

Thanks!
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #365 (permalink)  
Old 09-17-2007, 02:56 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
Quote:
Originally Posted by 1Dave7 View Post
Question my friend. How do I define Period_D1?

Meta editor is asking this. Period_D1=?? Figured out the answer -- Period_D1=1440;

Dave
You do not need to define Period_D1 - it is a pre-defined MT variable. Just typing 'Per...' will trigger MT's auto-menu. Just scroll up/down and you will see Period_M1, Period_M15 etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #366 (permalink)  
Old 09-17-2007, 11:50 PM
Junior Member
 
Join Date: Sep 2007
Posts: 2
turdusmerula is on a distinguished road
Question Line with multiple colors

Is it possible to draw an indicator with different colors?
I'd like to have my indicator red when greater than 0 and blue when under thus 0.

Thanxx by advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #367 (permalink)  
Old 09-18-2007, 07:38 AM
Dan7974's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 264
Dan7974 is on a distinguished road
Cool Background

Hey guys...
would someone PLEASE make an indicator that shows a picture of the background of a chart, instead of a regular color, but a picture with the price on it?

THAT WOULD BE SO COOL!!!
YOU WOULD EVEN MAKE YOURSELF RELAX MORE!!!

Thanks!!!

Dan.!!!
__________________
God Bless Everyone, and their trading logic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #368 (permalink)  
Old 09-18-2007, 10:14 AM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
That is really crazy.
What for? If you want some price model, you can simply attach all lines/figures on the chart and save as template.
If you just want a background picture... get a second monitor and watch a movie!
__________________
MQL4 programming is easy ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #369 (permalink)  
Old 09-20-2007, 08:29 PM
Junior Member
 
Join Date: Nov 2006
Posts: 26
Luke_P is on a distinguished road
For some reason this works for 1 indicator I have but does not work for two others. Is there an alternative way of doing this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #370 (permalink)  
Old 09-23-2007, 05:36 AM
Junior Member
 
Join Date: Sep 2007
Location: Canada
Posts: 3
Manxxx is on a distinguished road
Confused.

For some reason, For loops are being completely skipped in any EAs that I write. The documentation makes no mention of any kind of limitation on the loops and I'm really at a loss to understand it.

Is this a bug or are there some context rules that I havn't figured out yet?

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

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 07:24 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 12:29 PM.



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