Build Me A Simple Hedging Strategy

Auftrag beendet

Ausführungszeit 2 Tage
Bewertung des Kunden
Did good quality work and on time. The EA and source code looks well done.
Bewertung des Entwicklers
the customer treats you like real humen he is so understanding ,kind,and fun to work with .will work love with him again next time

Spezifikation

Me and my friend had a bet that a strategy he heard about does not not work. I have code logic for my EA in Python and It does not work. But my friend claim I code it wrong said it should be built in MT4 because they is the FX standards. 

I can provide the source code in Python.  The EA is quite simple.  In each tick it check each currency and decides check if the current order is filled if the order is filled the EA submits a new Stop Order for the currency.     

I would like the source code of the final product for me to compile and execute

Here is the logic of the EA.  There are no indicators.  The logic is a bit complex, but the math is very simple.  Basically it enters a trade.  If the trade goes again you it enters a short position. Keeps entering addtional long and short positions until the trade either hits the stop loss or profit target.  The stop loss for the buy trade is the profit target for the sell trade. Also the stop loss for the sell trade is the profit target for the buy trade. So this means when a stop loss or profit target is hit all the trades close together.

What make it a bit more complex is he wants to test the stratgy with a bullish and bearish strategies and want to test for multiple currencies at one.

   

The solution will need the following inputs.

Tickers: 

  • This is a list of tickers to execute the strategy on.  Each ticker should be separated by as space.

Pip Units:

  • this is number of pips the profit target and stop loss. This is a space separated list as each ticker will have a different profit target and stop loss value.

Lot Units:

  • this is the number of lots the to be used by the ticker. This is a space separated list as each ticker will have a different lot size value.

Directions:

  • this will specify if the the ticker is to be trade Bullish, Bearish or Both. This is a space separated list as each ticker could be traded Bullish, Bearish or Both.

Bullish Magic Numbers:

  • This is the magic number used by the ticker when trading the Bullish Strategy.  This is a list because each ticker will have its own magic number.

Bearish Magic Numbers:

  • This is the magic number used by the ticker when trading the Bearish Strategy.  This is a list because each ticker will have its own magic number.

Trade Units:

  • This is the scaling table used to know how big position to open based on the trading rules.  Again this is a space separated list of floating point numbers.

Take Profit Ratio

  • This is the take profit relative to the pip units.  This is a space separated list as each ticker will have it's own ratio.

Stop Loss Ratio

  • This is the stop loss relative to the pip units.  This is a space separated list as each ticker will have it's own ratio.



During the initialization these inputs will need to be converted in to arrays.


There will need to be a loop on the OnTick event where it loops through each ticker.  With in the loop it will do the following

Get the Bullish strategy Magic Number for the current Ticker in the loop from the array

If Has Open Positions

  • Count the number of Open Positions for the Magic Number 
  • While counting the open positions for the magic number. Get the Profit Target, Stop Loss of the first Open Position
  • Set the max of returned Profit Target and Stop Loss as Profit Target
  • Set the min of returned Profit Target and Stop Loss as Stop Loss
  • Set the entry price as the stop loss + (pip units * (stop loss ratio + 1))
  • Set the hedge price as the stop loss + (pip units * (stop loss ratio))

If No Open Positions and Has Unfilled Orders

  • Count the number of Unfilled Orders for the Magic Number \
  • While counting the unfilled positions for the magic number. Get the Stop Price, Profit Target of the first unfilled Order
  • Set the max of returned Profit Target and Stop Loss as Profit Target
  • Set the min of returned Profit Target and Stop Loss as Stop Loss
  • Set the entry price as the stop loss + (pip units * (stop loss ratio + 1))
  • Set the hedge price as the stop loss + (pip units * (stop loss ratio))

If there are no open positions and has unfilled order

  • should check the Stop Price is no more than 1 pip away from current price.  
  • If the current price is more than one pip away from the stop price should cancel the unfilled order.  The unfilled order count should be reduced by one.

 If there are no open positions and no unfilled orders.

  • The Entry Price should be calculated point above the current price.
  • It will calculate the Take Profit as Entry Price + (pip units * take profit ratio). 
  • It will calculate the Hedge Price as Entry Price - pip units
  • It will calculate the Stop Loss as Entry Price - (pip units * stop loss ratio)

If there are no unfilled orders will 

  • This ensures there is never more than one unfilled order per magic number

calculate the lots multiplier as the trade units[open positions + 1]
        calculate the opening units as lot units times lots multiplier


  • The trade quantity should be calculated as the lot units * trade unnts 

  • If the number of current open position is positive will open a buy stop order
  • If the number of current open position is negative will open a sell stop order

Each Order that is executed will be a Stop Order with a Ticker, Stop Price, Quantity, Take Profit, Stop Loss, Magic Number.

where 

  • Quantity is the  the opening units and the is times minus 1 for sell stop 
  • Stop Price is the Entry Price for Buy Stop and Hedge Price for Sell Stop
  • The Take Profit and Stop Loss are swapped around for Sell Stop trades 


The logic above is for a bullish strategy and want to repeat for a bearish strategy but in reverse.


Also would like on the chart white circle and squares for buy and sell for open bullish strategy positions with blue lines connecting to the close point.  Fore the bearish strategy would like red line connecting to the target. But what ever you think looks good. 

The strategy should be quite simple there is not complex math.  However the Inputs have to be loaded into arrays and the arrays need to be accessed to get the values.  But that is about it.


  

Bewerbungen

1
Entwickler 1
Bewertung
(7)
Projekte
12
8%
Schlichtung
3
0% / 67%
Frist nicht eingehalten
4
33%
Frei
2
Entwickler 2
Bewertung
(53)
Projekte
91
52%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
1
1%
Arbeitet
3
Entwickler 3
Bewertung
(98)
Projekte
137
52%
Schlichtung
5
40% / 60%
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(77)
Projekte
241
73%
Schlichtung
7
100% / 0%
Frist nicht eingehalten
1
0%
Frei
5
Entwickler 5
Bewertung
(45)
Projekte
91
13%
Schlichtung
34
26% / 59%
Frist nicht eingehalten
37
41%
Frei
6
Entwickler 6
Bewertung
(57)
Projekte
72
22%
Schlichtung
13
46% / 15%
Frist nicht eingehalten
5
7%
Frei
7
Entwickler 7
Bewertung
(75)
Projekte
124
44%
Schlichtung
14
29% / 50%
Frist nicht eingehalten
17
14%
Frei
8
Entwickler 8
Bewertung
(11)
Projekte
18
28%
Schlichtung
4
50% / 50%
Frist nicht eingehalten
1
6%
Frei
9
Entwickler 9
Bewertung
(57)
Projekte
89
43%
Schlichtung
4
0% / 100%
Frist nicht eingehalten
3
3%
Arbeitet
10
Entwickler 10
Bewertung
(568)
Projekte
641
41%
Schlichtung
25
48% / 36%
Frist nicht eingehalten
46
7%
Arbeitet
11
Entwickler 11
Bewertung
(305)
Projekte
548
35%
Schlichtung
79
32% / 42%
Frist nicht eingehalten
197
36%
Beschäftigt
12
Entwickler 12
Bewertung
(294)
Projekte
470
39%
Schlichtung
102
40% / 24%
Frist nicht eingehalten
78
17%
Überlastet
Veröffentlicht: 2 Beispiele
13
Entwickler 13
Bewertung
(69)
Projekte
146
34%
Schlichtung
13
8% / 62%
Frist nicht eingehalten
26
18%
Frei
Veröffentlicht: 6 Beispiele
14
Entwickler 14
Bewertung
(1)
Projekte
2
0%
Schlichtung
2
50% / 50%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
I need a MetaTrader 5 Expert Advisor (EA) built based on a clear, rule-based strategy for XAUUSD on the M5 timeframe. Indicators used: EMA 50 (Exponential, Close) EMA 200 (Exponential, Close) RSI (14) Stochastic Oscillator (14,3,3) BUY rules: Price above EMA 50 and EMA 200 RSI between 10 and 25 Stochastic crosses upward from below 20 Bullish candle close SELL rules: Price below EMA 50 and EMA 200 RSI between 80 and
Platform: MT5 | Instrument: XAUUSD | Broker: IC Markets (ECN) Style: High-speed scalping / short-term momentum | Timeframes: M1 & M5 | Operation: Fully automated, 24/5 Overview We seek an experienced MQL5 developer to build a fast, reliable EA for live trading. The EA must: Detect symbol specifications automatically (digits, tick size, contract size) Operate continuously without manual intervention Follow logical
Convert the indicator available in trade view named "Support resistance diagonal" by Pikusov to use in MT5 platform. Also need get some alerts in mobile (any social media app/ MT5) if crossing the support/ resistance lines
Hello great developers, I need a very fast and hardworking deliver who know both back end and front end of trade copier system. I need a web based trade copier application, i already create the website aspect, only need the copier to be included. I actually have a limited time, and no room for unprofessional developers, kindly send your applications if you can actually get it done in the space of 2 days and my budget
Budget: [100$ - 200$] I need an experienced MQL5 developer to optimize my existing auto-trading EA and integrate manual trading capabilities from a second EA. The goal is to create a complete EA that combines automated signal-based trading with full manual control. Two reference codes are attached for review before bidding: Code 1 ( 1 Auto Trade.mq5) : Auto-trading EA (main codebase - needs optimization) Code 2 (
Hello, I am looking for an experienced MT5 (MQL5) developer to review, test, and validate an existing Expert Advisor. The EA is already developed. The requirement is analysis, debugging, and refinement , not a full rewrite. Scope of Work Review entry and exit execution Validate hedging behavior (ON vs OFF) Review support/resistance handling and trade triggering Identify logic mismatches between expected vs actual
My EA, based on the Ultimate Renko indicator created by Artur Zas, is no longer working. I am not sure if it's my computer or the latest version of MetaTrader, but I need help running the EA (16 errors need to be corrected). I will send you the EA source code, and after corrections, you will send me the corrected source code. Please do not apply if you do not have the package (Renko-GenX) and the UltimateRenko
EA Development mentor 30 - 40 USD
am looking for a Mentor that has verifiable experience trading forex and commodities. Somebody who has a couple years experience in failures and successes. I am not a beginner. I have modest success already with discretionary trading. I have had an EA created that is very promising. It has extensive testing with very good results. The idea would be to work together advancing the existing EA and build additional EA's
Existing EA 30 USD
I’m looking to acquire an existing, profitable Expert Advisor (EA) with full source code to add to our client investment portfolio. To be clear, this is not a request to develop or design a new strategy. If you already have an EA that is proven, consistent, and production-ready, I’m open to reviewing it immediately. Please apply only if you meet all the requirements below. Submissions without a proper introduction or
Need to create an MT5 EA based on break out strategy. This will be all in one EA including daily breakout, hourly breakout, support and resistance breakout, pivot breakout, super trend break out, moving average breakout. Extra features include TP, SL, breakeven, notifications, dashboard

Projektdetails

Budget
150+ USD