Description of ForYou expert advisor

Description of ForYou expert advisor

18 February 2019, 12:51
fxhh
[Deleted]
5
867

Last Update 02/Oktober/2019 v5.8

Fully automated.

Expert advisor EA ForYou trades EURUSD and GPUSD in Asian time trade window.

EA ForYou realizes famous Hamster strategy with extended trade window and additional pair GBPUSD.

Current version is v5.9. Please use set files vor v4.2.

You can find them in comments section 238 page12 :

https://www.mql5.com/en/market/product/32833#!tab=comments&page=12&comment=12294499

EA ForYou has two working modes : Trade mode and Recovery mode. As soon as recovery condition (Draw Down) is reached recovery mode is started, trade mode will be ended. Current positions either get close with profit or hedged. Followed by recovery algorithm. As soon as recovery is finished, trade mode will be started.



List of parameters :


MagicS1  every expert advisor needs a magic number to identify its own positions. Magic number is a technical attribute attached to every opened position and might be empty or filled depending on your trade style (manual or automated). With EA ForYou identification is done on pair and 'magic number'. You need  2nd magic number when running M1 and M5 time frame on same pair.

Example for valid MagicNo and pair combination : EURUSD-M1-81904, EURUSD-M5-81903, GBPUSD-M1-81904, GBPUSD-M5-81903. You can  run all 4 combinations with 2 magic numbers if you like. It is not neccesary to change different Magic numbers for GBPUSD and EURUSD as long as you run only one chart per pair. As soon as you use more than chart on a pair you will need a 2nd magic number. Delivered set files are fine with magic numbers inside set files.

profile  this parameter is for information only and will be shown up in 1st line of charts panel. Sometimes parameters get lost on upgrade or handling. Make sure profile name (you are free in naming of course or leaving empty) match pair and time frame. Set files contain profiles like 'EURUSD M1' and are designed for indicated pair and time frame. A single look at terminal will ensure charts and time frames match.

comment  this value will be transported to positions 'comment' field and informational only as profile parameter. On run time written value will extended by internal information as kind of trade (buy or sell), kind of triggering signal (1 to 4) and number of order (0 to 7, how much depends on parameter maxorders). If empty internal information will not be written. Thus you can hide expert advisor or kind from broker. The only information broker will have is : you are trading automated. Wide SL and TP will hide nature of trading as well.

hedge If you are not allowed to hedge set to false, default is true. If you can't hedge you will loose a few trades , not many. Beware with non hedging acconts you cannot use common recovery mechanisms.

Lots  start balance per position in combination with parameter perbalance. If Lots is 0.01 , EA For You will open 0.01 on each perbalance of your account's blance. example : balance 1000, Lots=0.01,perbalance=200. EA ForYou will open 0.05 for every position.

perbalance  if set to value >0, see description Lots. If perbalance = 0 EA ForYou will run with position size Lots. Example: balance 1000,Lots=0.0.1,perbalance=0.  EA ForYou will open 0.01 for every position.

Note, that delivered set files are optimized in money management in combination with parameter close_percent. If you lower the resulting position size you may lower close_percent as well.

distance  distance between positions in pips (default -1=off) EA ForYou computes distances on market conditions a fixed or minimum distance shows negative results in backtest. EA ForYou is not a grid system, every position lives on it's own AND in community, like people in villages ;)

max_volume upper limit size of single position. This is for bigger accounts. Brokers might have liquidity problems in the night with sizes from 2 Lots or higher. Or you want to keep a stable trading volume and lower your total risk from trade to trade by not increasing  position size. Note that position size in dynamic mode is affected as well. This is not a problem and might be used this way.

vTP  virtual Target profit per position. This value should always be set to 5. EA ForYou will use this value as basis for calculation and might close with different realized target profit. EA ForYou shows calculated accumulated vTP in panel. Values vary from 2.5 to 5 pips and might be risen to 8 or 10 pips on suitable situations. Anyway  EA ForYou wiull close below or above indicated value and does not work with fixed TP.

TP,SL technical target profit and stop loss. EA ForYou controls positions  with open and close conditions and does not use TP and SL to hit. Brokers and market intend to touch SL and nearby TP to maximize their profits. That's why professional software hides real values. We should never touch, closing is done by other parameters.

consider_comm if set to true, EA ForYou considers commission and restricts percentage of profit to broker with max_brokers_profit_percent. Advice : leave to false, it's almost dangerous to request a higher rate for yourself.

max_brokers_profit_percent percentage of profit given to broker as a maximum. examples :  profit 10 €/$  , commission 2 €/$, max_brokers_profit_percent=20. EA will close, 8 €/$ will be realized netto profit. 2 €/$ are taken by broker.  profit 8 €/$  , commission 2 €/$, max_brokers_profit_percent=20. EA will not close yet , it needs 10 $/€ to fulfill condition.

comm_per_lot_in_backtest for baktest only. Your broker takes this value for round turn on 1 Lot. It depends on base currency of your account as well. For exact value see trade conditions for four broker, account type, base currency and traded pair at your brokers web page.

rsi_buy opening filter for BUY positions. position will be opened if RSI is at a low value.

rsi_sell opening filter for SELL positions. position will be opened if RSI is at a high value.

maxspread : positions are opened and closed if current spread is not higher than maxspread. On ECN accounts maxspread 15 is good for EURUSD, 20 for GBPUSD. This prevents pip stealing by broker/market in higher spread conditions during night and high volatile situations over day.

open_max_percent: if accounts overall draw down is higher than this value, EA ForYou will not oen new first positions. Note : EA forYouz will continue to trade open baskets and will open consecutive needed postions on this basket and try close. If draw down continues, no new first position will be opened then.

close_on_counter if set to true positions will be closed on counter signal under special conditions. Default is true.

rsi_sell_close, rsi_high_close RSI values for counter signal.

close_percent draw down percentage of current chart (magicno and pair identification) to close all positions in that chart. Positions of other charts are nor considered nor will be closed.

BE_order_use usage of break even mechanism. Default true. EA ForYou will try to close with BE_order_pips for each position in special situations.

BE_delay_hours a single position will be closed with break even points when market doesn't show impulses to open an other position and price doesn't reach calculated vTP. EA ForYou will try to close position after BE_delay_hours hours.  Special situation with a single position closed after BE_delay_hours is realized no matter if BE_order_is_maxorder set to true or false or what value is in BE_orders parameter.

BE_order_pips pips per position to close in special situations in usage of break even mechanism Value is lower than vTP.

BE_order_is_maxorder when true EA will use break even mechanism if  open orders is equal maxorders.

Example : maxorders=8, open orders=8. EA ForYou will ignore parameter BE_orders and initiate break even machanism in special situations.  maxorders=8, open orders=6. EA ForYou will try to get vTP calculated pips for each position.

BE_orders if BE_order_is_maxorder is false, break even mechanism will be active when open positions are greater or equal this value and BE_order_is_maxorder is false.

It is advised to initiate break even mechanism below maxorders, thus BE_order_is_maxorder is set to false, BE_orders =maxorders -1.

close_avg_SL if accumulated averaged pips (negative)  exceed close_avg_SLK value basket will be closed. Example : 6 positions, close_avg_SL=300 (positive value!). As soon as loss exceeds -300 pips (negative value !) , all positions belonging to that basket will be closed. Other positions belonging to the chart will stay open.

exit_in_percent close in profit as soon as x percent floating profit in basket. A default value of 1(%)  showed up best results. Profit is a bit higher as without, but more important : safety on fast movements and fall backs without reaching exit signals

start_time begin of trading time window, server time

end_time end of trading time window, sever time

start_time and end_time need to be adapted on broker and summer/winter time. default values are 23 o'clock and 3 a.m. Asian trading session begins at 1.a.m int hat window and broker interrupts trading at 24.00/0.00. From 24.00/0.00  to 1 a.m. spreads increase. You will see up to 100 points on GBPUSD and 50 on EURUSD. EA ForYou will not open or close on that high values. Trades are either closed before midnight or almost contined after Asian ttrading time starts.               

                     start_time   end_time

GMT+0        21                1

GMT+1         22               2

GMT+2         23               3 (Default)

GMT+3         0                 4

GMT+4         1                 5

GMT+5         2                 6

GMT+6         3                 7

GMT+7         4                 8

GMT+8         5                 9

GMT+9         6                10

Note : Do notset trading time from 1 to 3. This is not EA Hamster, this EA ForYou, catching trading signals from 23.00 to 3.00 and am ist it's triggered at 23.00 !

close_time hard close of all positions (default -1 =off) Positions will be closed at this time with profit or loss at is shows up.

holidays if set to true EA ForYou will not start new first positions on christmas time December/January, but finish opened trades initiated before holiday time.

lastday12  last day to open first position in December. Default (December) 15th

firstday01 first day to open first position in January. Default (January) 4th

friday_logics if set to true, EA ForYou will not open new first positions after Friday friday_stop_time

friday servers weekday when market will close. If GMT offset of broker's server is very different from GMT this could be a different day. 'Friday' should be fine in most cases.

friday_stop_time server time to prevent open new first postions. All existing positions will be left open and new positions are added after that time to exiting baskets. Default 12 (noon). then panel will indicate Fridays stop (if no position is open from day before).

Backtest does not show disadvantages of trading over weekend, but a risk of unforseen global events with impact on pairs exists of course. Positions kept over weekend will suffer from added swap fees if negative swap on deal.

allow_url_in_mt4_options fixed informational value http://ec.forexprostools.com/ to enter in terminals options Tools->options->Expert advisor->Allow WebRequest for listed URL. News filter will only work with allowance for WebRequest and show up erros otherwise.


AvoidNews  Switching news filter on/off

IncludeMediumNews Include medium news to prevent start of new first trades. High news are always included if AvoidNews is set to true.

StopMinutesBeforeNews/StopMinutesAfterNews time window in minutes to prevent new first positions around news event. Panel will turn to beige in news time.

showInfo switch panel in chart on/off

color map of panel:

  • blue   : waiting
  • green : trading, in profit
  • red    : trading, in loss
  • grey   : trading is switched off by user
  • beige : news time

showButton switch activity and status buttons in chart on/off

verbose write verbose log (default false)

********** recovery mode section **********

recover=true  Default is to recover. All parameters from trade mode section except maxspread are ignored then, close_percent will not close baskets with draw down in loss.
rec_percent=25.0  start recovery on DD of current basket
xr2==== release pos., computed or fix
release_size_auto=true   if set to auto release_size will be calculated from your balance.
release_size=0.01          release_size otherwise when  release_size_auto=false. This positi size is the size that will be released from original ForYou trade position(s). Partly close operations almost.
xr3==== release pos., distance to price
distance_to_release=near   either far(est) or near(est) position related to current price. Default is near.
xr4==== hedge pos. Magicno offset
MagicRh=1000      This offset will be added to MagicS1 to generate a unique Magicno for hedge positions. If your trade magic no MagicS1 is 81903, hedges will get the magic no. 82903=81903+1000

force_hedge_from_dd=0 : hedger is easier to be set if dd of 40 or higher is reached. (On values below Total Recovery prefers working with possible rebounds without forced hedges).

hedgeclose_max_dd=40; a hedge may be closed in total as T-H-Oclose if trend changes. It will be restored on next trend change. This will not be performed if DD>70%

xr5==== operational pos. Magicno offset
MagicRo=2000      This offset will be added to MagicS1 to generate a unique Magicno for operational positions. If your trade magic no MagicS1 is 81903, operational positions will get the magic no. 83903=81903+2000

buy_allowed=true allow operational buys
sell_allowed=true allow operational sells

xr6==== op. start pos., computed or fix

start_size_o_auto=true if true operational start size start_size_o will be calculated from your balance
start_size_o=0.02
xr7==== op. next pos., max no., size and distances
max_pos_o=10       maximum no of operational postions at a time
multiplier_o=1.25  martingale multiplier for operational positions
distance_o=20.0   minimum distance between operational positions
distfac_o=1.1       distance multiplikator for distances between operational positions

xr8==== total profit in currency units on each MinLot close
profit_per_MinLot=1.0 total profit in currency units on each MinLot close od release position. If calculated release_position is 0.04, at least 4 currency units will be required as profit on close.

xr9==== time frame recovery ===
time_frame_rec time frame for for triggering operational (=recovering) positions
xrM==== recovery trigger type ===
rstype= choose between HeikenAshi,Bollinger Bands, PSAR signal and pure grid PGRID for triggering operational (=recovering) positions


Share it with friends: