Thread: How to code?
View Single Post
  #1564 (permalink)  
Old 02-05-2009, 07:41 PM
ecousins25 ecousins25 is offline
Junior Member
 
Join Date: Jan 2009
Posts: 2
ecousins25 is on a distinguished road
programmer newbie help

hello i am new to the programming world. i just read through the tutorial put out by Codersguru its a very nice tutorial. i also have the MetaQuotes Language 4 manual a 162 page pdf manual that apears to be a better reference manual for after a get a better grasp of the concepts. i am still having some trouble with understanding the basics. are there any recomended reading that goes more indepth than the standard mt4 reference manual. i need a bit more background description for how to use such things as OrderOpen() OrderSend() OrderSelect() OrderTicket() OrderTicket()

i have a general goal for an EA i want to program. but i want to better learn the language so i am starting my learning experience in a series of small steps

the first step i completed. i created this code to print my name on the chart lol i know, sound simple but... "you have to learn to crawl before you can walk"

here is the code for my first completed ea

//+------------------------------------------------------------------+
//| print test ver 1.mq4 |
//| Copyright © 2009, Eric |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Eric"
#property link ""

//---- input parameters
extern string MyString="name";

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
Comment ("hello ", MyString);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+

the next step i want to learn is how to program my ea to identify open orders
can i use the OrderTicket() (or do i have to use a magic number to identify a trade and where does the magicnumber show up on the mt4 platform) somehow in the code to allow my next ea to
print on the chart
first: my name (i did that allready)
second: below my name (not to replace the first chart comment)
the ticket number (or other identifying number) of the order
and to be able to store and recall this identifyer for the next step in
my learning process.

any help would be much appreciated
thanks!!
Eric
Reply With Quote