Buy against the trend

MQL4 专家

指定


 Buy Against The Trend With Boundary Lines:

 

 

General:

 

 

If broker and my VPS server lose connection, the ea sends SMS to 3 phone numbers and email notice to 3 email addresses.

 

If broker loses connection to the market then the ea also sends the messages.

 

SOS button on the chart, in emergency to close all orders (active and pending) and stop the work of the ea.

 

Backtest should run fast as possible. Please code the ea so it runs fast.

 

Must be able to open multiple charts for different currency pairs to run at the same time. And must be able to open multiple charts for the same pair.  Each chart looks at current balance for start lot size. We need ability to change magic number our self please.

 

If the EA if closed and restarted in the middle of its work, it must remember its work and continue like normal when turned on again (in case of a problem).

 

Please use the input names provided in the Spec Doc.

 

Ea works with market orders.  Option: CloseBY True/False – If set to True, orders are closed using “close by” function which is more accurate in a fast market. 

 

Max DD close all positions from all sets MaxDDCloseAll.

 

 

 

________________________________________________________

Overview of the EA (without details):

 

 

 

There is a centerline (colored).  Sell market orders open above the centerline with gaps between the positions.  Buy market orders open below the centerline in the same way. 

 

Above and below the centerline, eg, 200 pips above and 200 pips below, is Line #1 (colored).  When the market is moving between Line #1 above the centerline and line #1 below the centerline this called “zone A” (eg 400 pips) the orders close with TP eg 20 pips and SL eg 0. If the market goes back to the price where the order was, the order opens again, and this repeats.

 

Further distance (than Line #1) away from the centerline above and below is Line #2 (colored). If the market moves between Line# 1 and Line #2, this is called the “Zone B”.  Once the market goes into this zone the ea changes.  It no longer opens and closes positions like in zone A. Even if the market goes back to the zone A, it will not open and close positions and the TP and SL no longer work.  Instead it tries to close all positions together with specified profit (or loss) and restart with new centerline at the current market price.

 

Further distance (than Line #2) away from the centerline above and below is Line #3 (colored). If the market moves between Line# 2 and Line #3, this is called the “Zone C”.  Once the market goes into this zone the ea will try to close all position together at a specific profit or loss and restart with new centerline at the current market price.

 

If the ea does not have a chance to close all positions and restart and the price moves past Line #3 then a hedge is applied to lock the loss from all positions. 2 types of hedge options are available. If the market price goes back to “zone C” the hedge is released and will try to close all. If the market ranges here, the hedge is applied and released, applied and released continuously. Option is also provided to hedge each position individually X pips away from each individual position.

 

 

 

 

 

 

 

 

_____________________________________________line 3

 

Zone C

_____________________________________________line 2

 

Zone B

_____________________________________________line 1

 

Zone A

 

 

______________________________________________Center line

 

 

 

Zone A

_____________________________________________line 1

 

Zone B

_____________________________________________line 2

 

Zone C

_____________________________________________line 3

 

 

 

 

 

Zones and Position Gaps:

 

 

 

Need Inputs for size of each zone. Zone A is centerline to boundary of zone A. AzonePipsFromCenter.  (remember the zones appear above and below the center line)

 

Zone B is distance from boundary of zone A to boundary of zone B. BzonePipsFromAzone.

 

Zone C is distance from boundary of zone B to boundary of zone C. CzonePipsFromBzone.

 

Start lot is calculated as % of current balance as of the time the ea closes all positions and restarts its work.  (need input StartLotPercentBal). Eg $100,000 balance if StartLotPercentBal = 1%, then start lot will be 1 lot. Start lot is for position 1.

 

For the gap between positions we need inputs. For example:

ZoneAPositionGaps eg = 20

ZoneBPositionGaps eg = 30

ZoneCPositionGaps  eg = 40

 

Positions appear above and below the center line.  The number of positions in each zone will depend how big we make the zone and the size of the gaps.  There is no limit to the number of positions except by the broker.

 

Eg. Start lot = 1 lot. So position 1 is 1 lot. 

 

 

Lot sizes:

 

 

 Need 3 separate inputs to increase the lot sizes by percent bigger than the previous lot. I want to have different percent increases for the lots in each of the 3 zones:

 

PercentIncreaseLotZoneA. eg = 0%

 

PercentIncreaseLotZoneB. eg = 20%

 

PercentIncreaseLotZoneC. eg = 50%

 

 

So, in the above example, assume we only have 6 positions in use.  Based on the gaps and size of each zone, there are 2 positions in each of the zones.  The start lot is 1 lot.

 

 

 

PercentIncreaseLotZoneA: (0% lot increase)

 

1 lot

1 lot

______________

PercentIncreaseLotZoneB: (20% increase)

 

1.2 lot

1.44 lot

______________

PercentIncreaseLotZoneC: (50% increase)

 

2.16 lot

3.24 lot

 

 

 

Rules for closing positions in each zone:

 

 

 

1) Zone A (between centerline and Line #1):

The positions located inside the zone A have TP in pips and SL in pips (need inputs).  Most likely I will set SL = 0. After a position is TP or SL, if the market will go back to the price where the position was originally located, the position opens again.  This process repeats as many times without limit. The positions in this zone work independently, opening and closing.

 

Let the profit run: Provide inputs to lock and trail the profit. i.e. the TP must increase to infinity once the ea locks profit. ProfitPipsToStartSLtrail, DistancePipsToSL, TrailSLStepPips.

 

 

2) Zone B (between Line #1 and Line #2): Once the market goes into this zone the ea changes.  It no longer opens and closes positions.  Even if the market goes back to zone A, it does not matter. The TP and SL inputs no longer work.  Instead, the ea tries to close all position together with profit or loss (need input ZoneBprofitPercentBal).

 

If set ZoneBprofitPercentBal = 1% (or can even set to -1% will work and accept loss) then when all the filled positions together sees $1,000 floating profit ($100,000 balance at the last restart), restart the set with new centerline at the current market price. Please provide option True/false. OptionIncludeClosedProfitsLosses.  If set to true the ea also takes into account the closed positions profits and losses (since the last set restart) when looking for the $1,000 target ( e.g. 1% setting on $100,000 balance).  If set to False it looks only at floating profit from currently filled positions.

 

 

3) Zone C (between Line #2 and Line #3): Once the market goes into this zone C the ea works same as in zone B, namely it looks to close all positions together and does not open and close positions (and TP and SL do not work no matter where the market will go after this). 

 

The OptionIncludeClosedProfitsLosses input setting will be respected.

 

If the market price is in zone C and it sees the target (need input ZoneCprofitPercentBal) the ea will close all position together and restart with new centerline at the current market price.

ZoneCprofitPercentBal will allow a minus number for input.  Eg. -2% in which case if the profit since last set restart sees -2%, all positions close and restart with new center line.   

 

 

 

The Hedge:

 

 

[Please discuss with me the best way to use the hedge (type of hedge order) to keep trading losses minimal.]

 

Need options for hedge type:  PlaceHedgeType. 0 = no hedge is used.  1 = hedge all positions together with one position.  2 = hedge each position individually.

 

Hedge setting = 0.

 

No hedge is used.

 

 

Hedge setting = 1. 

 

If the EA does not have a chance to close all positions and restart and the market passes beyond zone C eg. 20 pips past the boundary of zone C, away from the centerline, (need input PassZoneCpipstoHedge then the EA places one position opposite hedge with lot size calculated big enough to lock the loss. 

 

If the market will retrace e.g. 10 pips against the hedge position (need input PipsAgainstHedgeToRelease), the EA will release (close) the hedge position.  If the market continues to retrace back to zone C it will be unhedged and will try to close all positions according to the rules.  But if the market will go back PassZoneCpipstoHedge, then the hedge position will activate again.  This will repeat continuously if the market ranges here. If OptionIncludeClosedProfitsLosses = true then the losses from the hedge releases will be taken into account for the target to be reached as well as any profits from closed positions. Note: If PipsAgainstHedgeToRelease = 0 then the hedge will release each time making the smallest loss possible according to the broker spread.

 

Hedge setting = 2. 

 

Each position is hedged individually X pips away from each position.  We need separate inputs for each zone.  Need inputs ZoneAPipsIndividualHedge. ZoneBPipsIndividualHedge. ZoneCPipsIndividualHedge. 

If for example ZoneAPipsIndividualHedge = 0 then there will be no hedge used on the positions in zone A. If for example ZoneBPipsIndividualHedge = 40, then there will be a hedge used on all the individual positions in zone B 40 pips away from each position (the hedge position(s) for zone B can be located outside zone B, in zone C depending on the settings).

 

When individual hedge setting is used (setting = 2) the input for PipsAgainstHedgeToRelease will work for each individual position hedge.

 

Provide True/False option: add lot to the existing positions if the market goes back to the position, to recoup losses incurred from releasing hedge on that position (input: AddLotToRecoupHedgeLoss.

 

Add True/False option to add lots after losses from the hedge release depending on whether we have overall closed profits.  Need input: True/False AddLotsOnlyifProfits.  If set to true only add lots if there are overall closed profits.  Once closed profits are all used up (from hedge releases making losses) then the ea no longer adds to any lot.  If profits are made, then it adds again. If set to false, adds lots regardless of closed profits.  Remember, if we add to the position to recoup the losses and the hedge activates again, the hedge will need to be bigger in order to hedge the bigger position.

After e.g. 30 hedge releases on a position (we made some losses), we don’t want to recoup all of the losses from the hedge releases, because the lot can grow too big.  So at this point (e.g 30 or more losses from releases) reduce what we add to the position if the market goes back to the position. Need inputs CountHedgeReleases and PercentDecreseAddLot.  Eg if the original position = 1 lot, we made some losses from 30 (or more) hedge releases on that position.  We need to add 0.5 lot to the 1 lot to recoup those losses but PercentDecreseAddLot = 50%, so instead of adding 0.5 lot we add only 0.25 lot. Each position’s hedge keeps track of its own losses separately. If this position gets to TP it will not recover all that it lost from the releases.

 

Provide True/False option to shift the hedge position.  After X times releasing a hedge position (makes losses), shift the hedge Y pips further away from the position being hedged.  Then after X more releases(losses) , shift the hedge position Y pips again further and keep repeating the shift after every X releases..  After releasing the hedge, as the market goes back toward the position, the hedge must be ready to reactivate at each price where it shifted to as long as HedgeShiftPips is the minimum distance from the market price to the place where the hedge will activate (we are trying to move the hedge back to its original price, obviously its a pending hedge position).  If the hedge is not active, and if the market goes back to the position, the hedge must be ready to activate again on the hedge's original price, and the shift process repeats if X releases happens again.  It's a continuous process.  Need inputs: CountHedgeReleasesToShift e. g.=  5. And HedgeShiftPips e.g. = 20. 

 

Provide option MaxHedgePipsClosePosition.  If set e.g.= 100 and because the hedge was shifted one or more times so that the hedge is now 100 or more pips away from the hedged position, the ea closes both the hedge and the position, accepts the loss.  If the market goes back to the position's price (where it was), open again the position at the original lot size that it was and be ready to hedge it at the original hedge price. The hedge release counts for that position are reset.

 

 

2nd and 3rd set (or more):

 

 

Assuming the EA is locked in a hedge (or not, depending on the settings) and the market has moved eg. 500 pips away from the center line (need input DistanceFromCenterStartSecondSet), then the EA will start a second set of orders which works exactly according to the same rules as the 1st set (a duplicate of the system).  The position locations from the second set can overlap the position locations from the first set. 

 

Need input True/False CloseFirstSetOnProfitSecondSet.  When set to True, as the 2nd set starts to make profit from its closed positions, that profit will be used to close (or partial close if not enough to fully close) positions from the 1st set.  It will close first those positions closest to the 1st set centerline and then close the next furthest position from the centerline and so on. If the market will go back to the zones of the 1st set, it will be easier to close all positions from the 1st set (hit the target according to the inputs) because the furthest losing positions of the 1st set are now closed.  If the 1st set closes all its positions, the 2nd set continues and it becomes the 1st set. If DistanceFromCenterStartSecondSet again is met, a second set can again begin to operate.

 

Note: Each set keeps track of its own profits and losses from its own closed and/or floating positions.

 

Unlimited number of sets can operate at the same time. Once a set sees its target it closes all of its positions (but not the positions of other sets) and restarts with a new center line at the price where it closed its positions.

 

If CloseFirstSetOnProfitSecondSet is set to False, the 1st set must wait for the market to retrace to its zones in order to close all positions from the 1st set.

 

 

Info on the chart please show:

 

 

1. Active number of sets working. Floating and closed Profit/Loss for each set. Net lot working each set.  DD each set.  Max DD each set.

 

2. For the above numbers show totals for all sets combined.

 

3. Free margin.  Minimum free margin.

 

4. Show current number of hedge releases.

 

5. Show total current sum of $ losses from hedge releases.

 

6. Show max number of hedge releases.

 

7. Show max sum of $ losses from hedge releases.

 

 

Show colored line with label “Zone B profit target”. (could be a loss target).

 

Show colored line with label “Zone C target” (could be a loss target).

 

Note:  When 2nd set makes closed profits in zone A and those closed profits are used to close losing positions in the 1st set, the colored line with label for “zone c target” of the 1st set will move further away from the centerline of the 1st set as those positions are closed.

 

Thank you!


 

反馈

1
开发者 1
等级
(18)
项目
21
38%
仲裁
17
0% / 88%
逾期
2
10%
空闲
发布者: 4 代码
2
开发者 2
等级
(854)
项目
1472
72%
仲裁
122
29% / 48%
逾期
361
25%
空闲
发布者: 3 文章
3
开发者 3
等级
(339)
项目
809
73%
仲裁
30
33% / 37%
逾期
194
24%
空闲
4
开发者 4
等级
(34)
项目
80
34%
仲裁
13
31% / 54%
逾期
19
24%
空闲
5
开发者 5
等级
(41)
项目
160
45%
仲裁
16
13% / 50%
逾期
48
30%
空闲
6
开发者 6
等级
(30)
项目
93
49%
仲裁
18
56% / 17%
逾期
38
41%
空闲
7
开发者 7
等级
(128)
项目
236
65%
仲裁
30
37% / 23%
逾期
49
21%
空闲
8
开发者 8
等级
(271)
项目
553
50%
仲裁
57
40% / 37%
逾期
227
41%
工作中
9
开发者 9
等级
(564)
项目
845
73%
仲裁
15
53% / 13%
逾期
193
23%
空闲
10
开发者 10
等级
(187)
项目
367
56%
仲裁
45
22% / 56%
逾期
188
51%
空闲
发布者: 1 文章, 6 代码
11
开发者 11
等级
(48)
项目
91
31%
仲裁
28
29% / 43%
逾期
42
46%
空闲
发布者: 1 代码
12
开发者 12
等级
(3)
项目
6
17%
仲裁
1
100% / 0%
逾期
0
空闲
相似订单
XAUUSD TRADING BOT 30 - 300 USD
I need a high tech skilled programmer that can generate a bot for me and we'll be working as my programmer.. So, I need a bot that trades only XAUUSD perfectly without errors.. the win rate should be 80_95 % the bot should be an intraday high performance bot
Construct an expert advisor using the "Candle Range Theory". Let it be designed to scan the one-hour time frame, the 30- minute time frame, the 15-minute time frame and the 10-minute time frame one minute before each time fame (candle) is set to change. If the criteria are met during or at the minute before the change, then take the trade. For a buy or long trade, "take profit happens when candle 3 reaches the high
GAP EA 30+ USD
OPENING GAP EA Hello Friends , Gap EA of which around %70 of conditions are written below , simple and well organized code is a must , better be modular one , around 3-4 pages or less if possible , never add any useless function or even a word . BTW I am a coder but not a professional one. **This MQL5 code should be adaptable to for all type of assets ,especially stocks and NDX index and forex, gold etc. in terms of
i need one that can build this : You are an elite quant trading AI with 15 years experience at Jane Street and Citadel. Build a complete, production-ready, non-repainting Python trading system targeting 90% win rate on 5m/15m charts for EURUSD, GBPUSD, NAS100 and BTCUSDT. CORE CONCEPTS: Combine CVD with real divergence detection, 3-candle FVG, liquidity sweeps/equal highs-lows, Order Blocks/Breaker Blocks (ICT/SMC)
Title: Build a Semi-Automated MT5 Execution Assistant (MQL5) with Custom Panel Description: I am looking for an experienced MQL5 developer to build a semi-automated execution assistant for MetaTrader 5. I know this is a standard semi-automated panel with trade management. I am looking for a developer who has an existing GUI/panel library and standard trade management modules that can be adapted quickly. If you are
I am looking for an experienced quantitative researcher to conduct empirical and statistical research on systematic trading strategies, with an initial focus on XAUUSD. The research will cover three main areas: Market structure Market behaviour Quantitative strategy validation, backtesting and robustness analysis. I already have a functional MT5 EA that I would like to improve through extensive quantitative research
روبوت تداول الذهب MT5 (EA) – عروض المطور مطلوبة أبحث عن شراء روبوت تداول محترف للذهب (XAUUSD) أو استكشاف حل مخصص للتداول الآلي. بيئة التداول منصة التداول: MetaTrader 5 (MT5) أداة التداول: ذهب (XAUUSD) وسيط: فانتاج أسلوب التداول: السكالبينغ أو استراتيجيات آلية مناسبة أخرى ما أبحث عنه أنا منفتح على استراتيجيات وأساليب تداول مختلفة، بما في ذلك السكالبينغ، وتتبع الاتجاهات، والتحليل الذكي للسوق، أو استراتيجيات آلية أخرى
# Technical Specification: GoldGuardian Institutional Breakout EA (MQL5) ## 1. Project Overview Develop an institutional-grade, low-latency Expert Advisor (EA) in **MQL5** for MetaTrader 5, specifically engineered for **XAUUSD (Gold)** on the **M5 timeframe**. The EA executes confirmed range breakouts aligned with higher-order trend filters while enforcing strict capital preservation, partial profit taking, dynamic
--- I need an MT5 Expert Advisor (EA) for Forex trading. Strategy: - Trade when fast Moving Average (9) crosses above slow Moving Average (21) = BUY - Trade when fast Moving Average (9) crosses below slow Moving Average (21) = SELL - Only 1 trade at a time Settings I want to change: - Lot size - Stop Loss in pips - Take Profit in pips - Trailing Stop - Trading hours (Start and End time) Risk: - Close all trades at
ICC SMART STRUCTURE EA 50 - 100 USD
DEVELOPMENT REQUIREMENTS Project Title: ICC Smart Structure EA – MT5 Automated Trading System 1. Project Objective I want a fully automated Expert Advisor (EA) for MetaTrader 5 (MT5), based on my Indication–Correction–Continuation (ICC) trading strategy. The EA must identify market structure, Break of Structure (BOS), swing highs and lows, supply and demand zones, corrections and continuation entries across multiple

项目信息

预算
150- USD
截止日期
到 3 天