• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 3:29am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 3:29am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Need Help with FileMove from Common Folder to Common Folder 3 replies

File Functions help 0 replies

I want to add multiple orders and MM functions to this code 0 replies

Can somebody help to add these functions to this EA 0 replies

Help with init() and deinit() functions 11 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Need help with common code functions/calls list
Cancel

Need help with common code functions/calls list

  • Post #1
  • Quote
  • First Post: Edited 5:34pm Aug 29, 2017 5:03pm | Edited 5:34pm
  •  mtbb
  • | Joined Apr 2015 | Status: Member | 78 Posts
So im learning to code(finally)... But what i find is-- i dont know -- what i dont know.. So my thought here is to put together a list of the most important common functions to know.. Maybe the top 100/200? .. Once we have a good list put together ill make a flashcard file and post it here(this way guys can print up their own flashcards and get to work).. This should help guys trying to learn.. They can come in-- get the list-- learn the functions (even if they dont know how to use them yet) then go on to learn the code and already know there is a function to get the open price of a candle or something like that)..

~ thing to know; If you click on a word in your script/ea code and press f1-- it will bring up the reference guide and tell you about the thing you had clicked on..
example = iMa();.. you click on the iMa and then hit f1 and it will tell you about that indicator and tell you how to use it..

1. extern (used to declare a external variable)(this is one of the variable when you drop a script on a chart and you can input something(tp , sl ect)
2. comment(); (used to place a comment onto the screen)
3. MessageBox(text,header,flag); (to have a box pop up to notify you of something)
4. Print() (this will print some info into the journal)
5. Alert(); (this will pop up a alert notification)

This next group will get you info on the pair your on-- they access the data array that is native inside mql4.. example Open[10]; will show you the open price of the candle 10 back from the current candle which is candle[0] (we dont count the current candle cause its still open and can change)
6. Time[]
7. Open[]
8. High[]
9.Low[]
10.Close[]
11. Volume[]

If you want to call info from other pairs-- you use these below. You see that the function brackets ()are used vs the array brackets []as above.. The info in the brackets goes like this (pair,time,candle number);
12. iTime();
13. iOpen();
14. iHigh();
15. iLow();
16. iClose() example iClose("GBPJPY",60,20) regardless to what pair your on-- this would look at gj, 60min, 20 candles back from candle 0
17. iVolume();

18. NULL (for a funtion that calls for the pair-- you can put NULL in and it just means-- use the pair your on(BE SURE to capitalize all the letters in NULL)

19. In a message box you use the "+" sign to group lines and info.. In Alert,Comment and Print function you use a comma","

20. _Period or Period() does the same thing.. It can retrieve the period of the chart you dropped it on.. Usefull if you put a rule in that says this scirpt can only be used on a 60min chart..

21. Functions used to place a order(you dont just place a order with sl and everyhting in it.. You place a order-- then you select the order you just placed and then you modify the order for tp and sl)
a. OrderSend();
b. OrderSelect();
c. OrderModify();

22. GetLastError();
23. OpenOrderPrice();
24.TimeLocal(); (this shows the time of your computer)
25. TimeCurrent(); (shows the time of the brokers server computer)
26. _Symbol Or Symbol(); calls the chart symbol)

27. Digits; (This find out the total of the digits on the pair your on)
28. MarketInfo(pair,mode=what info you want); example int getBid = MarketInfo("EURUSD", MODE_BID);
29. IndicatorCounted(); (this gets the number of bars on the chart)
30. OrderMagicNumber(); (this is used to make sure the magic number on a order is the same as the script calling it.
31. Bid (this refers to the price used when placing a sell order)
32. Ask (this refers to the price used when placing a buy order)

33. iCustom(); This calls a custom indicator. Inside the brakets is number of things the function will call for-- but it will tell you)
34. iMa(); This will call a moving average indicator.. Mql4 has a lot of stock embedded indicators rsi , Bollinger Bands, stock, macd.. So you can just replace
the MA with what you want iMacd().. This way you dont have to reinvent the wheel when using a common indicator..


As you guys add to the list-- ill keep adding to the master list here.. If someone already has a list of the most important functions/calls to share-- then by all means do so.. if i had a list when starting out-- i would have learned them and it would have made things so much easier..
  • Post #2
  • Quote
  • Aug 29, 2017 5:35pm Aug 29, 2017 5:35pm
  •  pipqueen18
  • Joined Nov 2016 | Status: Member | 317 Posts
how about a link to mql4 documentation? i always go there!

https://docs.mql4.com/
Mother of Pips
 
 
  • Post #3
  • Quote
  • Aug 29, 2017 5:36pm Aug 29, 2017 5:36pm
  •  mtbb
  • | Joined Apr 2015 | Status: Member | 78 Posts
Quoting pipqueen18
Disliked
how about a link to mql4 documentation? i always go there! https://docs.mql4.com/
Ignored
 
 
  • Post #4
  • Quote
  • Last Post: Aug 30, 2017 3:42am Aug 30, 2017 3:42am
  •  mtbb
  • | Joined Apr 2015 | Status: Member | 78 Posts
Anyone else? No one have any good functions or calls to ad?

Disappointing...
 
 
  • Platform Tech
  • /
  • Need help with common code functions/calls list
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023