İş tamamlandı
İş Gereklilikleri
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)