Position Trader EA Manual

Position Trader EA Manual

13 March 2024, 16:01
LEE SAMSON
7
2 830


Below you will find a list of all inputs for the position trader EA and an explaination of what they do.
MT4 Version Available Herehttps://www.mql5.com/en/market/product/113677

MT5 Version Available Here: https://www.mql5.com/en/market/product/115359/

The Two Main Strategy Auto Entries Explained:

RSI Mean Reversion

This strategy is designed to be a multi timeframe strategy meaning you use a higher timeframe than the entry to monitor for a condition in the market and you enter on a lower timeframe. A good example would be H1 and M5. H1 would be the timeframe you monitor for an extension of the RSI and then you would enter on the M5 timeframe when the market starts to move in the opposite direction it has been pushing, mean reverting the move that just occurred. The logic for the strategy is as follows:

1. Every time a candle closes on the current timeframe the EA is running on we take a reading of the RSI on the higher timeframe.

2. If the RSI reading is above or below the set levels we set the RSI trigger to long or short and wait for an entry signal.

3. When price opens above/below the MA we have set the EA enters a trade.

 

ADR Reversal

The ADR reversal strategy takes advantage of strong intraday price movements and is designed to get in on the pullback of the move. The logic for this strategy is as follows:

1. We wait for price to have pushed above or below the ADR level set and when that candle has closed (on the timeframe the EA is running on which should be M5 or M15 ideally) we set a trigger to enter a trade.

2. We then wait for the entry signal which is a candle opening one side of our moving average trigger and closing the opposite side. So for a long the open is below the MA and the close is above.

3. The trade is then entered.


Main Functionality:

  • Fully automated trading of RSI based mean reversion strategy.
  • Fully automated trading of ADR based mean reversion strategy.
  • Settings to fine tune each of the above strategies based on your requirements.
  • Simple, configurable entry condition using any moving average to trigger trades when strength is detected in the direction the strategy will trade.
  • Manual trade buttons to take initial entries or place manual additional trades in any existing position as well as close out trades.
    (Use these to trade any strategy and let the EA automatically turn trades that don't work into position trades).
    v1.2 - Buttons now work in the strategy tester too!
  • Perform automatic drawdown control (scaling out of losing trades) as they hit specific percentages in drawdown on your account.
  • Perform aggressive drawdown control (full size trades with stop losses) when your total position hits a specific percentage of your account in drawdown.
  • Total control over the minimum distances between trades in each position and the lot size increment (if required) for additional trades.
  • Risk auto calculated based on percent of your account size, fixed amount of money or a fixed lot size.
  • Individual exit targets based on a percentage of your account or fixed amount of money for individual trades, positions in a single direction and all trades open on each instrument traded.
  • Trade time filter to ensure no trades are taken during swaps where high spreads occur.
  • Can trade on any timeframe using the RSI mean reversion strategy (M5 timeframe recommended for ADR strategy)

EA Functionality & Logic:

The EA monitors the market for extended conditions on RSI or ADR depending on the strategy you are trading and will then, once the conditions for a trade are met, monitor the timeframe it is running on for an entry into the market. The entries are all taken using a moving average on the timeframe the EA is running on. e.g. if you run the EA on the M5 timeframe it will take a trade when the price closes above or below the MA you set in the inputs on that timeframe. The moving average entry logic is that price needs to open above the moving average and close below it to take a short entry and the opposite for longs. The EA monitors the last candle closed.

Recommended Setup For The EA:

As with all EAs it is advisable to have the EA running on a machine that is left on 24/7 so the EA can work constantly and monitor the market for you. It is recommended to run the EA on the M5 timeframe for the ADR strategy and if you are trading using RSI it is advisable to also use M5 or M15. The EA enters the market using a moving average as the entry signal and that is on the timeframe it is running on. Bear in mind if you set the EA to manual mode where it uses the trading buttons only, it will still manage any entries you take with the buttons on the version of the EA running on your VPS/trading PC. Run each strategy you trade on a seperate terminal and seperate trading account so the EA doesn't not get confused with multiple entries using multiple strategies on the same account/terminal. This is best practice for all trading.

My setup: I have multiple terminals running on my own VPS, each terminal is logged into a different trading account and each account is only running one strategy. This way I know exactly what is and is not working at any time. Each terminal has every chart I want to trade opne (all FX pairs in my case) and the EA is set on each chart on the M5 timeframe and will auto enter for me based on RSI or ADR depending on which acocunt it is.
On my trading PC that I use for analysis in my office I also have the EA running on a chart but set to "button trading only" mode. This means I can manually add trades into a position and then the EA running on that chart on my VPS will take over, adjust the next entry level and lot size for me.

Inputs for EA:

Button trading ONLY (disables ALL other functionality below) - When this is set to TRUE there will be no auto trading done by the EA on the chart you have the EA loaded onto. This includes new entries with RSI or ADR and additional enries, no drawdown control, aggressive drawdown control or closes of trades in profit. The idea behind this button is as follows:
The EA should be set on a VPS on every instrument you want to trade with it. You can set the EA on that machine to have button trading set to false (default) and it will then trade automatically for you with whatever auto strategy settings you have setup. So if you have RSI or ADR entries set to TRUE (next inputs down) the EA will take initial trades and additional trades for you automatically. It will also get you out of the positions and do DD control etc as you have it setup in the inputs.
If you have NOT set the EA to take auto entries on RSI and ADR it will still kick in and trigger additional entries for you and do DD control and exit in profit based on any trades you take with the manual buttons.
The manual buttons can also be used on your local terminal OR VPS to take your own manual trades whenever you like even if there are existing trades open on an instrument, the EA will automatically re-calculate the next trade entry to scale into after this manual trade is taken.

BUY BUTTONS - The buy buttons will initiate an instant market buy/sell trade at the next correct lot size. If this is an initial entry into the market it will use either fixed lot or percentage risk as you have set in the risk inputs covered a little further down. If this is an additional entry into a position the lot size will be the next correct lot size to take based on the lot size multiplier used and whether the EA is to use an aggressive entry or not. You cannot over-ride the lot sizing as this is handled by the EA.

PENDING STOP BUTTONS - Logic for these buttons is the same as above for sizing but it will place a pending order at either the high or low of the current candle + an offset which you can specify in the inputs towards the bottom. This is ideal if you are looking to add a new trade but price has not got to the next trade entry level yet.
IMPORTANT: The pending entries will also trail with price as the market moves. This is designed so when you take a pending trade on your chart the EA running on your VPS will then take over trailing that pending order for you. So if you enter a pending order short and price keeps pushing up the EA will delete your pending order and then re-place it at the next candle low and the opposite for longs. This is designed so if you want to enter short and price pushes up you will get the best possible entry you can rather than waiting for price to push all the way back down to where you initially wanted to enter. You can manually delete the pending orders and the EA will then ignore them if you no longer want them.
NOTE: If you have the EA running on a VPS and also on a local terminal you use for analysis the EA will trail your pending orders on both VPS and local machine, just be aware of this if using different timeframes on your VPS and local machine!

PENDING LIMIT BUTTONS - These buttons will place a pending limit order above or below price so you can sell above current price or buy below current price when the market moves to specific levels automatically. The orders are placed at the pending offset distance you select (input further down in settings) and you can then amend the orders by dragging them to the desired price. These order types stay in place once set and do not trail at all.

CLOSE BUTTON - This will close ALL open trades on the currency pair you are currently on only.

--- AUTO STRATEGY ENTRY --- (USE ONLY ONE)

It is strongly recommended to trade only one strategy on an account. If you set both conditions to true and they are both met the EA will take 2 trades and may not function as you intend as it will double up the first entry.

ADR reversal strategy - When set to TRUE the EA will automatically take trades in line with the ADR reversal strategy based on whatever ADR level you have set in the inputs below.

RSI mean reversion strategy When set to TRUE the EA will automatically take trades in line with the RSI mean reversion strategy based on whatever ADR level you have set in the inputs below.

Take auto trades short (MT5 VERSION ONLY) - When true the EA will take short trades. If you would like to only trade long set this to false.

Take auto trades long (MT5 VERSION ONLY) - When true the EA will take long trades. If you would like to only trade short set this to false.

NOTE: The above long and short inputs are for MT5 only. The MT4 version of Metatrader has this functionality built into the EA system in the common tab when you look at the EA inputs.

--- RISK --- (USE ONLY ONE)

Fixed lot size to use (0 = disable) - Input here the initial lot size you would like the EA to use. This will be used for the first trade taken either manually with the trading buttons OR any auto strategy you have enabled.

Percent to risk over 1 ADR movement (0 = disable) - Input here the percentage of your account you would like to risk on the initial trade. This will be calculated using a fake stop loss placed 1 X ADR away from the entry.

Money amount to risk over 1 ADR movement (0 = disable) [ADDED in v1.5] - Input an amount of money you would like to risk on the initial trade. This will be calculated using a fake stop loss placed 1 X ADR away from the entry.

--- ADDITIONAL TRADE ENTRY SETTINGS ---

Lot multiplier for add on trades - This will increase/decrease the lot size of the add on entries taken in each position by the multiple you enter.

Distance between trades (percent of ADR) - The distance as a minimum between each trade in a position. The is a multiple of the ADR (average daily range) of the instrument. e.g. entering 0.75 here would mean trades are spaced 3/4 ADR apart or 75% of ADR.

Signal candle must close above next entry line (open if not) [ADDED in v1.71] - If set to true, additional trades will only be taken when the signal to enter occurs IF the close of the candle is beyond the minimum distance between trades you have selected. If set to false it will enter if the candle OPENS above the entry distance but the close can be anywhere. The latter can give you trades which are less than the required distance apart if a large candle (for example news spike) causes a signal to enter a new trade.

--- EXIT TARGETS --- (as percent of balance)

Single trade target (0=disable) - This is the percentage of your account you want to target if there is just one single trade taken. This is a "one shot" trade where the price moves in your favour without requiring additional entries.

Multi trade (position in single direction) target (0=disable) - This is the percentage of your account you want to target for a position (more than one trade in the same direction). 

Multi trade (long & short combined) target (0 = disable) - This is the percentage of your account you want to target if all combined trades (longs and shorts) get into profit.

--- EXIT TARGETS --- (as an amount of money) [ADDED in v1.5]

Single trade target (0=disable) [ADDED in v.15] - This is the amount of money you want to target if there is just one single trade taken. This is a "one shot" trade where the price moves in your favour without requiring additional entries.

Multi trade (position in single direction) target (0=disable) [ADDED in v1.5] - This is the amount of money you want to target for a position (more than one trade in the same direction). 

Multi trade (long & short combined) target (0 = disable) [ADDED in v1.5] - This is the amount of money you want to target if all combined trades (longs and shorts) get into profit.

--- EXIT TARGETS --- (as a percent of ADR) [ADDED in v1.7]

Multiple of ADR to close all trades (0 = disable) [ADDED in v1.7] - This is the multiple of the current ADR of the instrument being traded that you would like to exit all positions at. This is a calculation in pips.
e.g. is ADR is currently 100 pips and you enter 1.5 as the multiplier the EA will exit all trades when the total profit in pips is 150. 

--- DRAWDOWN CONTROL SETTINGS ---

Perform drawdown control based on percentage in drawdown - If set to true the EA will automatically scale out of your trades when they hit a percentage in drawdown which you set below.

Percent of account for single trade to start dd control - This is the percent of your account you want to start partially closing the individual trades at. This is done per trade and not on combined positions.

Percent of trade size to close out - This is the percent of the trades lot size you want to close out when the drawdown target you set above is hit. e.g. if you have a trade with 0.50 lot size and elect to close out 50% of it the EA will close 0.25 lots.

Perform drawdown control based on number of open trades [ADDED in v1.5] - If set to true the EA will auto close your oldest trade in a position if the max amount of trades is exceeded.

Max open trades allowed - closes oldest above this number [ADDED in v1.5] - The maximum number of trades you want to have open at any time.

Close all trades at max DD target [ADDED in v1.7] - If set to true the EA will close all open trades on the instrument being traded when the drawdown as a percentage of account reaches the set level.

Percent in drawdown to close all trades in loss [ADDED in v1.7] - The percentage of your account balance the EA will use to close all open trades on the instrument.

--- AGGRESSIVE DRAWDOWN CONTROL SETTINGS ---

Take aggressive drawdown control trades - If set to true the EA will attempt to get out of a position using aggressive drawdown control. This will make the EA take the next trade using a percentage of the total lots you have open and it will use a traditional stop loss placed 1/2ADR away from the entry price, this allows the trade room to breathe. You can manually adjust the stop loss if required once the EA has placed it for you. The idea of these trades is to get you out of the positino quickly using a move in your favour.

Percent of open lot size to use for aggressive positions - This is the percent of open lots the EA will use to place the aggressive DD control trade. If you have 4 trades open totallying 1.00 lot and the setting is to use 50% then the next trade will not use the normal lot scaling system and enter a trade at 0.50 lots (50% of the total open lot size).

Percent of account in DD to start aggressive dd control - This is the percentage of your account balance you would like the EA to start doing aggressive DD control entries. This if the total drawdown on this one position (instrument).

--- RSI MEAN REVERSION STRATEGY SETTINGS ---

The RSI strategy is designed to use a higher timeframe RSI as a market condition and then an entry on a lower timeframe when the market is stretched or extended. The RSI reading is updated every candle on the lower timeframe using the settings below and works on the current candle on the timeframe selcted.

RSI period - The RSI period to use for the RSI strategy

RSI type The RSI type to use for the RSI strategy

RSI timeframe The timeframe to monitor for RSI extensions with the RSI strategy. This would typically be a higher timeframe than the EA is trading on but you can also use the same timeframe although entries will be harder to achieve.

RSI high trigger The RSI high level for entering short trades with the RSI strategy

RSI low trigger The RSI low level for entering short trades with the RSI strategy

Last closed candle must be above/below level [ADDED in v1.5] - If set to true the EA will require the RSI reading of the last closed candle to be above or below the set trigger levels rather than the default setting which uses the live RSI reading.

--- ADR REVERSAL STRATEGY SETTINGS ---

Percent of ADR to take trades - The percent of ADR price must have moved today for the ADR reversal strategy to start monitoring for trade entries.

--- MA ENTRY SIGNAL SETTINGS ---

The EA uses a very simple entry method to enter trades based on a moving average. This is a proven method of identifying strength and weakness over a short period of time and you can fine tune it using these inputs.

MA method - The MA method you would like to use for entering trades

MA type - The MA type you would like to use

MA period - The MA period you would like to use

--- AUTO TRADING TIMES ---

The EA will only operate between the times set here which should match your brokers candle times. The idea of this input is to stop the EA taking trades or doing drawdown control when there are large spreads in the market, typically around the overnight swaps. You could also use these inputs to only trade specific instruments when there is expected volatility. e.g. only trage GBP pairs from 8am UK time to 6pm when the markets in the UK are open.

Market open time on brokers chart - The start time you want the EA to monitor for trading activity

Stop trading time on brokers chart - The end time to stop monitoring for trading activity

--- TIME BASED EXITS ---

Close trades on Friday at set time - True or false entry, if set to true the EA will close ALL trades at a set time on a Friday to avoid weekend holds on positions.

Candle time to close on Fridays - Enter the time HH:MM on Fridays when trades will be closed. Make sure that the time on the candles of your broker are available on the timeframe you are trading on. e.g. if using 1 hour charts to trade there is no candle at 22:45 so you would use 22:00 or 23:00.

Exit after set number of hours - True or false entry, if set to true the EA will close each trade as it hits the amount of time set.

Exit individual trades after amount of hours passed - This is a simple number entry and any trade that reaches this amount of hours will be closed regardless of whether in profit or loss. 

--- MISC SETTINGS ---

Allow multi direction trading (hedging) - If set to true the EA will look for ANY trade that matches the entry critera and scale in accordingly to positions. If this is set to false and there are trades in one direction it will not take trades in the opposite direction until all trades are closed.

Delete objects on chart when EA is removed - Then the EA stops working all drawing is removed from the chart.

Shift text labels forward (candles) - This shifts the text labels drawn at certain lines on the chart either forward or back.

Offset for pending orders - The offset for pending orders that you take manually with the trade buttons and will be above or below the candle high and low depending on direction.

Update data on bar not tick (much faster backtesting) - If set to true this will only monitor for profit and loss every time a candle closes rather than on each tick.
IMPORTANT NOTE: Results here will vary from testing without this set to true and it's advised not to use it for reliable backtesting but can give you a very good indication quickly if a strategy is worth pursuing further. Use this set to false and test at tick level for more reliable results.

Data update interval - Set the time interval between checking for updates.

Export a daily summary to files folder - This will place a csv export file in the files folder of your terminal with various data about the days activites including the open trades, drawdown, ADR readings and account balance information. If you are running on a live account it will be in the MT4 > files folder and if you are running in the strategy tester it will be in the tester > files folder.
NOTE: This only works in live trading in MT5, the MT5 tester is unable to generate exports. If you would like to use that functionality you can download the demo version for MT4 to do that.

Name applied to export file - This is the name that will be used for your export. The format will be [INSTRUMENT] + [NAME]. e.g. if you run a test on GBPUSD and in this input name the file "my test" the exported file will be called GBPUSD - my test.

ADR number to use for ADR calculations - The ADR number used for calculating ADR. This is used in the ADR strategy for initial entries and also for scaling into trades and calculation of lot sizing. 10 is the default but you can test different settings and use this along with the export functionality to see how ADR changes over time.

Show buttons for use in tester - When true you can use the trading buttons in the strategy tester to take trades and close positions out which allows you to test your own strategies you would like to position trade with. 

Show the speed buttons in tester (MT4 ONLY - NOT REQUIRED IN MT5) - When set to true this will display 8 small buttons on the bottom left of the chart when in visual mode in the strategy tester. These buttons will speed up or slow down the strategy tester (8 = fast, 1 = slow) and are designed to give you more control when you have the speed slider set to the default top speed (32) in the strategy tester. This speed is often too fast to manually test your strategy using the trading buttons and gives you more control over the speed in the tester.

Use a maximum overnight swap limit [ADDED in v1.71] - If set to true the EA will only take initial entries (automatically using ADR or RSI entry strategies) if the overnight swap rate is within the maximum you set. This avoids taking positions that have a costly overnight swap rate that can grow very large if positions needs to be held for a long time. NOTE: swaps are based on interest rate differentials and change as interest rates do.

Maximum negative swap costs to trade - This should be entered as a negative number (e.g. -5.50) and if the swap fee is greater than this the EA will not trade.

Show trade buttons on chart for live trading [ADDED in v1.71] - If set to true the buttons will show on the chart so you can use them to take initial trade or close positions, otherwise they will be hidden so you dont accidentally press them! ;)

Magic Number, (leave default unless multi pair/one terminal) - This is not required and should be left as default unless you are trading on two charts in the same currency but that is NOT recommended as it may cause the EA to operate erratcally. If you would like to trade more than one strategy then it is recommended to use different trading accounts for each strategy.