Amps

Tuesday, September 29, 2015

Forex MT4 coding 2 variable Structure


MT4 variable structure

Look at MACD Sample code for example.


Properties show the code owner


Global variable

This part used for declare  global variable, which variable in this part would able to see and able to used by every function of code
(so these variable name in this part should be unique name)



Function variable

Variable in this part able to used in this part only unable to used by other function.




Forex MT4 EA coding Step1 Starting build The EA


First Step MT4 EA coding

Goto Menu Tools => Metaquotes Language Editors or F4
To access MetaEditor code Editors


Use MQL Wizard to tell what type of code we would build => Select Expert Advisor Template to build Expert Advisor


Input the name of MT4 EA, Author and Link (if have your web sites)


Select Function would like to build instance MT4 work under Timer, on ChartEvent and etc.


Saturday, September 26, 2015

How to Back Test MT4 Expert Advisor

Short cut Back Test MT4 Expert Advisor

Click on the Icon Expert Advisor Tester (Strategy Tester)


Tester windows would show


Click Expert Properties button to => Input the properties value



Select date time and range date want to test the MT4 expert advisor

  • Click on Start button to start testing
Click on Result this MT4 Tester would show the tester result



Click on Open Chart button would show the result chart






Attach MT4 indicators


Attach MT4 indicators and Save to the template

Select Indicator pasted into Chart


Example MT4 Moving Average Trend Indicators 10, 50, 200



Average Directional Movement Index with put Moving average to the ADX chart




Stochastic Oscillator and MACD and save template to use in next time and other currency pair photo show as below



First Setting up mt4 trading screen

MT4 Setting indicators and Template

MT4 Chart Setting

Right click on the Symbol currency pair we want to make a trading => Select Popup Chart Windows

Default chart would show in Time Frame H1 (60 minutes)
The time frame selection would found on small icon
  • m1 = 1 minute/candle
  • m5 = 5 minute/candle
  • m15 = 15 minute/candle
  • m30 = 30 minute/candle
  • H1 = 1 hours/candle
  • H4 = 4 hours/candle
  • D1 = 1 day/candle
  • W1 = 1 week/candle
  • MN= month/candle



Right click on the chart tick select chart style and colour of candles


On the Common page tick to Show Ask Line


After finish Setting screen would show like this