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
2
0% / 50%
Frist nicht eingehalten
4
33%
Frei
2
Entwickler 2
Bewertung
(53)
Projekte
91
52%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
1
1%
Frei
3
Entwickler 3
Bewertung
(98)
Projekte
137
52%
Schlichtung
4
50% / 50%
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(77)
Projekte
232
73%
Schlichtung
6
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
123
43%
Schlichtung
13
31% / 46%
Frist nicht eingehalten
17
14%
Arbeitet
8
Entwickler 8
Bewertung
(11)
Projekte
18
28%
Schlichtung
3
67% / 33%
Frist nicht eingehalten
1
6%
Frei
9
Entwickler 9
Bewertung
(53)
Projekte
85
41%
Schlichtung
3
0% / 100%
Frist nicht eingehalten
3
4%
Arbeitet
10
Entwickler 10
Bewertung
(568)
Projekte
641
41%
Schlichtung
23
52% / 30%
Frist nicht eingehalten
46
7%
Arbeitet
11
Entwickler 11
Bewertung
(295)
Projekte
525
35%
Schlichtung
62
34% / 35%
Frist nicht eingehalten
189
36%
Arbeitet
12
Entwickler 12
Bewertung
(284)
Projekte
459
39%
Schlichtung
94
44% / 18%
Frist nicht eingehalten
73
16%
Beschäftigt
Veröffentlicht: 2 Beispiele
13
Entwickler 13
Bewertung
(69)
Projekte
146
34%
Schlichtung
11
9% / 55%
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
Mthizo trades 30 - 200 USD
- *Currency Pairs*: Major pairs such as EUR/USD, XAU/USD and GBP/USD - *Funding Currency*: South African Rand (ZAR) - *Initial Deposit*: R100 (may require additional deposit for live trading) - *Risk Management*: Basic risk management features, such as stop loss and take profit - *Strategy*: Pre-defined strategy based on Smart Money Concept principles - *Cost*: Approximately R100-R200 (one-time cost or
I need an Expert advisor based on AOX signal . it must have check and handing of trade operation..errors. The main criterin for opening and dosing a position : moving average direction the price is higher than the previous bar Trade lots is input parameter bar
Overview Create a MetaTrader 5 (MT5) indicator that: Pulls live sentiment data from multiple broker APIs. Calculates Net Sentiment (Long% – Short%) and plots each broker as a moving average line on the chart. Displays a weighted average line when ≥2 feeds are active. Saves all data to CSV files per broker for efficient historical loading and performance. Supported Brokers Broker Abbr. Color OandaFX
Manage my live forex account with a disciplined, low-risk approach that produces steady monthly income. My priority is capital protection, so each trade must be sized conservatively, anchored by firm stop-loss orders, and designed to keep drawdown minimal. High-risk tactics such as martingale, grid systems, or excessive leverage are off the table; a measured, rules-based strategy is essential. I will connect the
Description: Gildepak is a purchasing cooperative for packaging materials. We need a program to calculate and fairly distribute the annual bonus (received from preferred suppliers) among our member companies (partners and members). The program should work with a set of predefined tables and data flows, and it must be able to import and export Excel files. Main Tables: Member Companies Company ID Company Name Partner
Hello, I am looking for an experienced QuantConnect/Lean developer for a trading strategy project on futures (Micro Nasdaq – MNQ) with Interactive Brokers integration (paper + live). The strategy includes several key features: • Multi-timeframe analysis (signal validation across multiple horizons) • Integration of economic news/events into the trading logic • Advanced risk management (daily stop, position sizing
READ CAREFULLY And if you have done 50 projects before then apply others i will reject SEPARATE LOGIC MUST BE SEPARATE AND ALL INPUTS MUST BE VISIBLE WITH FALSE TRUE OPTION TO ON OFF FUNCTION 🔺 BUY Signal (Boom Market) ✅ Pattern Formation (Spike-Based Buy Setup) First Spike : Large bullish spike candle . Mitigation Candle : Small bearish candle inside or partially inside the bullish spike. Second Spike
Bainanans 500+ USD
Bainanan good f المؤشر. ينبغي إضافة نقطة صفراء عند أعلى نقطة في الشموع في منطقة ذروة الشراء - وهي نقطة H. ينبغي إضافة نقطة خضراء عند النقطة المنخفضة للشموع في منطقة ذروة البيع - وهي نقطة L. إذا وُجدت نقطة L واحدة على الأقل بين نقطتي H، فابحث عن نقطة LL في الفترة الفاصلة بينهما. ستكون الشمعة ذات أدنى سعر قاع هي نقطة LL. بشكل عام، لا تُعتبر نقطة LL بالضرورة نقطة L. ابحث عن الشموع ذات أدنى سعر قاع. إذا كانت هناك نقطة H
Døsh forex 30 - 200 USD
I want a robot that will help me and trade the the robot will be very good I don’t want to loose money I repeat I don’t want to loose money
Precision Shift EA 100 - 500 USD
▪ Use the Daily (D1) chart as the higher timeframe reference. ▪ On the H1 timeframe, monitor for a sweep of the previous day’s high or low. ▪ A sweep means that price takes liquidity above or below the previous day’s level and then shifts back inside. ▪ After the sweep, wait for a Change of State in Delivery / Market Structure Shift (CHOCH/BOS) on the H1 timeframe. ▪ If the sweep occurs above the previous day’s high

Projektdetails

Budget
150+ USD
Für die Entwickler
135 USD