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

Simple High Profit low Drawdown Triangul

author EAcpu | 5 reads | 0 comments |
I will always update this post #1 with the latest information.
So if you don’t want to read all the posts then just read this article.

I'll also keep EA up to date here.

The rest of the post is interesting, I love the intense war

*******************************
Very basic summary
*******************************
1) Buy 1 unit of GBPJPY
2) Sell 1 unit of GBPUSD
3) Sell? Use the USD to USDJPY units from point (2) to balance everything out

Buy low and sell high.
Rinse and repeat.

Is this idea feasible? Or are there any pitfalls to this idea?

*******************************
Details
*******************************
Okay, I'm new to this, but must say triangular arbitrage looks interesting.
I made an EA to trade GBPUSB, GBPJPY and USDJPY

basically
1) Buy 1 unit of GBPJPY
2) Sell 1 unit of GBPUSD
3) Sell? Use the USD to USDJPY units from point (2) to balance everything out

This essentially zeroes out your position minus spreads, commissions and swaps.
Just keep at it until you make a profit.
It will oscillate around the zero point.

Once I'm profitable, I swap the 123 points above for "Sell", "Buy", "Buy".

My input could be random and go from there, but since I started I've changed it so that I calculate what the lowest and highest points are and use those calculations as the input points.

Now, sometimes you do get in accidentally at the wrong time.
Basically buy at the top and never get back to that point.

I found it about 9 times in two years.
You can see these in the load spikes at the bottom of the graph.

This problem can be solved with small grids.
Basically once you unfortunately buy at the top then you are stuck but don't worry as it can only go down so far before coming back but never past that point again so just wait a bit and let it go down and once it goes down enough then buy the same amount again and get a guaranteed profit more than halfway back so just wait a little bit.

As I said, my major is mathematics and programming, but I am new to the Forex market.

The demo EA I wrote ran from June 23, 2015 to June 16, 2017.
I started with $1000 and ended with $2,725,839.38. The maximum withdrawal during this period was 25% of the account.

I did set a safety lock in the system to prevent losses exceeding 25% (2 hits over a 2 year run), this would not affect the EA as it would adapt itself to the next balance as needed.
The reason for the 25% retracement surge was Monday's weekend gap.
I tried blocking Friday's trade, which caused the maximum drawdown to drop to 15%, but the closing profit also dropped to about $1,800,000.00

Other things to note is that around June 28, 2016, a year later I maximized the Metatrader 5 backtest lot size to 99 lots and from that point on, it stopped growing exponentially and started a slower continuous growth.
In a real environment, you can split your account into multiple accounts before reaching the limit to get more profits.

If you are able to keep the exponential growth going from 2 hits to about 4 hits (up to 5) then the 25% retracement hit rate may also increase, but the EA is designed for this and can handle about 20 times of 25% history before starting to show losses, since the growth rate is 100% approximately every 2 months, the worst case is hitting the 25% retracement 2 times in a year.

I don't have the funds to do a field test, but the demo tests seem pretty good.

Any suggestions would be great.

I even found it possible to make a profit using a starting capital of only $100, but at that price all 3 pairs would start with the same 0.01 lot, which is a bit unbalanced as USDJPY cannot be the same as another, but once it breaks the $1000 profit mark it works well and the $10,000 mark is just rocket fuel for it.

Ignore upward spikes in the chart.
EAs were told to start selling the most profitable products first.
What matters to me is the win rate and how much it drops after opening 3 pairs.

The 25% loss on 2 currency pairs occurred at the beginning of the chart and was therefore almost invisible compared to the profits in the rest of the chart.

*******************************************************************************
Rules update: 2017-09-23
*******************************************************************************
Okay, this is a big update.

There have been some changes to the rules.
The 3 symbols are still in a triangle shape.

but.
Now, I calculate what the average profit will be if I do "Buy", "Sell", "Sell" and "Sell", "Buy", "Buy".
This gives me 2 rows.
Call the higher line the "sell line" and the lower line the "buy line."

Between the two lines is an average calculated over a period of time, and if this line is mostly a straight line, the buy and sell lines will essentially cancel each other out.

Now, every now and then, you will notice that the ask line crosses the average line, at which point you must open a buy (sell, buy, buy) in order to profit from the inevitable upward move.
Once the sell line crosses the average line, close the open buy position.
Perform the opposite operation of opening a position (buy, sell, sell).

One more thing is that I don't open a position when it crosses the middle average line, but only after it crosses the average line some distance away.

Well, I put more checks and stuff into the EA, but that's the basics.

I tested on MyFxchoice with a leverage of 1:200, so try to keep these settings.
I may work on other setups, and I did try to build the intelligence to suit other brokers, but my time is limited and it may not work properly.
Backtest before forward testing to make sure it's working properly.

Do not use on a real account.

Other content in EA includes:
1) Do not trade weekend gaps as slippage can be high on Monday.
2) For the same reasons as (1), do not trade between midnight and 2am.
3) Move all display and log encoding after system calculations to improve transaction calculation performance.
4) When calculating trades using only 50% AC, it only means that 50% of the account must be converted into used margin.
The drawdown at that point was about 5%, but I couldn't increase it for fear of getting a margin call.
20% might be better, but I'll test that one day.

5) Check for failed transactions and terminate them to start over.
6) Check weekend and inactive markets to prevent system failure.
7) Check the commission using a single trade of 0.01 lots.
8) Lots of logging and graphics code to show what's going on.
This takes up a lot of memory so I may have to move it to another EA for display reasons, just to see that it's not needed for trading, but it looks good and you can understand why the EA does what it does.
You can then use one EA for trading and another display EA, which you can load elsewhere to show working, while the display EA does not affect trade processing.

question:
1) Slippage and transaction delays.
I'm getting close to 500 milliseconds of latency when opening 3 trades for 3 symbols at once.
This can lead to some significant slippage, especially on the third trade, but luckily I still make profits on most trades because the EA does handle some slippage.
I'm still trying to find ways to reduce the time delay, but this seems to be a limitation of the way Metatrader works.

1.1) I could probably use 4 Metatrader terminals to increase the trading speed, and I have created the program that allows the EA to communicate with the outside world in less than 1 millisecond, but there is still about a 300 millisecond delay in launching a single trade.

The good thing is that I have now developed a driver that can connect the EA to anything else, from other EAs to other terminals, even external programs like java, even to other PCs in other countries or any other device, and even make the Metatrader EA use the FIX api or something like that.
The odds are stacked against this driver.

1.2) Delayed trading start seems to be caused by logging out of the terminal, if there are no trading operations for a while, and when a new transaction is required, the terminal has to take some time to log back in to open or close a transaction.
I can't find a way to prevent logouts without sending dummy transactions or impossible pending transactions or transaction modifications every 20 to 30 seconds.
The problem may be that the broker won't like receiving so many trading signals.

1.3) Fix API.
I have been playing around with the FIX api and it might be the solution to this transaction delay but I need to test it first...well...time is not on my side

*******************************************************************************
Run the EA
*******************************************************************************
Do not run on a real account.

Just attach the EA to the chart... and that's it

More details.
The running symbols of this EA are GBPUSD, GBPJPY, USDJPY
Completely correct and case sensitive.
If these symbols are not in your market watch or are not tradable, then it will not work unless...

You can set several parameters in the EA.
Mainly trade symbols.
Please remember that the EA only works with GBPUSD, GBPJPY, USDJPY
But if your broker includes symbols such as GBPUSD#e, then you can use parameters to change the EA to use your broker's symbols.
Remember, it is case sensitive, so if your broker lists GBPUSD#e and you enter GBPUSD#E, the EA will not work.

To see the chart drawn by the EA, I recommend setting the chart window background to black and making the chart smaller by dragging the right vertical price bar down until you can see all the lines drawn by the EA on the chart.
I would even recommend making everything black as chart prices provide no useful information.
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png
TesterGraphReport2017.06.16 2.pngScreenshot from 2017-06-16 23-25-10.pngScreenshot from 2017-06-17 14-38-00.pngScreenshot from 2017-06-17 14-38-00.png

Original post attachment (5)

📦 Summary of post attachments(56)

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

Verification code Refresh