Scale-in Trades EA

Posted by admin8277 on May - 20 - 2016
Spread the love

Expert Advisor

Purpose: 

to scale in additional trades based on a single existing trade.  The characteristics of how this is done is specified through the EA’s inputs.

Inputs:

  • MaxTrades – maximum allowed concurrently open trades.  Scaling in further trades will stop when this number of trades is reached
  • StepPips – the distance in pips between scale-in trades.  This fixed distance is used only when the UseATRbasedStep input is false
  • UseATRbasedStep – When this is true, the step between scale-in trades is based on the current ATR (Average True Range) indicator
  • ATRperiod – specifies number of bars used to calculate the ATR used in the ATR based step calculation
  • ATRmultiplier – is applied to the ATR value to calculate the step pips used between scale-in trades.  Is a floating point number that allows the ATR value to be scaled up or down
  • Lots – Lot size used for the scale-in trades
  • LotsAdd – when nonzero, consecutive scale-in trades will be increased by this amount.  (it is added to the lot size of the most recent trade to get the lot size of the next trade)
  • LotsMultiplier – when not equal to 1.0, consecutive scale-in trades will be increased by this multiple.  (the most recent trade is multiplied by this factor to get the lot size of the next trade)
  • SameSzTrades – specfies the number of same lot size trades before LotsAdd and LotsMultiplier is applied.  For example if one only wants to change the lot size every other/second trade, then they would set SameSzTrades to 2.

For example
Given your other inputs were:
Lots = 0.01
LotsAdd = 0.01
LotsMultiplier = 1.0 (no effect when equal to 1.0)

Then if SameSzTrades was set to 2, you would get the following lot size sequence in your scale-in trades:
0.01, 0.01, 0.02, 0.02, 0.03, 0.03, 0.04, 0.04…..

With SameSzTrades set to 3:
0.01, 0.01, 0.01, 0.02, 0.02, 0.02, 0.03, 0.03, 0.03….

  • MaxSpread – Maximum allowed spread above which a scale-in trade will not be placed
  • PerTradeStop – when nonzero, scale-in trades will be submitted with this as a fixed stop.  It is in units of pips
  • PerTradeTP – when nonzero, scale-in trades will be submitted with this as a fixed take profit
  • MaxLossDollars – Specifies the maximum loss in the account currency at or above which the entire basket of trades currently opened will be closed
  • MinProfitDollars – the minimum profit  in the account currency at or above which the entire basket of currently open trades  will be closed
  • MagicNumber – EA magic number.  Allows the EA to recognize which open orders in the account are it’s own
  • Slippage – specifies the allowable slippage for placement of the scale-in trades to the broker.  This is in units of pips.

User Notes:

Disclaimer – the author is NOT responsible for any losses resulting from the use of this EA.  Use and self-training on a demo account before trading with real money is highly recommended.  Use of this EA is only at your own risk.

Reasoning
There may be some EAs that place trades that immediately go into profit but as any veteran trader will tell you, this is rare.
Because of the randomness of the market, Instead what happens in the majority of cases, is a trade will spend some time floating a loss before it begins to profit.

That being the case, I believe it is always better if the initial trade is of a minimal size and to then “scale in” additional small trades (in the same direction as the original trade) as the price moves against your trade(s).

The Scale-in EA used correctly, will allow a trader to capitalize on this condition by more slowly scaling into their position while continuing to use their favorite trade entry signals. By taking advantage of the volatility and randomness of the market you can in effect (in the majority of cases) obtain a better average entry price for your position with a basket of smaller trades and thereby improve on any strategy

This “scale-in” protocol also increases the “staying power” of your position giving you more opportunity to net a profit. Since you are not fully in your position unitl the price has moved a specified number of pips away from your initial trade signal.

Of course this EA is not recommended on smaller accounts as a replacement for a single trade position when that single initial trade is already a small microlot trade. Rather it is meant to replace your one “larger” trade entry with multiple smaller trade entries whose combined lot size is equal on average to that of the original single trade size being used.

The 2 pictures below demonstrate the power of the scale-in tactic.  Notice the takeprofit price in the 2nd picture is actually above the original single trade (a sell trade).

single trade; no scale-in trades

single trade; no scale-in trades

small trade with 3 scale-in trades

small trade with 3 scale-in trades

Compatibility

The EA can work with manually placed trades or with another EAs trades. However if you’re using it to add to trades from another EA, the Exit logic in the other EA can cut short the original trade that the Scale-in EA bases it’s trades on. Depending on how it works, the other EA could also close the Scale-in trades as well

It is not recommended for use with a high frequency trading EA such as a scalping EA or an EA that maintains multiple concurrently open trades.

Features

The Scale-in EA provides a variety of input parameters that lets a user exactly specify critical parts of the variious trades:
Scale-in rate
– the distance between the scale-in trades can be specified to control the rate at which scale-in trades are placed. This can be controlled by a fixed distance (step) or an ATR based distance may be selected. An ATR multipler is also provided for this option.

Lot size
there are various lot size related paramters for controlling the change in lot size (if any) of the various scale-in trades.

The user can simply keep lot sizes the same by setting LotsAdd to 0 and LotsMultiplier to 1. Or a user may set these to add to the previous lot size and/or to multiply the previous lot size by a multiplier of their choosing.

The SameSzTrades input keeps the lot size of ‘x’ number of consecutive trades the same before changing the lot size again. For example suppose you wanted to only have the lot size change for every other additional scale-in trade, then you would set the SameSzTrades input to 2.

Again, the change in lot size may be changed by a fixed amount using the LotsAdd input and/or it may changed by multipying the previous trades lot size by the LotsMultiplier input

In fact with a multiple of 2 or higher, a trader can employ a “martingaling” effect to their additional trades (not recommended).

Gain-Loss based Exit
Since you are now dealing with several trades a dollar based exit which combines the floating gain/loss of the entire basket of trades was added so that the entire basket can be treated as a single entity when it comes to a stop or take profit of the position.

The MaxLoss input specifies an account currency amount at which the basket of trades will be closed for a loss.
The MinProfit input specifies an amount at which the basket of trades will be closed for a profit

Every tick the EA sums the combined profit/loss of the open trades and if MaxLoss or MinProfit amounts have been reached, it closes the entire basket of trades.

System Requirements
To run Metatrader 4 you should be using Windows 2000 or later, with a 2.0 GHz or faster CPU, and at least 512 MB RAM (although 1 GB is recommended). You should have a screen resolution of 1024 x 768 or higher, and an internet connection speed of 56 kbps or faster.

18 month use

 

3 Responses so far.

  1. Howard King says:

    Hello,

    I have been looking at your “Scale-in trades” EA.

    Is it still functional on latest version of MT4 ?
    Is there a demo version for testing ?

    Can it still be purchased ?
    Any are there any updates since release.

    Best Regards,

    Howard

    • admin8277 says:

      Hello Howard,
      Thank you for your inquiry.
      Responding to your questions:
      Is it still functional on latest version of MT4 ? Don’t purchase it at this time. I will retest it next chance I get.
      Is there a demo version for testing ? no
      Can it still be purchased ? yes
      Any are there any updates since release? no