指定
New EA in MQL5 with trendline (for MT4 programmer with less time and experiance in MT5 who wants to have debugger).
For later jobs: Few MT4 functions/program parts will be migrated to MT5.
GENERAL
-The system is intended to run at FXPRO, German30 index, but should also run for other symbols
-Important: best practice coding for future expandable, good maintainability
-possible to set tradingtimes (in coding is ok, no ext param needed)
-possible to set when all EA-logic runs:
* at new bar
* at x seconed before bar will end.
- all Ea-logic-functions depends on parameter tf=timeframe
- methods for
- open long
- open short
- close all short
- close all long
- the EA consists of more strategies. Each strategy trades independent of the others
- separation logical units (like main parts of a strategy) into separate files
- controll of positions: sum open positions, sum of win/loss at the moment, list of positions with details of open etc
- (add at 04-11-2017) Stop-Loss and Trailing Take profit functionality
EA LOGIC DETAILS:
Strategy 1:
If trendline rises/falls not too strong (slope between 1 and -1)
and last close is between average low-difference and max-low difference
additional condition: check slope of higher tf is bigger: slope(tf+1) > slope(tf)
than open long
inverse conditions for open short
Strategy 2:
provide little example with useage of Function2
Functions:
Function1:
calculation of a trendline(tf, xBars)
needed results from calculation:
1)draw line function
2)slope: slope=0 means trendline is horrizontal; slope=1 means trendline rises with X points per bar, -1=trendline go down X points per bar. X can be a global variable and set to a suitable value of the used symbol.
3)average difference between trendline and low
4)average difference between trendline and high
5)max difference between trendline and low
6)max difference between trendline and high
Function2:
Provide a little example for using MACD