Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (2) Thread Tools Display Modes
  #181 (permalink)  
Old 07-17-2006, 01:57 AM
Junior Member
 
Join Date: Jun 2006
Posts: 23
DaytrSuccess is on a distinguished road
Thank you Yannis

Quote:
Originally Posted by Yannis
DayTrSuccess,
this should get you started:

.......................

}
Thank you. I'll use it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #182 (permalink)  
Old 07-19-2006, 03:32 AM
Junior Member
 
Join Date: May 2006
Posts: 20
witchazel is on a distinguished road
Quote:
Originally Posted by Yannis
Ask and Bid is the current price at which you can buy or sell (always the latest tick). The only “historical” values you can retrieve for price is Open / High (so far) / Low (so far) for current bar, “so far” meaning that until the bar closes these values might change, and High/Low/Open/Close of any previous bar on any time frame.

Yannis
thanks for the help

if i use close[1] will it give me the close of the last change? or will it give me the close of the last unit of time i have set based on my chart time frame?

and if that is true is there a way to say give me the last close in a 1 minute timeframe?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #183 (permalink)  
Old 07-19-2006, 05:12 AM
Member
 
Join Date: Sep 2005
Location: Athens
Posts: 69
Yannis is on a distinguished road
witchazel,
I don't understand what do you mean with "will it give me the close of the last change?". Open/High/Low/Close concerns price bars. So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on. You can use iClose(NULL,0,Shift) (iOpen/iHigh/iLow) to get these values on time frame other than the one you're on. "0" stands for "current" time frame and "shift" for the bars back. Replace "0" with the time frame you need (1,5,15,30,60,240....) and shift with the number of bars back, you can even replace "NULL" to "GBPUSD" if your current chart is EURUSD but you need to address GBP previous close.
iClose(NULL,1,1) will give the close of your current pair, on 1 min chart, 1 bar back.
I would consider spending some time reading the threads addressing MT4 coding, i think CodesGuru has an excellent one for new coders, as well as Metaeditor help file and free experts and indicators posted allover the place.
Yannis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #184 (permalink)  
Old 07-19-2006, 10:19 PM
Junior Member
 
Join Date: May 2006
Posts: 20
witchazel is on a distinguished road
Wink

Quote:
Originally Posted by Yannis
witchazel,
I don't understand what do you mean with "will it give me the close of the last change?". Open/High/Low/Close concerns price bars. So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on. You can use iClose(NULL,0,Shift) (iOpen/iHigh/iLow) to get these values on time frame other than the one you're on. "0" stands for "current" time frame and "shift" for the bars back. Replace "0" with the time frame you need (1,5,15,30,60,240....) and shift with the number of bars back, you can even replace "NULL" to "GBPUSD" if your current chart is EURUSD but you need to address GBP previous close.
iClose(NULL,1,1) will give the close of your current pair, on 1 min chart, 1 bar back.
I would consider spending some time reading the threads addressing MT4 coding, i think CodesGuru has an excellent one for new coders, as well as Metaeditor help file and free experts and indicators posted allover the place.
Yannis
thanks i think i can do it now. what i am trying to do is open an order when the price crosses a custom indicator line. I am working on the daily chart but i want it to happen as soon as the price crossess the line. Seems like it should be easier then what i am doing, maybe i am taking the wrong approach.

thank you so much for all your help though, the mql language is easy but the functions are weird and some the ways they do stuff seem backwards hehe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #185 (permalink)  
Old 07-21-2006, 07:56 AM
Junior Member
 
Join Date: Jul 2006
Posts: 28
AbuseYou is on a distinguished road
Anyone, please help me to write this Metatrader 4 Program.

"Zhangge's Trend Double Principle"
Here is the basic rules

Looking to long,
1) A bullish candle "F" must close higher and at the same time break the long term(minimum 5 bars) resistance line as shown in figure 1 below
2) After candle "F" or at the same time, wait for a candle close above the openning price of previous 2 bearish candle. Like Figure 2.
3) If rule #2 fulfilled, then we go long at the close of that particular candle that has just fulfilled rule #2. like figure 3.
4) place a stop loss order at the lower end of the lowest bearish candle. As shown in Figure 3.
5) determine the height of "ab" as shown in figure 3.
6) place a limit order(to take profit) at the (entry price + height of "ab") marked "C" as shown in figure 4.

Looking to short,
ALL the mechanics and logic is just the inversed.

Thanks!!!
Attached Images
File Type: jpg 1.JPG (55.7 KB, 121 views)
File Type: jpg 2.JPG (61.1 KB, 106 views)
File Type: jpg 3.JPG (68.2 KB, 113 views)
File Type: jpg 4.JPG (66.4 KB, 106 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #186 (permalink)  
Old 07-21-2006, 08:54 AM
increase's Avatar
Senior Member
 
Join Date: May 2006
Posts: 612
increase is on a distinguished road
I want to play a different sound for an alert and I only see one sound available, I placed a playsound before my alert but it does not really work, besides that gives me 2 sounds, is there any way to play different sounds and still pop up an alert box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #187 (permalink)  
Old 07-23-2006, 01:32 PM
Senior Member
 
Join Date: Oct 2005
Posts: 284
Bongo is on a distinguished road
Quote:
Originally Posted by Yannis
witchazel,
I don't understand what do you mean with "will it give me the close of the last change?". Open/High/Low/Close concerns price bars. So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on. You can use iClose(NULL,0,Shift) (iOpen/iHigh/iLow) to get these values on time frame other than the one you're on. "0" stands for "current" time frame and "shift" for the bars back. Replace "0" with the time frame you need (1,5,15,30,60,240....) and shift with the number of bars back, you can even replace "NULL" to "GBPUSD" if your current chart is EURUSD but you need to address GBP previous close.
iClose(NULL,1,1) will give the close of your current pair, on 1 min chart, 1 bar back.
I would consider spending some time reading the threads addressing MT4 coding, i think CodesGuru has an excellent one for new coders, as well as Metaeditor help file and free experts and indicators posted allover the place.
Yannis
So yes, Close[1] will give you the close for previous bar on the time frame your chart is currently on.

I thing that we counting bars like that:
Open[0] = current
Open[1] = last
Open[2] = previous
Open[3] = third from current bar.
I'm right?
Bongo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #188 (permalink)  
Old 07-24-2006, 10:20 AM
Member
 
Join Date: Mar 2006
Posts: 33
dr_richard_gaines is on a distinguished road
Indicator into Expert

Quote:
Originally Posted by codersguru
Hi folks,

I've got a lot of private messages asking me for helping with some pieces of code.

Here you can post your questions related to MQL4, and I'll do my best to answer them.
Hi

Can you guys go over how to make a indicator into a expert by embedding the code into the expert not iCustom or calls but as a function. For example Heiken ashi into the MACD Sample or your EMA Cross 2 or 3?

Thanks
Doc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #189 (permalink)  
Old 07-24-2006, 11:33 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
Originally Posted by dr_richard_gaines
Hi

Can you guys go over how to make a indicator into a expert by embedding the code into the expert not iCustom or calls but as a function. For example Heiken ashi into the MACD Sample or your EMA Cross 2 or 3?

Thanks
Doc
There's an article about this here:
http://www.metatrader.info/node/137
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #190 (permalink)  
Old 07-24-2006, 12:03 PM
Member
 
Join Date: Mar 2006
Posts: 33
dr_richard_gaines is on a distinguished road
Indicator into Experts

Quote:
Originally Posted by codersguru
There's an article about this here:
http://www.metatrader.info/node/137
Hi Codeguru,

Thank you very much for your most unselfish sharing of your great knowledge and abilities.

What about multiple indicators lets say

bollinger bands
keltner channels
bbsqueeze
heiken ashi

Thanking you in advance.
Dr Richard Gaines
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 On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 09:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 11:46 AM


All times are GMT. The time now is 12:17 AM.



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