Attachments forums

List of attachments posted on this forum.


All files on forums: 134145

Blessing EA for MT4

mrtools, Sun May 07, 2017 6:13 am

Blessing EA


Features

  • Works on multiple pairs
  • Multiple Entry Control Features (3888 entry types)
  • BUY/SELL trade entries or STOP/LIMIT trade entries
  • Grid Trading Strategy with many control features
  • ShutDown feature, stops B3 trading after basket close
  • Emergency Close All Feature
  • Holiday Shut Down Feature
  • Order Management/Checking Conditions
  • Email Management – B3 talks back to you
  • Grid Array Generation based on user input
  • Take Profit Trader
  • Stealth TP trader – no TP sent to broker
  • Stealth SL feature – no SL sent to broker
  • Can manage Manually added trades
  • Profit Trailing Stop Feature for extra profit
  • Close old trades feature, draw down reducer
  • Exit trades early feature
  • Current or Correlated pair Hedging capabilities
  • Recoup loss function
  • Recoup broker commission and swap function
  • Additional trades added to “basket” incrementally
  • Power Out Stop Loss Features – SL is sent to broker
  • Portion control feature
  • Manual account type selection
  • Stop Trade Balance Protection
  • Equity Stop Loss Protection
  • Automatic broker decimal selection
  • Chart overlays to monitor trades and account
  • Manual or automatic money management features
  • Broker spreads are not an issue
  • Manual or Automatic trade magic number selection

How to Use Blessing

Blessing is placed on the hourly chart or, quite frankly, any chart period you desire to trade. Blessing, in its basic strategy, was designed to trade the USDJPY pair on the daily chart. Newly added features have allowed Blessing to trade other timeframes and pairs. These new features have created a better return and lower drawdowns on the hourly timeframe.
Blessing shows great potential on the one minute charts trading the EURCHF pair. Set files are being developed and will be posted outside the purview of this manual. Simply applying the tested set file to the timeframe and pair listed in the set file name will allow you to trade Blessing with that pair.

Entry Settings

Blessing traditionally uses pending BUY/SELL LIMIT/STOP orders to open the first trade of a grid. If the setting B3Traditional is set to true, it will continue to trade in this fashion. If B3Traditional is set to false, Blessing will place an instant BUY/SELL order when a trade is triggered. For the purposes of this manual, all examples will assume that B3Traditional is set to true (its default setting).

Blessing now uses up to five indicators in its entry decision making process. You can use them all together or separately. The UseAnyEntry feature allows you to tighten your entry decision. By default, MA is turned on as the base indicator. If you elect to turn on the other indicators, Blessing can use them all to determine entry, or use the first available entry from the indicators.

Indicators

Each of the 5 standard entry indicators built into Blessing has a user setting which can have one of 3 states: If the entry method is set to 0, then that entry method is disabled, and will not be used. If the entry method is set to 1, then it will act as normal, placing a trade if the entry conditions are met. If the entry method is set to 2, then it will trade in reverse, i.e. if the entry triggers a BUY STOP/LIMIT order, then Blessing will place a SELL STOP/LIMIT order.

Moving Average (MA)

Original designs of Blessing yielded an Expert Advisor that relied solely on the Moving Average. The MAEntry was set in the menu with the period set in MAPeriod and Blessing used this simply to place its first grid set of a BUY/SELL STOP/LIMIT at 25 pips. The idea was to always have Blessing placing the grid once the basket of trades was closed. Occasionally, the direction was not perfectly selected. After all, it could simply be a flip of a coin (long or short)! Blessing didn’t make money with perfect entries but profited solely on the size of the grid.

Commodities Channel Index (CCI)

CCI was added as another indictor to MA. CCI looks at prices on the M5, M15, M30 and H1 timeframes of that pair for the period set in CCIPeriod, and if the CCI is “trending” the same on all 4 timeframes, that trend is used. CCI is user selectable via the CCIEntry menu set item. The direction of CCI for the 4 time frames can be viewed on the screen by setting DisplayCCI to true in the Display Control settings.

MA Channel

Neither MA nor CCI had the ability to define a ranging market. By default, Blessing believes we are in a ranging market and it’s through MA calculation or CCI calculation that we determine whether the market is moving up or down. However, Blessing was quick to determine up or down, ruling out ranging altogether! Not any more! Blessing's capabilities now define a window of a ranging market. Blessing uses a channel set by the user in number of pips.
If a user sets the Ma Distance variable at 5 pips, a channel is drawn around the MA, 5 pips above and 5 pips below. If the BID price happens to be in this channel, MA leaves Blessing in its ranging market condition. This is important because if we are using MA or CCI and it’s time to place a trade, should the market be ranging by Blessing's definition, it will place a BUY STOP and SELL STOP around the current price condition.

Entry Delay

Later iterations added a slowing feature. This allowed Blessing to wait for the number of seconds set in the EntryDelay setting before placing the next LIMIT trade hopefully stopping a runaway grid in the wrong direction. This worked very effectively and made trading on the USDJPY stable. However, concern existed for laying the start of the grid based simply on whether the MA or CCI said long or short so the Bollinger Band (BB) feature and Stochastic (Stoch) confirmation were added as user selectable indicators.

Bollinger Band Indicator

As stated previously, MA is always on by default. Based on the period set by the user, TREND UP or TREND DOWN is displayed in the overlay. If the Bollinger Band function is turned off, MA is used to lay the grid. This is how Blessing has always worked up until now. Blessing gives the user the ability to now use BollingerEntry as an entry feature.

Users familiar with BB realize BB is a powerful indicator that “channelizes” the prices. Movement outside the bands is rare and when it happens, chances are a correction to the price to bring it back within the bands should happen. There are many user selectable items that could have been programmed into Blessing but having all of these items in the menu would have made Blessing unusable for most. The typical BB channel, upper and lower bands of the channel, are calculated based on a standard deviation away from the mean average of the MA. Usually 2 times the standard deviation is average and is what most traders use. Although user selectable with BollDeviation, it’s not recommended that the BB deviation is altered from 2. BollDistance and BollPeriod are what controls the “tightness” of the channel to price. 15 or less on the period and 13 or less on the distance will determine how often price touches or goes through the price channels of the BB indicator.
Once BollingerEntry is on, it looks for the condition where price is outside the bands. If outside the bands it will place a short trade if above the upper band or a long trade if below the lower band. Since price will typically move back the other direction, Blessing will usually take a profit after one or two trades. This leads to a lower draw down over time and a better grid selection.
Anyone used to the previous versions of Blessing will have noticed that the BB entry would place instant BUY/SELL orders. In order for that to happen in this current version, B3Traditional must be set to false.

Stochastic Indicator

The Stochastic indicator is turned on in the menu with StochEntry. The Stochastic indicator is used to determine whether the market is in an overbought or oversold condition.
Usually Stoch above 80 is an overbought condition and less than 20 is an oversold condition. Setting the BuySellStochZone menu item to 20 creates these “zones” in the math and will help to confirm the trade. The user can select the typical KPeriod, DPeriod and Slowing Stoch parameters via the menu selectable items, but the default settings have shown to be best when left at 10/2/2. Changes in the values have not shown huge changes to the entry conditions of Blessing but the changing of the sensitivity of the zone has. Setting the zone to 20 yields more weight given to the Stoch confirmation. Users should select something a value of 20-50 if StochEntry is on.
If the Stoch zone is set less than 50, then Stoch typically places fewer starting trades. Having Stoch on yields fewer trades but hopefully a better direction and a better grid for profit.

MACD Indicator

The MACD indicator is one of the simplest and most effective momentum indicators available. It can be turned on with the MACDEntry setting.
It compares the Moving Average for two different periods (FastPeriod and SlowPeriod), and uses a signal line, which is the MA of the difference based on the period set in SignalPeriod. Blessing will place a LONG trade when the Main MACD line is above the Signal line, and a SHORT trade when the Main is below the Signal.
Forced Market Condition
Blessing can use the above indicators to determine the entry but to add more control over your entry direction, the ForceMarketCond variable was added. Essentially, you tell Blessing via this menu set item to only trade in one direction.
Used in conjunction with the other indicators, you can trade the direction you desire, when ever you desire. With all 8 of these direction determining and entry decision variables, Blessing has 3,888 different ways to enter the first trade.

Blessing Strategy

Blessing is a Grid Trader. Its basic design is to use MA to determine market conditions and bracket the current price with a STOP and LIMIT order to profit in that direction. You may now select/change the capability of Blessing to place just a BUY trade or a SELL trade instead of STOP and LIMIT trades to start its trading routine. If the direction is long, BUYS are used to take profits. If the trend reverses, BUY LIMITS are hit and profits taken on the reversal. If the direction is short, SELLS are used to take profits. If the trend reverses, SELL LIMITS are hit and profits taken on the reversal.
You now have the capability to reverse the grid. Instead of place a BUY STOP/LIMIT if the market is long, you can force Blessing to place a SELL STOP/LIMIT. This reverse feature is user selectable via the menu set item.
Once the direction is determined and trading is started, Blessing uses LIMIT trading to add to the basket of trades. Blessing starts placing trades by bracketing the current price with STOP/LIMIT trades in a proprietary fashion. This proprietary fashion using the MathMod function sets the STOP/LIMIT trades around the current price at distance of approximately ½ the pips defined by the first grid value, 25 in this case. A user has the ability to adjust the MathMod feature of Blessing using the EntryOffset parameter. Once either the STOP or LIMIT is hit creating the first trade, subsequent trades are placed a fixed distance of 25 pips either side of the current price. Each LIMIT trade added is placed 25 pips above/below the last trade. The 25 pip amount is used until 5 open trades are out. If the user selectable feature of B3Traditional is set to false, then the grid is started using a BUY or SELL. The EntryOffset has no effect if this feature is used. The sixth trade (LIMIT trade) is placed 50 pips above/below the fifth outstanding trade. This 50 pip amount is used until 9 total trades are open. The tenth trade (LIMIT trade) is placed 100 pips above/below the 9th trade. This 100 pip amount is used for all remaining trades placed.
For this strategy, each LIMIT trade added is called a “level”. The number of trades at the 25 pip difference and the number of trades at the 50 pip difference is user selectable with SetCountArray, and the number of pips difference in each block is user adjustable with GridSetArray.
Remaining trades (10th level and beyond) placed at the 100 pip range is user selectable also. 25/50/100 remains Blessing's set grid but the grid can be squished or auto calculated (discussed later) without changing individual numbers listed in the menu.
The Take Profit values are just double the grid values and are set with TP_SetArray. 50/100/200 pips are the Take Profits that are coded into Blessing and can be modified via the menu. All these values are placed in an array defined by the user. The array is a uniquely new feature to Blessing and can be manipulated in any way by the user.

Blessing Grid Management

The default values in the array are set via menu set items. It is important to understand how this array functions before attempting to modify the default values of Blessing. All a user needs to know is simply this. There needs to be one less number in the SetCountArray than there are in the GridSetArray and TP_SetArray variables. Why? The SetCountArray uses the MaxTrades variable as its “ceiling”. Since this variable is already set, the GridSetArray doesn’t need that number.
A user, with the array, has the ability of creating any grid they desire! This powerful feature will allow power users to explore different ways to trade with Blessing. A user can have as many blocks as they desire with various Take Profits for each. For example, if a user wants a 5 block grid (6 blocks in the end!) that varies from 1 trade in the first block to 8 trades in the last, they simple need to set the array with 1, 2, 3, 5, and 8 (1,2,3,5,8 for the menu). This means there will be 1 trade in the first block, 2 in the second, 3 in the third, 5 in the fourth and 8 in the fifth. The spread of the grid comes next. A user sets 16, 34, 68, 112, 168, and 180 (16,34,68,112,168,180 for the menu). This means the first trade will be placed 16 pips from entry (coupled with the Entry Offset and MathMod function). The next two trades will be placed 34 pips apart defining block 2. The next three trades will be placed at 68 pips. The next 5 trades will be placed at 112 pips. The next 8 trades will be placed at 168 pips. And now, if you remember, the final trade(s) will all be placed at 180 pips at MaxTrades minus the total of the trades in the array. In this example, there are 19 trades in the array. If MaxTrades had been set at 20, the last trade will be placed at 180 pip distance.
The Take Profits are set similarly. For each grid block there needs to be a Take Profit. In this case we will use 32, 68, 136, 224, 336, and 360 (32,68,136,224,336,360 for the menu). We won’t go into detail but Blessing will set the Take Profit when the next level of the grid is asked for during trading. As you can see, the array is a powerful feature for Blessing.

Auto Calculation of Grid and Grid Adjustment

Auto Calculation is based on the Average True Range (ATR) indicator. The number of trades per block is base on the number in the SetCountArray. The remaining block runs up to the Max Trades number. The ATR indicator is based on a 21 period cycle of that pair and is not user selectable. This allows the user to create a “breathing grid” based on that pair’s volatility. If a user wanted to auto calculate the grid they simply just set AutoCal to true. What will it yield? It will find the first number, replace the default value of 25 with that new number then use a multiplication factor of 2/2/2/1.5/1.5. The grid blocks could look like 21/42/84/168/252 if AutoCal finds 21 pips as the ATR for that pair. The Take Profit values would then be 42/84/168/252/378.
A Grid Adjustment Factor (GAF) is also provided and is independent of the AutoCal feature. This gives the user the ability to widen or squish the grid based on the percentage value set. Leaving the GAF at 1 will leave the first grid number at 25 pips. Setting the GAF at .65 will change the first grid number to 16.25 (16) and the grid is now set at 16/32/64. The Take Profit values would then be 32/64/128.

A user can use both the AutoCal and GAF together, separate or not at all but it is through these functions where the user can control the size of grid that is laid out for trading. A user can use a GAF with their own defined grid array as well. There is a multitude of ways to create a grid with Blessing.

Integral to laying out additional trades, Blessing adjusts the lot size for that trade based on a user selectable Multiplier. Every trade added as a LIMIT has a lot size incrementally larger than the previous based on the user selectable Multiplier. This Multiplier is directly tied to the Money Management routine developed in Blessing and is proprietary to Blessing's routine. The Multiplier and how it is used is explained in the Money Management Section.

The number of trades placed is user selectable. Because Blessing places trades incrementally higher, the potential for larger draw downs may happen. Potential profit compared to the total number of trades out decreases dramatically above 10 total trades. In other words, the draw down due to placing the 10th trade becomes large because of the Multiplier increasing the size of the trade. The large draw down now becomes a factor if the trend continues against the basket and a potential to hit Equity Protection looms. A user can limit this potential further by simply stating, via MaxTrades, the maximum number of trades that can be placed. Additionally, this large basket potentially bumping Equity Protection is stressful to even an experienced trader.

To get out of a basket of trades sooner by not going for a profit but by simply breaking even, a user can set a break even trade number in the menu. If BreakEvenTrade is set at 12 for example, should the basket size reach 12 trades, instead of going for a profit, Blessing will close out the trades once the profit of the basket reaches zero. With 12 trades out, Blessing would need a larger reversal to get the profit it calculates. If a value is entered in BEPlusPips then when the BreakEvenTrade has been reached the basket will close at a profit of BEPlusPips instead of Break Even. Note that if BEPlusPips is negative then the basket will close at a loss. We also have the ability to utilize the Emergency Close All Function. More on that later.

Blessing uses a proprietary method to calculate the profit potential of the basket of trades that are currently open. Blessing takes the total number of trades out, uses the value of pip movement for the lot size of each trade then calculates a “Potential Profit”. This Potential Profit is converted to a Take Profit value for all trades then each trade is modified with the new Take Profit value. Profit Potential is displayed on the chart. A user simply needs to look at their chart overlay to determine where that Take Profit Value is set. Blessing does not use a Stop Loss in its profit calculation nor does it send a Stop Loss to the broker, unless the user chooses to send a Stop Loss via the Power Out Stop Loss feature explained later in this manual.

SmartGrid(TM) Feature

Another feature presently added to Blessing allows us to not lay the grid down “blindly”. Blessing sets LIMIT trades base on the entry delay and number of pips set in the grid. Instead of putting LIMIT trades out, Blessing now has the capability to monitor the next level and if market movement allows, Blessing will add the next level via a BUY or SELL. This feature is active if UseSmartGrid is set to true, and is based on RSI over MA and is proprietary to Blessing. Users can experiment with the default settings but using SmartGrid will give you more controlled entries for every additional level that Blessing places.

Force Take Profit

Instead of using the standard take profit values set in TP_SetArray, as detailed above, it is now possible to force the take profit to a user defined set number of pips from the break even point with the ForceTPPips variable.

Minimum Take Profit

If you are using SmartGrid, AutoCal, or simply because of EntryDelay, there will be times when the take profit point is only a few pips from break even. While Blessing will ensure that the basket closes at a profit, you can now set a minimum take profit at a certain number of pips from the break even point using MinTPPips.

Blessing Money Management

A wise man once sad, “The safest way to trade is to not trade at all”. That being said, trading in any market, especially FOREX is very risky. One way or another, whether or not we are new, we are reading this because we want to make money. Blessing is an Expert Advisor designed to help us automate our trading and trading involves risk.
How much does someone risk to trade? That’s a great question and we’re still searching for the perfect amount of money to trade. Whether we trade a lot or a little, if we trade FOREX, dangerous waters are right around the corner if we risk more than we should.
Money Management in Blessing helps us determine how many lots we should be trading. Blessing trades in a grid fashion using increasing lot sizes at each level. In addition, an Equity Protection routine is added to Blessing to make it a more viable and safe grid trader.
First and foremost, how much should we trade? Should we trade 1% or 10%? How about 2% to 3% of our account balance or available equity? Everyone seems to have the right answer. Here’s a simple and safe philosophy to use: Simply move the decimal place to the left four times for a standard account and three times for a nano account. This gives us the total “contract” we should have in open trades on our account. That amount is highest we should be trading. If we traded manually, one trade for this amount is it. If we wanted to trade two manual trades we take that figure, divide by 2 and trade those two trades at that new amount. Our contract with our broker is the total of those two trades.

What is a contract? It is the total number of trades we have out on our account. That is our contract with our broker. Here is what that looks like:
Safe trading Contract Size

Account Size in $ Standard Account Contracts Nano Account Contracts
1,000,000 100 -
500,000 50 -
100,000 10 -
50,000 5 50
10,000 1 10
5.000 0.5 5
1.000 0.1 1
500 0.05 0.5
100 0.01 0.1
50 - 0.05
10 - 0.01

Using this chart will help us in our trading. On our $5,000 account, we shouldn’t have any more than .5 standard contracts or 5 nano contracts out on trades. This is safe trading, this is smart trading and it’s the approach Blessing takes for trading money. It doesn’t seem like a lot but it can make us money over time. If we trade this philosophy on a Grid Trader Expert Advisor, we have a more complicated issue to contend with.
A Martingale is a way of “doubling up to catch up”. Blessing isn’t exactly like that but it does use a Multiplier to calculate its next trade based on the current trade. Blessing uses many levels and total profit calculation to make us money. If we let it run, it has the potential of completely wiping out our account (or making us wealthy). How do we trade Blessing using the previous contract strategy and protect ourselves from complete disaster? We first must understand how the Multiplier routine works then we protect our account.

First and foremost, we must make an assumption. Blessing continues to take out trades using its next “Level” (LIMIT trade placed) and in rare cases, it could trade up to 12 trades (or more) at any one time. But Blessing rarely goes past 7 levels and most of the time it trades 4 to 5 levels. It only goes higher if the market isn’t helping out Blessing's trading strategy. This is how accounts are blown up. For the next section let’s assume, at worst, Blessing goes to 7 levels each and every time. A small percentage of the time it may go higher and if it decides to run away, we’ll use Equity Protection to simply stop trading.
With an assumption of 7 levels, we can actually calculate what Blessing will do to us, our trades and more importantly, how many trades we have out (contract). For this discussion, we will assume 7 levels and will enter that number in the menu as default. We can change this assumption via the Level variable and apply the results to the discussion about to follow, however, to keep things simple, we will discuss how the lots are affected assuming only 7 levels. Here’s the math:

x = lot y = Multiplier (amount you are willing to increase each new trade)
Level 1 = x
Level 2 = xy
Level 3 = xy2
Level 4 = xy3
Level 5 = xy4
Level 6 = xy5
Level 7 = xy6
Contract = x + xy + xy2 + xy3 + xy4 + xy5 + xy6

Using simple algebra here’s the formula for finding the number of base lots to trade on a standard account:
Contracts = Account Balance * (.0001) (the safe trading method selection, standard)
(.001) (used if a nano account)

Factor = (y + y2 + y3 + y4 + y5 + y6) (the 7 level assumption) x = Contracts/ (1 + Factor) (equation for base number of lots)
It’s simple to see the elegance of the math and how we can get the base lots knowing Blessing might run the levels up to and past 7. Our Multiplier has a HUGE affect on our trading strategy! Doing the math on, say, a $2,500 account will give us the following:

Multiplier of 1.4
Level 1 = .01
Level 2 = .02
Level 3 = .03
Level 4 = .04
Level 5 = .06
Level 6 = .08
Level 7 = .11

This is a total of .35 trades out on contract which is less than our .5 from our table above. We can see if Blessing decided to go higher, the next level of lot would be a factor of 1.4 greater and so on. If Blessing did this and went all the way up to 12 levels, there’s a possibility of a huge negative P/L (draw down) and probably, Equity Protection might be hit (depends on your tolerance). We need to know this math to trade smarter and safer with Blessing. All this assumed a standard account. We can simply multiply these numbers by 10 (if our account size was $500, the numbers above would be divided by 10) for a nano account and we can see that we’re still within our parameters for safe trading. Intuitively, we should have at least $500 on a nano account to trade Blessing safely.
With these numbers in mind we can see that if we want the base lot to be .01, we back out a contract size of .2385 or $2385 ($2500 for rounding sake) minimum required on a standard account and $239 ($250) on a nano account. To safely trade Blessing we will double that figure. If the formula calculates the lots less than .01, then Blessing will fix the minimum lot size at .01 so we can try any amount we desire all the way down to $10! It is still recommended that Blessing trade with a minimum of $5,000 for all the reasoning previously stated. Knowing that we need a minimum of $500 for a nano account and $5000 on a standard account, the base lot will come out to be .02 so we need a way of “adjusting” the base lot back down to .01 to truly be safe with Blessing. To that end, a Lot Adjustment Factor LAF is added to affect this end and is described later.

Linear Lot Size

Blessing also has the capability of selecting a “different” method of next lot multiplication. Recent studies have shown that even with the safety feature of safe level vs. Multiplier calculation, Blessing has troubles in the out lying levels. The higher the number of trades out, the higher each subsequent lot may become creating an even larger drawdown than expected. Linear lot size was developed to slow the lot size increase.
Using a Multiplier of 1 will increase each subsequent level of trade by adding the base lot to the last lot size. Certainly, this will have an affect on profitability and decrease drawdown but it will provide a user with a safer way of increasing their lot size with each level of trade placed. If the Multiplier is set to less than 1 then the lot size at every level will be equal to the base lot, i.e it will not increase at each additional level.

Lot Adjustment Factor

We now have an idea of how much we can actually trade safely and an even a better idea of how much we actually need to trade. $5000 on a standard account and $500 on a nano account is what we need to trade one pair using this trading strategy. What if we wanted to trade $50,000 or $500,000? Using the chart above, the contract size is 5 contracts and 50 contracts respectively on a standard account. The base lot size would be .2 lots and 2 lots respectively but maybe we don’t want to trade even that much! First of all, good for us since we have done something correct in our lives to have this much money to trade FOREX. Or, maybe we are managing a large account for a group of people. Whatever the case may be, we may not want to trade even the smallest/safest contract from the table.
In this case, we want to be even more conservative so we need a way to adjust the money management calculated base lot size for this contingency. The Lot Adjustment Factor (LAF) will do this for us. In the example above, on a $50,000 account trading one pair, money management will calculate a base lot of .2 lots. We simply set our LAF in Blessing to reduce this amount even further. Today, we want to only trade with .02 base lots on this account so we input .1 as our LAF and our base lot comes out to be .02 lots. Maybe we are feeling good and we want to throw caution to the wind. Although not recommended, we could set the LAF higher than 1. If we set it to 2, on our $5,000 account our base lots would be .04. Based on the previous discussion, this is asking for trouble but the LAF allows us to do this. Portion control can assist us in not only portioning out this large amount by setting and using money management, but also adjusting the lot size to be even more conservative.
Now, all of us who have traded demo accounts for a while have seen a demo blow up. Why is that? Because Martingale trading is inherently dangerous for the reasons we read about earlier and when we are new to this strategy, we want to see bigger gains. So, on our $500 account, we put in a nano lot of .5 lots. We can see how dangerous this thinking can be. Maybe we only have $50 on a nano account. Doing the math, Blessing will blow that account in short order because the smallest nano lot contract we should be trading is .05. The trade levels with a Martingale will kill this account fast. If we put Blessing on many charts on a $500 account, Blessing will kill it. We simply must do the math to see.

Portion Control

We touched on the portion set feature previously. This feature gives our trading even more control than previously imagined. Not only will it identify to Blessing that we want to take our account and divide it proportionally to calculate the proper lot size but it also manages EP even better.
As mentioned earlier, if we have money management enabled, it will properly identify the correct base lot size. If we want to trade multiple pairs on our account, we would want to make sure we have the proper minimum balance for each pair. 4 pairs on a nano account would be $2000. With money management enabled, the base lot would be calculated on $500 for that pair if PortionPC was set to 25 (25%). From the previous formula, that base lot would be .02 for that pair. Again, if we left it at 100 (100%), not only would the base lot be calculated on $2000 (.08 lots), we are allowing Blessing on this pair complete access to the full account. If that pair ran away, it could hit the 50% EP draining our account to $1000 or less.

Portion control controls not just the base lot calculation in money management, it sets the amount of our account we want to trade with this pair. It does this by dividing your account into “portions”. We can use any portion number we desire. 100% would be the whole account, 50% would be half of the account, and 33% would be a third and so on. This has a great potential for us in so many ways.

Let’s go through a few examples and you’ll see what we mean. We have $2000 on a nano account and we want to trade Blessing on this account on 4 pairs. We know that we need a minimum of $500 to trade one pair so we are set with our $2000. If we know each of these pairs are stable, we simply place Blessing on each pair, set the StopTradePercent in each instance to 10 and set the PortionPC to 25. Blessing, on that pair, will calculate the proper lot size for that pair and use EP on that pair alone! How does it do it? Blessing knows the profit for its pair. From that it will know its portion of account balance to use (portion set 25). From that, Blessing can determine the pair’s own equity (its own P/L) and compare it to the allowable account portion you gave it (PortionPC).
Example:

$2000*25% = $500 allowed to use on that pair
Blessing current pair profit = $30
Blessing current pair equity = $530
EP logic:
500 – 530 > 50% * $500 (will close trades on that pair if this logic is true!)

If that pair went crazy and lost $300, it will close those trades and stop trading that pair because the account portion you told it was 25% and $500 - $300 = $200 and $200 is not greater than $450 ($500 - 10%) so Blessing stops on that pair. Here’s the beauty of this strategy. One pair may earn more than another and they all contribute to total account balance. Blessing on that pair uses total account balance to determine its account portion so it is a living function.
Right now we’re sure you’re saying, “what if I lose right away”? You’ve set your protections in each instance of Blessing and it determines whether it continues to trade based on the account balance you have set. Everything just stops. “What if I have a volatile pair that I like and want to trade?” you ask. Change the portion size on that pair to a lower number and it will multiply the account by that lower percentage thus using a lower balance for its trading.

Example:
Pair 1 $3000*25% = $750 allowed to use on that pair
Pair 2 $3000*17% = $500 allowed to use on that pair
Pair 3 $3000*50% = $1500 allowed to use on that pair
Pair 4 $3000*20% = $600 allowed to use on that pair

The numbers all don’t add up to $3000 though. It doesn’t matter because through portion control, we are allowing that pair access to that amount. If there is overlap, our gut tells us the EURUSD is the safest so we give it the portion of 50% while the AUDUSD is the most volatile so we give it the portion of 17%. What about expert advisors other than Blessing?

We must do the math before we even begin to trade and set our controls based on our assessment of the volatility of each pair and each expert advisor. One account with 5 pairs and 3 expert advisors could yield this:

$5000 base nano account
Blessing is going to be used on 3 pairs
EA 1 will be used on one pair
EA 2 will be used on another pair
Total of 5 pairs
Blessing 1 pair is volatile so we will give it a portion of 10% = $500 to trade
Blessing 2 is wonderful and we think it will perform well. We give it a portion of 50% = $2500 to trade
Blessing 3 is unknown but tests have shown it works well so we give it a portion of 20% = $1000 to trade

EA 1 trades OK. We can control its portion with whatever means we can, we set its risk with manual lots or money management and use stop losses or equity protection to protect our account.
EA 2 principles are the same as EA 1.

Portion control gives us wonderful capabilities with Blessing and protects us from ourselves and our hard earned money. This feature gives Blessing the control we need to successfully employ complete money management and equity control.

Equity Stop Loss Protection

Equity Protection was developed to prevent a total blowout of our account. Knowing what we now know about Blessing and “the basket”, we can see if Blessing started taking out higher lot values of trades, our Profit and Loss (P/L) might continue to go negative (or positive). That’s good and bad. Blessing needs room to breathe and large draw downs are common to this grid strategy but how much is too much? That’s entirely a personal choice. Blessing needs about 50% of its portion balance before you should consider shutting it down. This feature is programmed into Blessing.

If we set MaxDDPercent to 50%, Blessing can use up to 50% of the portion account balance if it needs to continue trading. If it goes beyond that, it closes all trades, and stops trading if that loss takes us below the Stop Trade Account Balance (Determined by the StopTradePercent setting) we had set initially.
Here’s an example:

Our Stop Trade Account Balance is $500 (automatic calculation).
Blessing starts to trade big and it’s been working great so our balance is up to $800.
Blessing continues to trade but unfortunately the basket hits a -$400 P/L and closes all trades because we set our protection at 50%
Our account balance is now $400, below $500 so Blessing stops trading.
In a different example, if our account balance were up to $1001, the loss would have been -$500.
Blessing would have continued trading because our balance is $501.

Equity Protection (EP) is simply a must with this trading routine. Can we trade Blessing on multiple pairs? Sure, if our portion balance is multiplied by the number of pairs we trade. This is the safest way to trade! Blessing has shown in backtesting that the total number of trades out at any one time has not used a significant portion of our margin nor has the P/L been significantly negative.
Account Protection

Account protection relies on the Stop Trade Percent feature of Blessing. Previous versions of Blessing had a user entering a Stop Trade Balance amount however, with the latest version of Blessing, you simply enter a percent value into the menu setting StopTradePercent. You do not have to worry about your Stop Trade Balance because Blessing sets this for you based on the percent number you set in. What is your stop trade balance?

Equity Protection was a way of protecting your account from complete blow-out. Blessing needs to use large portions of your account to trade but testing has shown that Blessing rarely goes beyond 50% of your account balance when proper settings were used. If 50% is hit, the basket is closed and your account is now 50% lighter than before but without Account Protection, Blessing would keep trading. Account Protection puts a stop to Blessing while you figure out what happened.
The Stop Trade Percentage you enter in the menu takes your account Balance, subtracts this percentage value, and sets this as your Stop Trade Balance. On a $10,000 account, your Stop Trade Balance is set at $9,000 (assuming 10 is used in the menu set item). This balance remains at $9,000 until the account gains 10% (menu set number). At $11,000, the Stop Trade Balance is then reset to $9,900. Should you hit an Equity Stop Loss protection, your account would drop to $5000, below your Stop Trade Balance of $9000 and you would get a warning window popping up stating that you have dropped below your Stop Loss Balance.
If you wanted to continue trading on this pair, you would have to remove Blessing from the chart to reset the internal variables of Blessing then reapply Blessing to the chart once again. Again, this is designed to protect you from Blessing if it just wasn’t Blessing's day.

ShutDown and Emergency Close All

ShutDown is a way of telling Blessing we don’t want to trade after this basket is closed. It can be turned on or off at any time and will provide you overlay information that it is turned on. After a basket closes, Blessing goes into ShutDown mode. The overlay will reflect this condition and Blessing will have to be reset to continue trading.
EmergencyCloseAll is a way of simply getting out quick. A user may have several EAs on their account and it might be difficult to find every trade relating to this chart and close them out. This feature tells Blessing to do this for you. The second it does this, an overlay warning you of what has occurred will be displayed. Blessing will close the basket and pending trades immediately but will continue trading. Depending on what entry method you are using, you may get an immediate placing of an instant or pending trade once again. You will need to reset Blessing and change EmergencyCloseAll to false to avoid closing further trades by accident - there will be a warning message on the display to remind you. If ShutDown is set to true at the same time as EmergencyCloseAll, trading will also be halted.

Holiday Shutdown Feature

If UseHolidayShutdown is set to true then this function works in a similar way to the ShutDown function detailed above. The only differences are that the Holiday ShutDown will occur at user pre-defined dates, and Blessing will automatically restart trading when the holiday period is over. The dates are entered in the Holidays parameter in the format [day]/[month]-[day]/[month], and if there is more than one holiday period, they must be separated by a comma. All dates are inclusive, so Blessing will restart trading the day after the final holiday date. The next holiday period will be displayed on the overlay if it is enabled, giving confirmation that the dates have been entered correctly.
Power-Out Stop Loss Protection (POSL)

Blessing does not send Take Profits or Stop Losses. What happens if you lose your internet connection? Blessing can not monitor its trades for profit but worse, you have several trades open at your broker without a stop loss. That’s where the power out stop loss protection feature comes in, and is used when UsePowerOutSL is set to true.
We don’t want POSL to interfere with the logic of our grid trader while, at the same time protecting our trades and our hard earned money should our internet connection fail so how is this done?

POSL is calculated base on our EP value to not interfere with Blessing's profit taking logic. It is based on the formula:
POSL = PortionBalance X (MaxDDPercent + 1)/100)/(pipvalue X Total Lots)
Where pipvalue=MarketInfo(Symbol(),MODE_TICKVALUE);
Initially, when Blessing starts, it places a BUY or SELL trade at .01 lots. If you do the math, you can see a rather large POSL is calculated. So, while small lots are open, the POSL sent is no larger than 600 pips, or whatever value you set in POSLPips.

As more trades are added to the basket, each trade is modified with the newly calculated POSL thus synchronizing all open trades with a common stop loss. This POSL gets tighter and tighter as more trades are placed which keeps all open trades in line with your Equity Stop Loss Protection plus 1%. An additional 1% is added to the MaxDDPercent to avoid interfering with Blessing's profit taking logic yet protect your open trades with a stop loss should your internet connection fail. This is a very powerful feature for protecting your hard earned cash. If you elect to not use this feature, no SL will be sent to the broker. Since Blessing is a Grid trader, the logic does not depend on a SL.

Profit Taking

Blessing monitors the total number of open trades and calculates a potential profit for that basket and keeps an internal modification of all orders to the trades that are out and “synchronizes” all of the “Take Profits” (TP) to the same value. If more trades are out, the TPs are sync’d closer and closer to the actual price making the reverse required for a profit less of a movement. Additionally, we can now turn on a Profit Trailing Stop (TS) feature.

This MaximizeProfit feature has several advantages. Blessing calculates a potential profit in its routine and it’s through this calculation we set a percentage of profit we are willing to live with. If the trend starts to reverse, our basket becomes a positive value. Blessing already knows its profit potential but we tell Blessing we want to set a profit trailing stop at a set percentage of that profit potential. This feature is menu selectable with ProfitSet.
Additional to this profit trailing stop feature, Blessing now has a way of moving the TPs once profit trailing stop is set. In other words, once the basket becomes positive and profit trailing stop is set, you can now tell Blessing to move the TPs by the number of pips set in MoveTP. This gives the basket a new profit potential and will move the profit trailing should the profit trend continue. This gives you the potential of moving the profit trailing stop taking advantage of any run that may occur. You tell Blessing the number of times this move can occur with TotalMoves. This is another powerful feature of Blessing allowing Blessing to take profits in two more ways, the traditional take profit way with moves or a profit trailing stop way.
Blessing also has a normal trailing stop feature. Setting UseStopLoss to true will set a trailing stop on every basket. Once the price has reached break even plus the value set in TSLPips (as long as TSLPips is positive) the stop loss will trail the price. If the value of TSLPips is set as a negative value, then it will still act as a positive trailing stop, but it will reduce the trailing stop as more profit is made. Setting TSLPips to 0 will turn the trailing stop feature off.

Using UseStopLoss it is also possible to set a stop loss on every basket. The stop will be set at the value set in SLPips. The Stop Loss function will not be active if SLPips is set to 0.
Profit Potential and TP Adjustment

Blessing lays a grid to garner a profit. With all of the features in Blessing, some features might compete against others to yield what might be called a “negative profit potential”. This can occur in many different ways.

Profits or the potential for a profit is easy to calculate based on the value of a pip, the number of lots out and how far a trade needs to run to garner a profit. The previous section talked about a way to manage positive profit potentials and even set profit trailing stops but what do we do about negative profit potentials?
Negative profit potentials from a grid can occur is the market is trending fast against the grid and doesn’t have enough time to set out the next LEVEL LIMIT trade. Because the EntryDelay function is slowing this placement down, the market may move such that once the LIMIT trade is placed and hit, the take profits are sync’d and the profit potential yields a negative amount. We need a way to correct for this and Blessing does this automatically. Blessing calculates the grid break even point and adds a profit target to the break even value then adjusts all Take Profits against this target. The profit potential is measured against a known Profit Target internally calculated by Blessing.

This target is based on a Base Target which is the value of one trade of the base lot value multiplied by total number of trades in the basket. Blessing checks the grid automatically so if the market does move quickly, the potential for profit will always be available.

Finally, as an added feature, Blessing does all of the TP calculation Internally. Order modifications are no longer required as Blessing keeps track of the TP without sending it to the broker. This Stealth feature has eliminated potential order modification bottle-necks and will help keep our brokers honest!

Hedging Feature

Once Blessing has set its grid, and started opening trades, it is at the mercy of the price. If the price moves too far in the wrong direction, it will cause a drawdown on your account. One way of avoiding a high drawdown is by hedging the open trades.

Hedging is simply the opening of a trade in the opposite direction of the already open trades. For brokers outside of the US, this hedge trade can be made on the same pair, meaning that for every movement in the price, the gains/losses on the basket trades are directly offset by losses/gains on the hedge trades.
Unfortunately, the NFA have banned hedging for brokers in the US, so any hedge trades need to be opened on a correlated pair. A correlated pair is one in which any movement in the price of one pair, is closely matched by the movement of the other pair, whether in the same direction (Positive Correlation) or in the opposite direction (Negative Correlation).

To use the hedge, enter the Symbol of the pair to be used EXACTLY as provided by your broker, or if you are using the same pair, leave it blank. Blessing will automatically decide whether the pairs are positively or negatively correlated by calculating the correlation coefficient using the daily historical data over the number of days specified in CorrPeriod.

There are two methods for opening hedge trades. The first is based on the current drawdown of the open trades, and the second is based on the level of the open trades. To choose between them, set [[DDorLevel]] to 'D' or 'L'.

If you choose to base the hedge on drawdown, set HedgeStart to the drawdown percentage at which the hedge should open its first trade. The default percentage is 20%. If the hedge is based on levels, then HedgeStart should reflect the level to start the hedge, e.g. 8.

The number of hedge lots opened is based on the total open lots in the basket, adjusted by a hedge lot Multiplier. If Blessing opens a new trade in the basket, then another trade will be opened in the hedge, using the same lot Multiplier. The hedge trades will be closed in one of two ways. If the net profit from the basket and hedge trades reaches the profit target set by the take profit, then all trades will be closed.

The other method is by way of a trailing stop. This will trail the price until it reaches break even, or the hedge trades are stopped out for a loss. At break even you have the choice of halting the trailing stop, or letting it carry on, so the hedge will stop out at a profit. If the trailing stop is allowed to carry on, you can choose to have the stop reduce as the price moves, which will lock even more profit in the hedge trades.

Note that if the stop is set at 0, then the hedge trades can only close if the profit target is reached.

If the hedge is based on drawdown, then to stop a new hedge trade being opened as soon as the previous one has closed, the hedge start percentage is increased by a re-entry percentage. If based on levels, a new hedge trade will only open if Blessing opens a new trade in the basket at the next level.
The cross pair correlation hedging is still undergoing forward testing, as it is not possible to back test. Please use this feature with caution, and leave any feedback on the forum.

Close Oldest Trade Feature

When a basket of trades is open, and the price keeps going against it, the oldest trades in the basket will increase the overall drawdown. The open price of these trades are on the 'wrong' side of the current break even point, and will always close at a loss. In order to reduce the drawdown if the price runs in the wrong direction, Blessing now has an option to close these trades after a certain level if UseCloseOldest is set to true.
Because the losses incurred closing trades at higher levels can become excessive due to the increased lot size, Blessing can limit the number of trades closed in this fashion with CloseTPPips.

Blessing will automatically recoup the losses incurred if RecoupClosedLoss is set to true by adjusting the take profit of the remaining trades, but as these losses increase the take profit point will move further away from the current price. It is now possible to fix the take profit point to a user specified number of pips from the break even point with CloseTPPips.

Recoup Closed Loss Feature

If trades have been closed through the Hedge function, or the Close Oldest Trade function, they will probably have been closed at a loss. Blessing will automatically recoup these losses by adjusting the Take Profit of the remaining open trades, unless RecoupClosedLoss is set to false.

Early Exit Feature

Setting UseEarlyExit to true allows you to reduce the profit potential if the basket has been open for some time, or if there are many trades open. There are actually two strategies involved, and you can choose to use either of them individually, or both together.
The first strategy is a reduction in profit over time. You can specify how long to wait before this strategy starts with EEStartHours, and what percentage of the profit you are willing to sacrifice for each hour the trade is open with EEHoursPC. There is also an option to reset the start time and reduction percent when a new trade is opened by setting EEFirstTrade to true.

The second strategy is a reduction in profit by the number of open trades. Blessing will allow you to set the level at which this reduction starts with EEStartLevel, and the percentage reduction per level with EELevelPC. To obtain a steady reduction between the Early Exit start level and the break even trades level, use the formula:
100 / (BreakEvenTrade + 1 - EEStartLevel).

If both strategies are used together, there is a possibility that the total reduction percent could go over 100%, i.e. the basket could close at a loss. Therefore Blessing has an option to prevent this from happening by setting EEAllowLoss to false.

Recover Broker Costs

If a basket of trades is left open overnight, it will be subject to 'swap', which is the interest paid/received on the open trades. Your broker may also charge you commission on your trades. If these costs are negative, Blessing will automatically recover them by adjusting the Take Profit point of the open trades. If the 'costs' are positive, they will be added to the profit of the basket.

Magic Number Control

Blessing now lets you decide what your magic number will be. It has both automatic and manual capabilities. You can now trade the same pair on the same account and even the same time frame if you like! You simple need to change the EANumber, i.e.: Blessing on USDJPY/H1 with an EANumber of 1 and Blessing on USDJPY/H1 with an EANumber of 2 will trade completely independently.

Blessing auto-calculates a magic number allowing you to trade multiple strategies with Blessing. If you set the EANumber over 99, the EANumber will be the magic number and you can still do whatever strategy you like.
Trade Tracking and Security

A security feature is added for our convenience. Blessing sends a trade comment with each trade to the broker. This feature helps us track our trade in the MT4 platform by showing which EA took out which trade in the comments section of our terminal section. If you don’t see the comments section in the terminal area of your MT4 platform, right click anywhere in the terminal window and select “Comment”. It will show the comment of each trade.
This feature is not without concern. There are rumors that brokers shut off expert advisors that perform too well. Whether or not Blessing performs well, we still have a security risk by sending trade comment information to the broker. We do want to track that trade though so how do we do it?
The TradeComment is now a user settable feature via the menu. We put in whatever we want to secure that trade and still track it in our MT4 platform. Type in words, numbers or anything else and you have trade security and tracking available.

After all that want to say this is a grid/martingale type EA and best to be tested on a demo account or a small live account until you feel safe with it, because it can be dangerous to your account's health.Also please feel free to share any set files you come up with. There are 2 set files I have attached for 5 minute Aud/Nzd and the 1 hour Gbp/Usd pairs.
All files in topic