Automatic Equity Manager - page 2

 

Hi latimeria,

Thanks so much.I manage to get the smiley face now.

By the way,what is the title of the book you are learning from?

I can't find find any book related to this in the library so if its available

for sale anywhere,i will get it.

 

darrenlck,

I can show you the title of the book I learned from, but It's a Japanese book.

(And It was very basic and not enough for further coding at all. But there are sample codes that can be download from a publisher and they help to understand mq4 structurally.)

I found these lessons written by a famous veteran coder "codersguru".

It will help you.

https://www.mql5.com/en/forum/172969/page2

I recommend you to open some mq4 files (available here, there and everywhere) and see what they are doing, and play with them, not only reading lectures.

Don't try to do complicated things from the beginning. If you do so, you'll hate programming.

It is said that the most famous program in the world is to print "Hello world !".

Start from an easy thing, then proceed.

I'm glad if you can be a contributor, not just a downloader.

 

Here is updated version of 2 Equity Managers.

Simple Basket Close v2:

Trailing P/L is added.

Emergency stop is added.

Clock is added.

Trailing P/L starts trailing when specified P/L (percentage) is reached.

You can specify trail start level and trailing width.

example)

Account Balance (Freemargin, Equity) 10000 / Trail Start 5% / Trail Width 2%

When current P/L exceeds 5%(500), EA starts trailing by 2%(200) width.

*when you use Freemargin or Equity, trail width is not fixed, because Freemargin and Equity itself are changing.

Equity Manager for Martingale Lover v2:

Trailing Equity is added.

Trailing Equity starts trailing when specified Equity (an amount of money or percentage) is reached.

You can specify trail start level and trailing width.

example)

Initial Equity 10000 / Trail Start 500 / Trail Width 200

When current Equity exceeds 10500, EA starts trailing by 200 width (start from 10300).

Problem and Solution:

1) Trailing P/L & Trailing Equity

Of course these trailing functions don't use physical stop, so there is a problem.

These EAs observe momentary maximum P/L or Equity and start trailing when it exceeds specified value.

If you quit MT4 or reset EA (for example when you change settings), EA forget maximum P/L or Equity and current stop level.

So, you have to run MT4 24/7 to make it work fully automatically.

But you will need shut down PC sometimes.

One solution for this is to input stop level manually before you quit.

(But It must be reset manually to as it was after EA has reset everything by TP or SL.)

2) update Initial Equity

For Equity Manager for ML, EA forget Initial Equity that has been reset (I mean after TP or SL) also.

If Equity Manager has not reset everything yet, it causes no problem.

But after Equity Manager has reset everything, Initial Equity must be updated manually before you quit, or EA will forget it.

Once it is updated, EA doesn't forget it (its setting remains).

Common Tips:

1) If you input trail start level less than zero, EA starts trailing immediately.

2) As I wrote at previous post, you can move stop level to breakeven or lock up some profit manually.

3) You can turn off trailing if you don't need it. (so I will delete old versions later.)

 

Thank you latimeria.Ya its a great one.I started the course now.

By the way,i got a simple strategy not sure if you can help me write an EA.Actually I have been emotional during trading thats why I thought of having an EA that have all my rules in it.

 

darrenlck,

At least I won't write an EA for you or anyone although it's easy to do so.

Doing it yourself is the best way.

Before everything, you must finish the lessons, learn from the codes that other coders have written and make try and error for your own one.

You can search web for information, and MetaEditor itself has a search function and dictionary for its prepared functions.

Then, if there is something you can't figure out, ask here. I will and Other coders will help you.

---

About your problem to be emotional during trading, EA doesn't solve all your problem.

Yes, EA has no emotion, it's true. But what if you break your programmed rules manually? (And most people are doing such a thing, taking profit manually or trying to fit by changing parameters everyday...)

Remember that EA helps you as long as you follow the rules you have decided.

It means if you can't be consistent, EA won't be of any help to you.

 

Hi Latimeria,so you are japanese?Thanks for your advise.I will strive to learn and write myself. If I don't know anything,can I ask for your guidance,not asking you to help me write an EA?I need to understand more into it on how its writen.

 

works great

I like the martingale one because it actually shows all the figures (and percentages) in real time. It is better than the simple basket close. I would advise all users to go directly with the martingale equity script if possible. Does exactly what u say it would do. Great job. I was searching for something like this for a while. Found several things that came close, but yours seems to have the best of everything I was looking for.

One of the things that I particularly like also is that you can specify the initial equity. This is huge, because, like you noticed, there are times where you have to shut down mt4. Also there are times where you may be applying this to a terminal that already has trades initiated. So this way you do not have to close everything out and start from scratch. You can start it at any point and it can control your trading.

It also closes out trades quickly. Something else I like.

A few suggestions:

- I'd like to add a template to make the chart blank and then add the ea in such a way that all I see is the text for the equity mgmt. I don't want to see anything else related to the chart. I saw another money management script that did this (you applied a template that made the whole chart completely black. Then applied the script and all you saw was the script text in larger letter)

- make the text of the equity manager script output TEXT bigger. It is small on the screen. Also would like to move some of the text to the right. So make 2 columns so to speak of text. You could break it right at the

- Perhaps you could expand on this equity trailing as so to make it symbol-specific. I would like to see each symbol get the trail as well.

- have it automatically check the equity every .5 seconds or xx seconds. Right now it is tied to the next tick. I choose a chart like gbpusd or eurusd, but it still misses ticks sometimes as that market may be quiet and other markets are moving and affecting real-time equity. So the ability for the program to take snapshots of equity and run calculations independent of waiting for next tick of the chart ea is running on.

 

also, I had thought of a couple of other things. Either write to a txt file or take a screenshot of the latest stats BEFORE the reset of the numbers when the stop loss or take profit target is hit..

This way, we can keep tabs on how many times our profits or losses were hit and what were the stats at that time. We are not guessing what happened or how many times our target was hit over the last few days.

Should also have labeled maximum drawdown just like it has maximum equity (and percentage). Should show the maximum drawdown that the acct has witnessed.

 

Close only profit trades

I wonder if there was an Ea that closes only profit trades when these trades reaches certain amount or certain number regardless of equity position.İt may be magic number dependent or pair dependent.

 

[Need Help] How to Disable EAusing coding?

hi..

i have EA.. just close all post when Equity reach.. but after that new trade was open again and again..

i need your help to modify equity EA.. if equity reach.. close all post and also disable EA..

Reason: