Forex
Google
New signals service!

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


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
  #11 (permalink)  
Old 10-31-2005, 11:31 AM
forexts's Avatar
Administrator
 
Join Date: Sep 2005
Posts: 291
forexts has disabled reputation
Quote:
Originally Posted by newdigital
It is arithmetical operations but it is logic.
In arithmetic if
A + B so it should be C already.
It should not be the same A (the same value).

Because if we are increasing A on B assigning the result to A so
A will be increasing on B all the time. Every second A will be increasing on B without any stopping. It means A plus B is equal A (the same A?) so plus B once again (because of A plus B) is equal A (an other A) which should be added to B and so on.

May be during the coding everything will be clear.

But I have a question.
In Relational operators A == Bi;
It means true if A equal B else false.

Is it necessary to have i after B?
"A" is only the variable where we store value.

A = A + B; means that we want to modify the value stored in A ... with a new value (A+B).

Of course after executing that struction ... A will have new value.

Quote:
if(A == B)
{
....
}
i After B is not needed and would be an error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 10-31-2005, 05:36 PM
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
Arrow Assignment addition!

Quote:
Originally Posted by newdigital
It is arithmetical operations but it is logic.
In arithmetic if
A + B so it should be C already.
It should not be the same A (the same value).

Because if we are increasing A on B assigning the result to A so
A will be increasing on B all the time. Every second A will be increasing on B without any stopping. It means A plus B is equal A (the same A?) so plus B once again (because of A plus B) is equal A (an other A) which should be added to B and so on.

May be during the coding everything will be clear.
I'll give you an example and I hope it will make it clearer:

You have in your pocket 10$ ok?

int your_pocket = 10;

Then I gave you 5$ ok?

int i_gave = 5;


You putted the 5$ which I gave to you in your pocket, How much in your pocket now and how to collect them?

your_pocket(now) = your_pocket(before I gave you the 5$) + i_gave (5$ which I gave them to you)

your_pcoket=your_pocket+i_gave; //which is 15$

You can write the above expression like this:

your_pocket+=i_gave; //which is 15$

So, the purpose of this operator is to increase your_pocket with the amount i_gave you and assign them again to your_pocket(or update your_pocket or put them back to your_pocket).

Is it clearer now?

Now, I want my 5$ back



Quote:
Originally Posted by newdigital
But I have a question.
In Relational operators A == Bi;
It means true if A equal B else false.

Is it necessary to have i after B?
Where did you come with the i? was it in the lesson? If yes it was a keyboard mistake and I'll update it.

A == B; means:
You asking MQL4 is A equal to B and MQL4 has to answer you with True or False (yes or no).
__________________
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
  #13 (permalink)  
Old 11-01-2005, 08:36 AM
Junior Member
 
Join Date: Oct 2005
Posts: 1
razib2006 is on a distinguished road
I was looking for a place to learn Meta trader 4 language. Finally........................thanks a lot................thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 11-02-2005, 12:04 PM
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
Wink You're Welcome!

Quote:
Originally Posted by razib2006
I was looking for a place to learn Meta trader 4 language. Finally........................thanks a lot................thanks again.
You're Welcome!

I hope you enjoy them
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm

Last edited by codersguru; 11-02-2005 at 12:06 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 11-27-2005, 04:28 PM
Junior Member
 
Join Date: Nov 2005
Posts: 2
mike is on a distinguished road
Hi, I am new to this forum and am looking forward to reading your Metatrader lessons. However, I cant find lessons 1 and 2 (I am at the moment reading lesson 3)

Thanks

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 12-04-2005, 03:27 PM
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
Arrow

Quote:
Originally Posted by mike
Hi, I am new to this forum and am looking forward to reading your Metatrader lessons. However, I cant find lessons 1 and 2 (I am at the moment reading lesson 3)

Thanks

Mike
Mike,

To view all the lessons' threads, choose a long period (EX: Last year) in display options.
__________________
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
  #17 (permalink)  
Old 03-16-2006, 02:16 AM
Junior Member
 
Join Date: Mar 2006
Posts: 1
boomerlcs is on a distinguished road
It is arithmetical operations but it is logic.
In arithmetic if
A + B so it should be C already.
It should not be the same A (the same value).

Because if we are increasing A on B assigning the result to A so
A will be increasing on B all the time. Every second A will be increasing on B without any stopping. It means A plus B is equal A (the same A?) so plus B once again (because of A plus B) is equal A (an other A) which should be added to B and so on.

May be during the coding everything will be clear.

This is often very confusing for first time programmers. Note that the "=" and the "==" are used very differently. "=" is called the assignment operator because it causes the expression on the right hand side to be assigned to the variable on the left hand side. There is no infinite loop as you suggest.
The expression A=A+B; means:
take the current value of the variable A and add it to the current value of the variable B. Then place the result of the addition into variable A. So, after the expression is executed, the value of variable A will change.
For example, if A equaled 2 and B equaled 3 than after executing A=A+B (or the equivalent A+=B) A would have the value 5 assigned to it.



But I have a question.
In Relational operators A == Bi;
It means true if A equal B else false.

Is it necessary to have i after B?

I think you may have mistakent the semi-colon for an "i". You are correct in your definition of this logical expression except for the inclusion of the extra character "i" the relation A==B is true if A equals B and false otherwise.

I hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 03-16-2006, 06:10 AM
Junior Member
 
Join Date: Feb 2006
Location: Latvia
Posts: 14
passass is on a distinguished road
Hi coders !!!
I am studying from very begin. I am testing every operator because of training Could you explain how "+-" operator works ? I tryed but it makes error in compiling. Could you give me a simple, sample code with that operator.

Thnx !

passass
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 04-20-2006, 02:11 AM
Member
 
Join Date: Jan 2006
Posts: 37
Heder is on a distinguished road
Help

Hi, Coders..
It would like to know as it would be the represented number below in the MT4.

0,000072

Thanks,
Ok!!! No have problems!!!!

Last edited by Heder; 04-22-2006 at 10:22 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 04-20-2006, 02:19 AM
Member
 
Join Date: Jan 2006
Posts: 37
Heder is on a distinguished road
Expression

Hi coders...

This expression is complex (MT4) for me. It could help me?

(b-d)<=((d-c)/5))

(b-a)<=((a-c)/5))


(d-c)<=((b-d)/5))

(a-c)<=((b-a)/5))

Thanks,
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 3 - MQL4 Data types codersguru Lessons 20 05-18-2007 03:55 AM
mql4 tutorial - Where is Lesson 1, etc.? ftsdPadawan Metatrader 4 mql 4 - Development course 2 01-15-2007 08:36 PM
Lesson 8 - Variables in MQL4 codersguru Lessons 11 09-15-2006 01:06 PM
Lesson 9 - Preprocessors codersguru Lessons 7 05-18-2006 08:26 PM
Lesson 7 - Functions codersguru Lessons 2 11-02-2005 03:32 PM


All times are GMT. The time now is 06:11 AM.



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