RUBBERBANDS_2 EA: Your Go-To Trading Assistant for MetaTrader 4

Mike 2009.08.17 18:30 19 0 0
Attachments

Introducing RUBBERBANDS_2 EA!

Version: 1.2

Important: Avoid using this EA for live trading. I genuinely want to ensure that no one loses their account. This is more of a brainstorming tool than a live trading solution.

Here’s what’s new in this version:

  • The external variable quiescenow has been introduced to temporarily pause the EA when the trading session wraps up.
  • The logic for closing all open orders has been refined for better performance.
  • Some external variables have been renamed for clarity:
    • useequityprofitcut is now use_sessionTP
    • dollareqprofitcut is now sessionTP
    • useequitylosscut is now use_sessionSL
    • dollareqlosscut is now sessionSL

The previous version is still functional if you’re trading a single currency pair without any other open orders.

This EA is an upgraded version of the original RUBBERBANDS EA. Like its predecessor, it’s versatile enough to work on any timeframe and across all currency pairs, including gold and silver. The underlying strategy is based on the principle that price movements tend to revert—think “buy low, sell high.”

How does it work? It opens both BUY and SELL orders simultaneously. Whenever the price rises by a multiple of pipstep above the initial SELL order, it will open an additional SELL order. Similarly, if the price drops by a multiple of pipstep below the initial BUY order, it opens another BUY order.

All open orders will be closed once the designated profit target sessionTP (in dollars) is hit, acting as your TAKE PROFIT. Alternatively, if you set it to true (use_sessionSL), it will close out the positions when the specified loss sessionSL (in dollars) is reached, serving as your STOP LOSS.

Each series of orders and their closures is considered one trading session.

To keep things manageable, the external variable maxcount caps the number of orders per session.

Make sure to test this EA using the Strategy Tester to see how it performs!

Preferred currency pairs: Stick to the four major players: EUR/USD, GBP/USD, USD/JPY, and USD/CHF. To minimize significant drawdowns, consider setting a smaller sessionTP.

Here are the external variables you’ll work with:

  • Lots: 0.02 (the number of lots per order)
  • maxcount: 10 (maximum orders allowed per session)
  • pipstep: 50 (pip distance for additional BUY or SELL orders)
  • quiescenow: false (set to true to pause the EA when the session ends)
  • donow: false (set to true to open orders immediately)
  • stopnow: false (set to true to stop the EA)
  • closenow: false (set to true to close all open orders)
  • use_sessionTP: true (recommended to leave unchanged)
  • sessionTP: 1000 (profit target in dollars per lot for closing all orders; acts as TAKE PROFIT)
  • use_sessionSL: false (set to true if you want to use the below sessionSL)
  • sessionSL: 300 (loss target in dollars per lot for closing all orders; acts as STOP LOSS)

The following three variables help you restart this EA after a break, such as over the weekend, when there are still open orders. inmax and imin are shown as GLBmax and GLBmin on the chart:

  • useinvalues: false (set to true on restart)
  • inmax: 0 (set the former max on restart)
  • inmin: 0 (set the former min on restart)
List
Comments 0