MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Order MQL5 Programs from professional developers

Screenshot
USDJPY, H4
Real
X2MA NRTR Indicator
X2MA NRTR
Author: GODZILLA
Subscribe to signal
TPSL
21.70%, 813.31 USD
Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies Exploring Trading Strategy Classes of the Standard Library -... Clock Timezone LimitedClock Timezone Limited Try product
Clock Timezone Limited
Author: song_song

/ SIMPLE 4 WEEK RULES MT4 EXPERT ADVISOR (WK CHART) [finished]

To add comments, please log in or register
Hans Krijgsman
57
HansSpain 2012.06.20 15:56

OPEN LONG  : whenever PRICE exceeds the HIGHs of the previous 4 calendar weeks, PRICE > MAX(HIGH OF 4 WEEKS).
CLOSE LONG : whenever PRICE falls below the LOWs of the previous [n] calendar weeks, PRICE < MIN(LOW OF n WEEKS), if "UseCounterTrade"==true: OPEN SHORT.
OPEN SHORT : whenever PRICE falls below the LOWs of the previous 4 calendar weeks, PRICE < MIN(LOW OF 4 WEEKS).
CLOSE SHORT: whenever PRICE exceeds the HIGHs of the previous [n] calendar weeks, PRICE > MAX(HIGH OF n WEEKS), if "UseCounterTrade"==true: OPEN LONG.

Must work on all symbol notations (number of digits).

Include checks for error messages and execute follow-up actions, e.g. when order is not executed/accepted, repeat the order etc..

Include Exit Filter(s) to close trades:
- "ExitFilterWeeks" n = [0|1|2|3|4]  // "0 weeks" is a possible value for future extensions
- default value for "ExitFilterWeeks" = 2.

Include Counter Trades:
- "UseCounterTrades" [true|false]
1) OPEN SHORT on CLOSE ALL LONG trades.
2) OPEN LONG on CLOSE ALL SHORT trades.

Keep in mind there can be multiple active trades!

So, in this document, 'CLOSE LONG' means 'CLOSE ALL LONG TRADES' and 'CLOSE SHORT' means 'CLOSE ALL SHORT TRADES'!

Explanation how additional/multiple trades can appear:

A) When CLOSE SHORT && "UseCounterTrade"==true: OPEN LONG (1st LONG trade)
-  and whenever PRICE exceeds the HIGHs of the previous 4 calendar weeks, PRICE > MAX(HIGH OF 4 WEEKS),
-  a new additional OPEN LONG will be invoked (2nd LONG trade)
-  of course, only when there are no objections to open this additional LONG trade, see paragraphs below.

B) When CLOSE LONG && "UseCounterTrade"==true: OPEN SHORT (1st SHORT trade)
-  and whenever PRICE falls below the LOWs of the previous 4 calendar weeks, PRICE < MIN(LOW OF 4 WEEKS),
-  a new additional OPEN SHORT will be invoked (2nd SHORT trade)
-  of course, only when there are no objections to open this additional SHORT trade, see paragraphs below.

Similar applies to a [TRAILING-] STOP LOSS that is triggered && "UseCounterTrade"==true:

C) When a LONG trade is stopped out && "UseCounterTrade"==true: OPEN SHORT (1st SHORT trade)
-  and whenever PRICE falls below the LOWs of the previous 4 calendar weeks, PRICE < MIN(LOW OF 4 WEEKS),
-  a new additional OPEN SHORT will be invoked (2nd SHORT trade)
-  of course, only when there are no objections to open this additional SHORT trade, see paragraphs below.

D) When a SHORT trade is stopped out && "UseCounterTrade"==true: OPEN LONG (1st LONG trade)
-  and whenever PRICE exceeds the HIGHs of the previous 4 calendar weeks, PRICE > MAX(HIGH OF 4 WEEKS),
-  a new additional OPEN LONG will be invoked (2nd LONG trade)
-  of course, only when there are no objections to open this additional LONG trade, see paragraphs below.


Include Balance Protection and Maximum Risk Percentage:
- "BalanceRiskPercentage" (e.g. 2 - 5%)
- "MinimumBalance" (to prevent a blown-up account)
- check with Alert when Balance is not sufficient to trade because of
1) "MinLotSize" (too big), and/or
2) "MinimumBalance" (not enough money), and/or
3) "BalanceRiskPercentage" (too big).
 

Include optional Trailing Stop Loss:
- "UseTrailingSL" [true|false]
- "TrailingSLvalue" [minimal broker value in pips|higher own value in pips].
 

Include optional dynamic Lot Sizes:
- "MinLotSize"  [>= 0.01] (minimum lot size)
- "MaxLotSize" [maximum lot size]
- check with Alert when "MaxLotSize" < "MinLotSize" and prevend execution of the EA
- when "MinLotSize" == "MaxLotSize" : one fixed lot size
- when "MinLotSize" < "MaxLotSize"  : effective Lot Size depends on
1) "BalanceRiskPercentage" and/or
2) "MinimumBalance" and/or
3) "MinLotSize" and/or
4) "MaxLotSize".

Include explaining comments in English in the code(-blocks).

Please offer the price you need and the time of completion you need.

Best regards. 

PS Sorry, I forgot to mention the "UseCounterTrades" switch (now included, see above)

Job completed in 55 days. The portfolio of Wex contains 163 finished jobs. This developer received 44 feedbacks with an average rate of 4.86.
Do you want to place a new order for Wex?
Phil Meijer

philmans 2012.06.20 16:43 < 100 credits     to 10 day(s)

Hi,

I can develop this ea for you.

Let me know.

 

Regards,

Phil 

Mojtaba M.Alizadeh

moj1367 2012.06.20 17:13 100 credits

hello and I hope u be fine

I can do it for u even with more parameters

And I have this habit to have online chat with customer

my E-mail:moj1367@yahoo.com

regards

Mojtaba M.Alizadeh
A.R.Wex

Wex 2012.06.20 17:26 > 140 credits     from 7 day(s)
Let me make the wanted EA for you.
To add comments, please log in or register