Build Me A Simple Hedging Strategy

工作已完成

执行时间2 天
客户反馈
Did good quality work and on time. The EA and source code looks well done.
员工反馈
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

指定

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.


  

反馈

1
开发者 1
等级
(6)
项目
12
8%
仲裁
1
0% / 100%
逾期
4
33%
空闲
2
开发者 2
等级
(46)
项目
75
49%
仲裁
1
0% / 0%
逾期
1
1%
工作中
3
开发者 3
等级
(97)
项目
135
52%
仲裁
4
50% / 50%
逾期
0
工作中
4
开发者 4
等级
(61)
项目
186
73%
仲裁
4
100% / 0%
逾期
1
1%
空闲
5
开发者 5
等级
(42)
项目
88
14%
仲裁
30
30% / 53%
逾期
36
41%
工作中
6
开发者 6
等级
(57)
项目
72
22%
仲裁
13
46% / 15%
逾期
5
7%
空闲
7
开发者 7
等级
(74)
项目
121
43%
仲裁
12
33% / 50%
逾期
17
14%
空闲
8
开发者 8
等级
(10)
项目
15
27%
仲裁
3
67% / 33%
逾期
0
空闲
9
开发者 9
等级
(45)
项目
67
45%
仲裁
3
0% / 100%
逾期
0
已载入
10
开发者 10
等级
(568)
项目
641
41%
仲裁
21
57% / 29%
逾期
47
7%
工作中
11
开发者 11
等级
(243)
项目
429
34%
仲裁
54
37% / 39%
逾期
156
36%
繁忙
12
开发者 12
等级
(256)
项目
415
38%
仲裁
86
44% / 19%
逾期
70
17%
繁忙
13
开发者 13
等级
(66)
项目
143
34%
仲裁
10
10% / 60%
逾期
26
18%
空闲
14
开发者 14
等级
(1)
项目
2
0%
仲裁
1
100% / 0%
逾期
0
空闲
相似订单
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
There are six conditions in total . source code from an existing expert will be provided to aid the completion of this job . - Install the following by the Panel (copy paste form my existing Expert ) 1. Pips Lost : number of pips lost ( monthly reset ) 2. Pips Gained : number of pips gained ( monthly reset ) 3. Have a black background to avoid the
There are six conditions in total . source code from an existing expert will be provided to aid the completion of this job . - Install the following by the Panel (copy paste form my existing Expert ) 1. Pips Lost : number of pips lost ( monthly reset ) 2. Pips Gained : number of pips gained ( monthly reset ) 3. Have a black background to avoid the
New york session based strategy 9:30 open Price takes out buy side or sell side liquidity Usually using 15min high and lows 5m entry Price takes out that high/low and price must close strongly back into the zone Is price is above price we have a sell bias vis versa for buys Sl is at the high or low with option for “offset” for cushion Tp is usually the opposite High or low. Would like the option for set pips-points &
Hey greetings. Am in need of a developer that has already made profitable MT4 or MT5 EA that I can buy with the backtesting and proven result. How is the draw down ? What is the winning rate ? Kindly reply and let proceed
I will buy your EA for MT5, in case that on distance it is able to make a profit of 10% per month. - Martingale methods and grid strategies should not be used as the basis of a trading strategy. - Excellent win rate (>80%) - High risk/loss management - Option to select direction of trading (long, short or both) - News filter - Editable Trading Hours I will need to test in the strategy tester and on live market (on
Hello, i need a good programmer; to code an EA to trade the most productive forex pairs (mainly 2 for the day, and 2 for the night+gold), the strategy is based on the use of one moving average and the rsi, thank you in advance
Arafat 30 - 80 USD
Offre valable uniquement pour avoir des nouvelles de votre réponse rapide de votre aide cordialement mme le quartier de votre avis sur les vacances scolaires et les activités de votre réponse
Hello, I want to create an EA with the belowspecification. EA will check conditions based on following input parameters: ● High Price ● Low Price ● Move Value (in Price) ● Gap (in price) After start, EA will mark High and Low prices based on input parameters. EA will start trading when the current price will hit any of the price POSITION at High , Low, Control Buy or Control Sell . EA will open
I am interested in creating an EA, I already have the code but I need someone who can debug it make it more greater look more into the strategy and put more strategy modification and modeling and optimization to make it great also at same time debug it

项目信息

预算
150+ USD
开发人员
135 USD