This thread is for posting useful user defined MQL4 functions, operators and also code blocks
It might also included some off-topic related posts
I don't take credit for all the functions I post. Some of them are ones that I created myself, others from books, articles, pdfs, somebody else's code etc.
You can use them as include files/imports/straight up copy paste...
Discussions on MQl4 programing are allowed.
You can also post an improved/different version of an already posted function.
To understand most of these posts you need to have some basic understanding of MQL4
credit: Books,Articles etc used
It might also included some off-topic related posts
I don't take credit for all the functions I post. Some of them are ones that I created myself, others from books, articles, pdfs, somebody else's code etc.
You can use them as include files/imports/straight up copy paste...
Discussions on MQl4 programing are allowed.
You can also post an improved/different version of an already posted function.
To understand most of these posts you need to have some basic understanding of MQL4
credit: Books,Articles etc used
- Expert Advisor Programming by Andrew R Young
Don't spam this thread with requests for EA/Custom Indicators/Scripts creation..(Send a pm, I might do it for a fee)
CONTENT
- Function for converting points to pips................................................................................................#post2
- Function for converting Slippage points to pips................................................................................. #post3
- Stop Loss calculation .........................................................................................................................#post9
- Calculating TP and SL........................................................................................................................ #post11
- Alternate SL Methods ....................................using Highs and Lows of current candle.......................#post13
- using Highs and Lows of x no of Bars...........................#post14
- using indicator............................................................. #post16
- Lot Sizing Function............................................................................................................................ #post18
- Lot Size Verification...........................................................................................................................#post19
- Order Placement Function................................................................................................................. #post20
- Pending Order Placement Function.................................................................................................... #post21
- What are function return values? How do I use them?.......................................................................#post22
- Alphabetic Index of 600+ MQL4 functions......................................................................................... #post25
- Function that places Symbols in Market Watch into an Array.............................................................#post28
- stdlib.mqh..........................................................................................................................................#post30
- Where to use Stop Level?...................................................................................................................#post32
- A useful post on closing orders and loops(always countdown)..........................................................#post33
- Semantic Versioning 2.0.0..................................................................................................................#post34