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
  #501 (permalink)  
Old 02-23-2007, 01:43 PM
pawang pawang is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
pawang is on a distinguished road
Angry HELP!!! IF (A>B) AND (|X| <1) AND (Y<Z) then..

Hi
I am so sorry if my question is very basic.
I am learing mql4.
Please help me how to express this math conditions in mql4:
IF( (A>B) AND (|X| <1) AND (Y<Z) ) then.. ... ... ...
|X| is absoulute; it means (X < -1) OR (X> 1)

I got messege from MetaEditor
" IF EXPRESSION IS TOO COMPLEX"
After many times trying,... I have no more Idea..So please tell me how to..
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #502 (permalink)  
Old 02-23-2007, 03:22 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,436
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by pawang
Hi
I am so sorry if my question is very basic.
I am learing mql4.
Please help me how to express this math conditions in mql4:
IF( (A>B) AND (|X| <1) AND (Y<Z) ) then.. ... ... ...
|X| is absoulute; it means (X < -1) OR (X> 1)

I got messege from MetaEditor
" IF EXPRESSION IS TOO COMPLEX"
After many times trying,... I have no more Idea..So please tell me how to..
Thanks
I am not a coder.
I studied Codersguru lessons together with everybody: it was one time when Codersguru was posting his lessons live (in real time) on this forum and many people (together with me) studied this lessons.

I remember that && is and.
|| is or.
And be cafully with ;, { and } and ( and ).
Also be cafuly with the point and number (just a number - 70,or 100, 0r -100, or 30, or whatever) because it should be coded in different way (don't remember now sorry).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #503 (permalink)  
Old 02-23-2007, 04:01 PM
Kalenzo's Avatar
Kalenzo Kalenzo is offline
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 692
Kalenzo is on a distinguished road
Quote:
Originally Posted by pawang
Hi
I am so sorry if my question is very basic.
I am learing mql4.
Please help me how to express this math conditions in mql4:
IF( (A>B) AND (|X| <1) AND (Y<Z) ) then.. ... ... ...
|X| is absoulute; it means (X < -1) OR (X> 1)

I got messege from MetaEditor
" IF EXPRESSION IS TOO COMPLEX"
After many times trying,... I have no more Idea..So please tell me how to..
Thanks
Try this:


if((a>b && MathAbs(x)<1) && y<z)
{
//write here what should happen
}
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #504 (permalink)  
Old 02-23-2007, 07:09 PM
Kurka Fund's Avatar
Kurka Fund Kurka Fund is offline
Senior Member
 
Join Date: Sep 2006
Location: San Diego
Posts: 139
Kurka Fund is on a distinguished road
Question for the oracle...

Is there anyway to make your EA run an Optimization and automatically adjust the settings everyday.

I would like to run a 30 day profit factor optimization for 16 parameters. and have it just apply the settings before the it starts trading again. It shuts down automatically everyday for about 8 hours. this would be a perfect time to run it...

anyone know how to code it... It would bring it from the Great EA level to the Insanley profitable AI level...

This could also be good code for everyone to use in there EA's markets adjust constantally why shouldent our EA's get smarter.

I also posted this in the EA fourm, dident know about this one until now..

Thanks for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #505 (permalink)  
Old 02-23-2007, 08:53 PM
dxx dxx is offline
Junior Member
 
Join Date: Apr 2006
Posts: 14
dxx is on a distinguished road
advice please

Is it possible to create bar indicators in separate windows like the indicator in the pic i have posted [dont know what they are officially called] for say a red bar if the MACD crosses negative and stays red if in negative zones and green if crosses positive etc etc. Also is it possible to create the same bar indicator windows for say if the price goes below a moving average.

if this seems a daft question please bear with me. When i look at indicators on a chart i tend to try and anticipate what the price will do so im looking to try and have separate window indicators which when all show the same colour i will trade. [Psychology reasons]. Is the creation of these separate bar type indicators something i could learn to create , im far from a programmer in any language.

any advice would be greatly appreciated.

dh
Attached Images
File Type: jpg chart.JPG (10.6 KB, 240 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #506 (permalink)  
Old 02-23-2007, 10:09 PM
asmdev asmdev is offline
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by pawang
Hi
I am so sorry if my question is very basic.
I am learing mql4.
Please help me how to express this math conditions in mql4:
IF( (A>B) AND (|X| <1) AND (Y<Z) ) then.. ... ... ...
|X| is absoulute; it means (X < -1) OR (X> 1)

I got messege from MetaEditor
" IF EXPRESSION IS TOO COMPLEX"
After many times trying,... I have no more Idea..So please tell me how to..
Thanks
if(a>b && (x < -1 || x > 1) && y<z){
;your code
}
or maybe x == 0 instead of (x < -1 || x > 1) because only way MathAbs(x) < 1 is true when x=0
http://docs.mql4.com/basis/operations/bool

on the other thought maybe you simply need this:
if(a>b && x<1 && y<z)

or this
if(a>b && x<-1 && y<z)
since x is never 0 or -1 according to your definition

I am confused by your definition of absolute value

Last edited by asmdev : 02-23-2007 at 10:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #507 (permalink)  
Old 02-24-2007, 12:16 AM
MiniMe's Avatar
MiniMe MiniMe is offline
Senior Member
 
Join Date: Nov 2006
Location: Montréal
Posts: 1,047
MiniMe is on a distinguished road
Quote:
Originally Posted by dxx
Is it possible to create bar indicators in separate windows like the indicator in the pic i have posted [dont know what they are officially called] for say a red bar if the MACD crosses negative and stays red if in negative zones and green if crosses positive etc etc. Also is it possible to create the same bar indicator windows for say if the price goes below a moving average.

if this seems a daft question please bear with me. When i look at indicators on a chart i tend to try and anticipate what the price will do so im looking to try and have separate window indicators which when all show the same colour i will trade. [Psychology reasons]. Is the creation of these separate bar type indicators something i could learn to create , im far from a programmer in any language.

any advice would be greatly appreciated.

dh
I am not sure if this will answer your question but, try it
Just put the indicators on top of each other on the chart , I mean add it more than once and change the setting and you will have what you want I hope
Attached Files
File Type: mq4 Super8_Filter.mq4 (4.2 KB, 45 views)
File Type: mq4 WPRfast.mq4 (2.1 KB, 33 views)
File Type: mq4 WPRslow.mq4 (2.1 KB, 32 views)

Last edited by MiniMe : 02-24-2007 at 12:18 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #508 (permalink)  
Old 02-24-2007, 05:38 AM
Kalenzo's Avatar
Kalenzo Kalenzo is offline
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 692
Kalenzo is on a distinguished road
Quote:
Originally Posted by dxx
Is it possible to create bar indicators in separate windows like the indicator in the pic i have posted [dont know what they are officially called] for say a red bar if the MACD crosses negative and stays red if in negative zones and green if crosses positive etc etc. Also is it possible to create the same bar indicator windows for say if the price goes below a moving average.

if this seems a daft question please bear with me. When i look at indicators on a chart i tend to try and anticipate what the price will do so im looking to try and have separate window indicators which when all show the same colour i will trade. [Psychology reasons]. Is the creation of these separate bar type indicators something i could learn to create , im far from a programmer in any language.

any advice would be greatly appreciated.

dh
Yes, this is possible.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #509 (permalink)  
Old 02-24-2007, 05:50 AM
increase's Avatar
increase increase is online now
Senior Member
 
Join Date: May 2006
Posts: 605
increase is on a distinguished road
Quote:
Originally Posted by dxx
Is it possible to create bar indicators in separate windows like the indicator in the pic i have posted [dont know what they are officially called] for say a red bar if the MACD crosses negative and stays red if in negative zones and green if crosses positive etc etc. Also is it possible to create the same bar indicator windows for say if the price goes below a moving average.

if this seems a daft question please bear with me. When i look at indicators on a chart i tend to try and anticipate what the price will do so im looking to try and have separate window indicators which when all show the same colour i will trade. [Psychology reasons]. Is the creation of these separate bar type indicators something i could learn to create , im far from a programmer in any language.

any advice would be greatly appreciated.

dh

Here you are exactly what you want, load all 4 of the same indicator on one chart all with different settings as shown below, when all red sell, when all blue buy.
settings
set first for 15 minutes
second 30 mins
third 60 mins
forth 140 mins
Attached Files
File Type: mq4 FlatTrend w MACD.mq4 (3.3 KB, 65 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #510 (permalink)  
Old 02-24-2007, 10:28 AM
dxx dxx is offline
Junior Member
 
Join Date: Apr 2006
Posts: 14
dxx is on a distinguished road
thanks

Guys, thanks i will explore the posted indicators#

very appreciated
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:16 PM.