Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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
  #581 (permalink)  
Old 05-07-2007, 08:18 PM
MaanOO MaanOO is offline
Junior Member
 
Join Date: Apr 2007
Posts: 6
MaanOO is on a distinguished road
I need a script that compare between two prices and finds which one is higher.

for example:
Code:
int a1, a2;

a1=1.1111;
a2=1.1112;

if(a1<a2)
{
   Print("OK");
}
but this does not , coz the comparing is only for the numbers before the point.

I need to compare the full number with the decimal number.

I hope you understand what I mean, and help me.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #582 (permalink)  
Old 05-07-2007, 09:31 PM
asmdev asmdev is offline
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
replace 'int" with "double" like so
double a1, a2;
read documentation about types.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #583 (permalink)  
Old 05-08-2007, 06:41 AM
MaanOO MaanOO is offline
Junior Member
 
Join Date: Apr 2007
Posts: 6
MaanOO is on a distinguished road
Ohhh I forgot about it.

Thank you very much for your help ..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #584 (permalink)  
Old 05-08-2007, 07:31 AM
MaanOO MaanOO is offline
Junior Member
 
Join Date: Apr 2007
Posts: 6
MaanOO is on a distinguished road
Why this returns 0.

Code:
iMA(NULL,0,10,-3,MODE_EMA,PRICE_HIGH,1);
Thanks.

Last edited by MaanOO : 05-08-2007 at 10:21 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #585 (permalink)  
Old 05-10-2007, 02:53 PM
erkao erkao is offline
Junior Member
 
Join Date: Dec 2006
Posts: 1
erkao is on a distinguished road
How to force the start() function to run

Hello,

In an EA, the start() function will be run only if the pair price of attached chart change.
I'd like to know whether it can be run without waiting the price change.

Thanks in advance.

-erkao
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #586 (permalink)  
Old 05-10-2007, 08:49 PM
MaanOO MaanOO is offline
Junior Member
 
Join Date: Apr 2007
Posts: 6
MaanOO is on a distinguished road
If you want it to run once.

you can use the init() function which runs at program start.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #587 (permalink)  
Old 05-10-2007, 08:55 PM
codersguru's Avatar
codersguru codersguru is offline
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 erkao
Hello,

In an EA, the start() function will be run only if the pair price of attached chart change.
I'd like to know whether it can be run without waiting the price change.

Thanks in advance.

-erkao
NO! the start() function will be run only every time tick data arrived.
__________________
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
  #588 (permalink)  
Old 05-10-2007, 09:01 PM
codersguru's Avatar
codersguru codersguru is offline
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 MaanOO
Why this returns 0.

Code:
iMA(NULL,0,10,-3,MODE_EMA,PRICE_HIGH,1);
Thanks.
Because by this code you want to get 2 bars into the future.
-3 +1 = -2 (-2 means two bars into the future).
__________________
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
  #589 (permalink)  
Old 05-13-2007, 04:28 PM
kidhudi kidhudi is offline
Member
 
Join Date: Jan 2006
Posts: 64
kidhudi is on a distinguished road
hi Coders' Guru i was wonering if you could help me. i have this indicator that exports intraday data into eod data format. the only thing is it has a "date","time","open","high","low","close". and the program i want to use it for uses yahoo csv file format (date,open,high,low,close), i tried everything to remove the "time" column but i can't figure it out. if you could take a look at it and help me out i would really apprecciate it. also the program i want to use(refined eliot trader) is weird. it can tell the differance between a regular .csv file and a .csv file downloaded from yahoo ( probably because the date in the yahoo file is YYYY-MM-DD format and the indicator is in YYYMMDD format. but that isn't a big problem if i just delete all the files and only have one file at a time. if you have time please take a look at it for me.. thanks so much

DID IT.... thanks anyway guys
Attached Files
File Type: mq4 AGData.mq4 (4.9 KB, 14 views)

Last edited by kidhudi : 05-15-2007 at 02:27 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #590 (permalink)  
Old 05-14-2007, 11:13 AM
phoenix's Avatar
phoenix phoenix is offline
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
How to define the higher high, higher low, lower high and lower low?

Pls anyone know how to define higher high, higher low, lower high and lower low please reply


thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
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 01:37 PM.