Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Trapping System: Tunnel Martingale (Trapping System: Tunnel Martingale)

author EAcpu | 2 reads | 0 comments |
Hello everyone,
I want to share with you the "never lose" system (practical), which was given to me by PM a few days ago. A brother asked me to build an EA based on the martingale series, dividing the difference between the highest price and the lowest price to create a buy and sell series. So it will form like a tunnel.
In fact, I was building the same martingale series a long time ago, but it was a different variant and it didn't work out. Then the idea came from Kang Kun.

Elements:
- Gap (in points, not points)
- support/resistance
- The batch is the martingale series (0.01, 0.02, 0.04, 0.08...)
- TP is 2 times the gap (according to KanGKunG's requirements) or a configured fixed value.
- SL is the minimum SL value + gap + spread (according to KanGKunG's requirements), or a configured fixed value, or no SL at all.
- No Take Profit and Stop Loss is also possible, with Take Profit as the total profit.

In short, it will do the following (in 1 cycle):
- First, it will buy 0.01 lots at the current price and then sell 0.02 lots at the current buying price with stop loss - gap. This will form a tunnel with an upper price and a lower price.
http://i62.tinypic.com/29ys95c.jpg

- If we say the price goes up and reaches TP (First Order) then it closes the cycle and starts a new one.
- If not (of course it will fall), once it reaches SELL STOP 0.02, then it will do BUY STOP 0.04 this time.
- If the price drops and reaches the stop loss, the cycle ends and a new one begins.
- If the price recovers and reaches the first order price, then it will execute SELL STOP 0.08.
- If the price fluctuates a lot, then the cycle will most likely never end and a series of "BUY STOP" or "SELL STOP" will be placed with increasingly larger lots.

During my observation,
Set to:
- EUR/USD.
- Martingale factors 1, 2, 4.
- Start anytime from 12:00:00 - 00:00:00 Singapore/Malaysia time (no support and resistance).
- Starting from 0.01.
- Starting from $5000.
- Profit on a currency basis (total profit), $0.10 per period.
- Always buy first.

I found:
- The most used martingale index is 9. You end up with a lot size of 2.56, for a total of 5.11 lots.
- The average martingale will close near the index 2 (total 0.3 lots) - 4 (total 0.15 lots).
- Daily profit is about 10 - 20 USD.
- Minimum available margin...I'm still watching this.
- During market hibernation, the Maximum Martingale Index may be higher due to price fluctuations.
- During the opening period of US or European time, the minimum martingale index can be 1. This means that once opened, the cycle closes and restarts again within < 1 minute.

Below is a screenshot of the configuration:
Attached picture (click to enlarge)
Click to Enlarge

Name: Screenshot2.png
Size: 48 KB

Attached picture (click to enlarge)
Click to Enlarge

Name: Screenshot3.png
Size: 60 KB


Too many configurations?
Yeah, I do it just to cater to a lot of scenarios.

I will explain it as follows (Note)
Startup type <br> There are 4 settings, start at any time (within the timeframe), start from support and resistance levels, start from daily highs and lows, .
Start anytime will start at the moment you click "OK", but if it is not within the time (start time and stop time), then the EA will wait until the internal time is reached.
Starting from the support and resistance levels , you will start from the support or resistance point. If the support level is reached, it will be bought first. If it reaches resistance, it will be sold first. Support and resistance levels (and pivots) are calculated based on http://www.investopedia.com/ask/answ...vot-points.asp.
Starting from daily highs and lows is essentially the same as starting from support and resistance levels. But it will start with today's daily highs and lows.
.

Profit line color
.
Text color <br> Text color.
Gap Upper Price Color <br> The color of the upper gap.
Lower Gap Price Color <br> The color of the lower gap.
Text size <br> text size
Magic Number <br> The magic number that identifies this EA. Basically, you would use this option if you want to run more than 2 different EAs on your account.
Line type, line width, line height <br> as mentioned above
Use Slippage <br> If you want to use slippage when closing a position.
Slippage <br> Slippage value.
Starting batch type <br> The type of starting plot. Dynamic or fixed.
Dynamic batch <br> If you expect 0.01 as the starting value, enter 0.000002 as the value for the $5000 balance. This means that dynamic lot = expected lot / balance. This only works with starting batch = dynamic.
Fixed lot <br> Fixed starting batch and that's it. This only applies to starting batch = fixed.
Martingale factor, Martingale factor multiplier, maximum Martingale factor
Martingale factors are 1, 2, 3, Martingale Factor Multiplier = 2, Max Martingale Factor = 25, which will produce: 1,2,3,6,12,24,48,... until 25 sequences.
The martingale factors are 1, 2, 4 (ordinary martingale), the martingale factor multiplier = 2, and the maximum martingale factor = 25, which will produce: 1, 2, 4, 8, 16, ... until 25 sequences.
Gap <br> The price difference is points . Point is the lowest unit. At most 5-digit brokers, 10 pips = 1 pip. For a 4-digit broker, 1 pip = 1 pip. Be careful with your agent. My calculation is based on how many digits I have.
Maximum period <br> The maximum number of cycles per run. Normally 0 is unlimited.
Target Type, Profit Target, Profit Multiplier <br> The way I end the loop is through the target.
Dynamic Funding (Balance Link to profit multiplier for value. Profit Multiplier = Your Expected Goal in USD / Your Balance. Once the total profit reaches your desired target, the loop will close. This setting is usually used if you want composite targets.
Fixed Funding -> The target will be only a fixed amount (total profit for all orders in 1 period ). Link to profit goals for value. Once the total profit reaches this, the loop will be closed.
Fixed point -> Calculated as a first-order point in 1 period.
Points Goal Type <br> The target type is fixed point . Will be calculated based on first order.
Fixed number of pips for TP and SL -> The cycle will be closed once the pip target (TP) or the pip stop (SL) is reached.
NOTE: Fixed points will never explicitly put TP and SL in first order. The calculation is done inside the EA .

Other options are clearly described.
http://i59.tinypic.com/2rp5zqv.jpg

Started <br> A cycle always starts with "buy first" or "sell first".
The next cycle starts <br> The next cycle will start with "Follow from Setup",
or "Follow the last profit direction" -> If your last period profit ended in sell, then it will start selling.
DateTime Base <br> You need local time (your PC, VPS, whatever device this is running on) or server time (each agent has a different server time than the other agent).
Start time, stop time <br> Start time and stop time starting at any time.
Debug mode, development mode <br> These two flags are just for my reference in case anything goes wrong.

...all that's left is color and some hanky-panky settings.

: For those who know what a martingale is, yes it is almost 100% profitable (actually), I don't deny that, but it depends on how much balance you have, and how big the lot size your broker supports. I don't argue with the profitability of this approach.
If you are curious and interested, please download and try it out on your demo account first. Then, if you are 100% sure about your setup, you can start working on your real account (if you wish).
Read this: http://www.investopedia.com/articles...martingale.asp
Your profit, depends on your setup and your money management method...
This EA is...

I have attached the .mq4, .ex4 and EA configuration (.set). Note: ex4 and mq4 are always the latest released EAs .
There are 2,
MartingaleKanGKunG.set -> Requested by KanGKunG, based on support and resistance.
RadityoMART.set -> My settings, start anytime, follow last.
When launching this EA, there will be "Load" and "Save" buttons on the lower right side. Click Load and select the file.
http://i62.tinypic.com/23wpldg.jpg

Currently, the following are the test sites (if you decide to test, please tell me your Trade Explorer URL and I will add it here):
Anytime Martingale - http://www.forexfactory.com/radityo.ardi/24
Martingale Daily High and Low Prices - http://www.forexfactory.com/radityo.ardi/80
Martingale Signal to Noise Ratio - http://www.forexfactory.com/radityo.ardi/81
Anytime Martingale - http://www.forexfactory.com/radityo.ardi/38 (This is for Martingale factors 1, 2, 2, 2).

As mentioned by aahmad29, the basic idea of ​​the EA is described as follows:
Attached picture (click to enlarge)
Click to Enlarge

Name: Screenshot1.png
Size: 130 KB


I wrote an interesting fact on this link:
http://www.forexfactory.com/showthre...37#post8067337

However, bugs may still exist, so please test and report if any issues arise.

NOTE: This EA is licensed under the Tunnel Martingale License (terminology derived from MsPL). This means that open source code can be used for free, with some restrictions and conditions. Please take the time to read the license located at: https://sites.google.com/site/tunnelmartingalecla/
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg
Screenshot2.pngScreenshot3.pngScreenshot1.pngUntitled.jpg

Attachment to original post (6)

📦 Summary of post attachments (16)

Below are all the files (16) shared in the reply.

Verification code Refresh