Learning mql5

 

Hi Guys,


im learning the basics at the moment

just scratching the surface really, i learnt python a while ago so i get the concept


i have printed to the experts tab

figured out the basics of variables ect


i want to add some text to the chart window from what i can see this is possible

am i on the right track with this at all?


obviously nothing shows up, i just cant seam to see what im missing?


any help would be appricieated


//+------------------------------------------------------------------+
//| Hello World example                                              |
//+------------------------------------------------------------------+

//--- The start function is called once when the EA is loaded onto a chart
void OnStart()
{

   string my_string = "My String";
   int label_handle = ObjectCreate(0, "MyLabel", OBJ_TEXT, 0, 10, 10);
   
   ObjectSetString(0, "MyLabel", OBJPROP_TEXT, my_string);
   ObjectSetInteger(0, "MyLabel", OBJPROP_FONTSIZE, 12);
   ObjectSetString(0, "MyLabel", OBJPROP_FONT, "Arial");
   ObjectSetInteger(0, "MyLabel", OBJPROP_COLOR, clrRed);
   
   ObjectSetInteger(0, "MyLabel", OBJPROP_XDISTANCE, 10);
   ObjectSetInteger(0, "MyLabel", OBJPROP_YDISTANCE, 10);
   
   ObjectSetInteger(0, "MyLable", OBJPROP_ZORDER, 0);
   ObjectGetInteger(0, "MyLable", OBJPROP_HIDDEN, false);
   ObjectGetInteger(0, "MyLable", OBJPROP_SELECTABLE, false);
   
   //--- Print "Hello World" to the Experts tab in MetaTrader 5
   Print(my_string);
}
 

Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you - and searching gives better results than ChartGPT!

There is a lot of articles for beginners like:
https://www.mql5.com/en/articles/496
https://www.mql5.com/en/articles/100

Using and studying examples (..\MQL5\examples\.. or in the CodeBase) is a lot better than ...

Here is a list of all functions of MQL5 with a short description which enables a kind of keyword search: https://www.mql5.com/en/docs/function_indices

Schnelleinstieg oder Kurzanleitung für Anfänger
Schnelleinstieg oder Kurzanleitung für Anfänger
  • www.mql5.com
Liebe Leser, in diesem Artikel möchte ich Ihnen vermitteln und zeigen, wie man sich möglichst schnell und einfach die Grundlagen der Erstellung automatischer Handelssysteme, wie die Arbeit mit Indikatoren u. a., erschließt. Der Beitrag richtet sich an Neueinsteiger, in ihm kommen weder komplizierte noch schwer zu verstehende Beispiele zur Anwendung.
 
Carl Schreiber #:

Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you - and searching gives better results than ChartGPT!

There is a lot of articles for beginners like:
https://www.mql5.com/en/articles/496
https://www.mql5.com/en/articles/100

Using and studying examples (..\MQL5\examples\.. or in the CodeBase) is a lot better than ...

Here is a list of all functions of MQL5 with a short description which enables a kind of keyword search: https://www.mql5.com/en/docs/function_indices



Thanks Carl,

I found what I was looking for in the code base.

I had come across the first article you mentioned, but I like to understand each part so I was trying to start simpler than a basic ea.

I did realise very quickly that chat gtp had no idea
Gave up with it and come here
 
chad85:

Hi Guys,


im learning the basics at the moment

just scratching the surface really, i learnt python a while ago so i get the concept


i have printed to the experts tab

figured out the basics of variables ect


i want to add some text to the chart window from what i can see this is possible

am i on the right track with this at all?


obviously nothing shows up, i just cant seam to see what im missing?


any help would be appricieated



Don't use: 

ObjectCreate(0, "MyLabel", OBJ_TEXT, 0, 10, 10);


Change to:

ObjectCreate(0, "MyLabel", OBJ_LABEL, 0, 10, 10);
[Deleted]  
chad85 #:

Thanks Carl,

I found what I was looking for in the code base.

I had come across the first article you mentioned, but I like to understand each part so I was trying to start simpler than a basic ea.

I did realise very quickly that chat gtp had no idea
Gave up with it and come here

The codebase in English version of MQL has very less content but Russian version is full of interesting programs in codebase, so i am attaching translated version of Russian codebase library by two popular coders, you can find thousand of codes of EA indicator and script and download and learn them.

ZIP archive removed by moderator. Instead, please provide links to CodeBase or the search keywords instead.