Pivot Point based EA
1. Background
This is an EA to be based on the hourly (H1), 4 hourly (H4), daily (D1), weekly (W1) or monthly (MN) pivot point (to be selected from a drop down box) called "PP" below with a OHLC price time frame to be selected using all available MT4 time frames (for example (but not limited to), 15 minutes, 1 hour, 1 day etc) with strategy rules below to decide a buy or sell trade. The pivot point is to be based on the code below which is taken from a PP indicator (see section 5) plus there is another indicator code (see Section 6) which has the ability to shift the D1 pivot point using a day that is advanced (or retarded) from the server time (called Pivot Day). So there will be a need to provide a pivot point in the EA which allows the daily (if selected) to be shifted from the server time.
2. Strategy
The strategy will disclosed on a confidential basis to the selected Developer.
It is based on price action and it's interaction with the Pivot Point.
The strategy will require either instant buy or sell order be placed or limit orders placed based on a set if rules.
Close the trade using a TP/SL/Trailing and some other rules will apply (to be described to the Developer later) .
3. EA parameters
The pivot points formula can be found in the code in section 5 below which is an indicator. However this code has features not required for the EA such as plotting R1,R2,R3,S1,S2,S3,M0,M1,M2,M3,M4,M5; CountPeriods; Plot_middle; Plot_camarilla.
At the end of the day all that is needed is to calculate Pivot for H1, H4, D1, W1 or MN = (high+low+close)/3.0 (with the high/low/close being based on the previous H1, H4, D1, W1 or MN)
The code in section 6 below shows the code for shifting from the server time which is from an indicator.
Both codes are provided for information purposes only as it may save you time re-coding.
The H1, H4, D1, W1 or MN Pivot point and OHLC price timeframe (from M1 to W1) will be chosen from a drop down lists in the EA so I can chose which Pivot point and OHLC price time frame I want to use.
The code to be used from in section 5 and section 6 below is to be a part of the EA rather than using the code in a separate indicator file. Each pivot point must be programmed to the be non-repainting.
The EA Input Tab will have the following parameters
PP chosen = drop down box to choose the PP - H1, H4, D1, W1 or MN
Shift = the number of hours to shift from the server time if D1 is chosen
timeframe = the time bar (OHLC) timeframe
[5 additional confidential parameters to go here which will be disclosed to the selected Developer]
StealthMode: Hides SL, TP and Trailing from broker.
Lotsize: When using fixed lot, set size here.
UseMM: Set true to activate money management.
LotsPercent: Percentage of balance to be used by MM to place orders
MaxLot: Maximum lot size allowed.
MinLot: Minimum lot size allowed.
Stoploss: Stop loss
TakeProfit: Take profit
Breakeven: Amount of profit to take when a profit trade is turning to loss.
Starttrailing: Profit to start trailing stop
TrailStop: Value to trail a profit trade.
TrailStep: Steps for movement of the trail.
Magic_Number: EA magic number.
maxtrades = Maximum allowed total number of trades
tradesperbar = Maximum allowed orders per bar
slippage = Maximum slippage allowable at the point of entry.
maxspread = Maximum spread allowable at the point of entry.
expiration = In minutes. Time for pending orders to expire. (0 = false).
Close all = true = allows to close all trades and pending orders [M] minutes before the end of the current hourly (H1), 4 hourly (H4), daily (D1), weekly (W1) or monthly (MN) pivot point.
Close time = [M] minutes = if "Close all" is true ...the number of minutes to "Close all" trades and pending orders before the end of the current hourly (H1), 4 hourly (H4), daily (D1), weekly (W1) or monthly (MN) pivot point
usetimefilter = To enable time filter.
trade market open= To trade since market open.
Time of trading : Trading_24h = TRUE/false;
StartHour: Time for EA to start (server time). (0 = false)
EndHour: Time for EA to stop (server time). (0 = false)
Trading days: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday (each can be chosen)
fridayfilter = Set last new orders on Friday before market close. No more trading after this time until the next week market open, except existing trades can be closed if the trading rules are triggered (ie SL/TP/Trailing etc).
fridayhour = In hours (server time).
fridayminute = In minutes (server time).
Etc etc as required
4. Other requirements
- I will own all copyright and other intellectual property in the code.
- The EA will also work for Gold (XAU) and silver (XAG)
- The source code is to be provided and is to have commenting & narrative for each component to understand it and be consistent with generally accepted MQL4 coding best practices.
- to work for a 5 digit broker.
- for pips Eg. 1.1 is 1.1 pips, where 20.1 is 20.1 pips (example 1.00201 minus 1 = 20.1 pips)
- English will be the governing language of this contract.
- any bugs are to be fixed as part of a 1 month testing period (the final milestone will be paid at the conclusion of the testing period).
- this project is to be kept strictly confidential.
5. MT4 indicator code for pivot points - see attached file "Pivots ALL.mq4"
6. MT4 indicator code for Daily Pivot Points which can be shifted from the server time - see attached file "Pivot_Points_-_Daily_sShiftedd.mq4"
Thank you
Please let me know if you need any clarification.