how to hidden tp sl of EA or show tp sl on MT4 ? - page 4

 
Ickyrus:

What programming experience do you have?

Why do you feel you can dive right in to modifying a progam without first learning the language

When you try to use the metatrader language do you check the syntax against the doumentation ?


just vb 6.0 only...

i had bought an expertadvisor programming book,

from http://expertadvisorbook.com/

but not yet receive,

so right now start to learn it.

step by step from modifying exist ea first before create my ownself ea.

try to learn from all the mistake which i made.

 

So the first thing you need to understand is that the syntax of the mlq language is very different from VB so you can't just write VB and expect it to work the same.

Second thing you need to understand is the basic inputs and outputs of mlq.

Third thing is to understand the special functions init() start() deinit() and what a function is.

So start to start writing your new ea lets begin with opening the editor and seeing the outline of a mlq program.

Sorry if this sounds patronising but its easier to teach a child as you can assume they don't know anything where adults can jump in with background assumptions based on experience.
Here is the simplest blank mlq program you can make. You can compile it and add it to a chart and see the smilely face in the top right hand corner.

Everything you do when writing code must follow this syntax

int start()
{
 //program code starts here
 return(0) ; //special function start requires and integer value return to the main metatrader program.
}
// the end.
that is:- the type of number the function returns the name of the function with the () following THEN the curly brackets {}. that enclose a block of code
int start()
{
//program code starts here
Comment("Hello World the Ask price is ",Ask) ;
return(0) ; //special function start requires and integer value return to the main metatrader program.
}
// the end. 

This program introduces the end of line concept. A line of code can cover more than one line so the end of the line of code is represented by the semi-colon ;

Comment is a function that has string and number variables separated by a comma as its parameters. Comment outputs information to the chart window the ea is placed on. You can use this to see if your trigger code is working as expected.

Exercise: look up the if statement and have it write two different comments to the screen depending on the Ask price being above or below a manually entered price.

 
Ickyrus:

So the first thing you need to understand is that the syntax of the mlq language is very different from VB so you can't just write VB and expect it to work the same.

Second thing you need to understand is the basic inputs and outputs of mlq.

Third thing is to understand the special functions init() start() deinit() and what a function is.

So start to start writing your new ea lets begin with opening the editor and seeing the outline of a mlq program.

Sorry if this sounds patronising but its easier to teach a child as you can assume they don't know anything where adults can jump in with background assumptions based on experience.
Here is the simplest blank mlq program you can make. You can compile it and add it to a chart and see the smilely face in the top right hand corner.

Everything you do when writing code must follow this syntax

that is:- the type of number the function returns the name of the function with the () following THEN the curly brackets {}. that enclose a block of code

This program introduces the end of line concept. A line of code can cover more than one line so the end of the line of code is represented by the semi-colon ;

Comment is a function that has string and number variables separated by a comma as its parameters. Comment outputs information to the chart window the ea is placed on. You can use this to see if your trigger code is working as expected.

Exercise: look up the if statement and have it write two different comments to the screen depending on the Ask price being above or below a manually entered price.

great....

done the hello world mql4


http://postimage.org/image/7dfpk2f3l/

 
Ok waiting to see the source code using the SRC for the exercise - this discussion should be started in a new thread with a different title Like "My first EA"
 
Ickyrus:
Ok waiting to see the source code using the SRC for the exercise - this discussion should be started in a new thread with a different title Like "My first EA"

ok
Reason: