EA from scratch - Part 1 - page 2

 

...okay I am working on a prototypical splice...

...I have extracted a "ea" written by metaquotes, called, "5 8macross",

and noticed the simplicity of it. What I plan to do is communicate with it,

and by doing so I will be able to change it, just to prove this theory of cre-

ating a "DrawDownprotect". Then the "dd" protect will be implemented by

using a "simple hedge ea", nestled in an "if, then" statement, and see if it

"talks" back...

...any mathmatical adjustments will come later...

 

I'm game. We all have the Moving Average.mq4 EA that installs with MT4 so perhaps we should pull that apart at some point?

My programming experience amount to diddly squat coming from using QL Super BASIC and 68008 assembly language so I'm familiar with arrays, variable declarations, procedure calls, mnemonics and registers (not looking good, is it?). Program and sytax structure are familiar but that's about it really.

I'm in two minds whether it's best to start building our own indicator first (say simple MA x-over type) and then the EA or just rushing head long into an EA. What do you think about this?

 
Sadly:
I'm game. We all have the Moving Average.mq4 EA that installs with MT4 so perhaps we should pull that apart at some point?

My programming experience amount to diddly squat coming from using QL Super BASIC and 68008 assembly language so I'm familiar with arrays, variable declarations, procedure calls, mnemonics and registers (not looking good, is it?). Program and sytax structure are familiar but that's about it really.

I'm in two minds whether it's best to start building our own indicator first (say simple MA x-over type) and then the EA or just rushing head long into an EA. What do you think about this?

...your knowledge of programming is better than mine, all I am is an "idea smith" for now. My brother is an engineer for Honeywell and looked at "ea" codes and said they are interfaceable, but to design a zero drawdown "ea" is not far fetched. In the meantime I will read c++ tutorials, and "frankenstein" together from different MA & Hedged "ea's"..

 

Just about over my bout of flu so I'll pick this up over the weekend when i get a moment.

What I thought we could do is look at the attached 2 .mq4 files. One is a moving average indicator and the other is a simple moving average EA. Both are standard with MT4.

Is everyone good with that?

 
Sadly:
Just about over my bout of flu so I'll pick this up over the weekend when i get a moment.

What I thought we could do is look at the attached 2 .mq4 files. One is a moving average indicator and the other is a simple moving average EA. Both are standard with MT4.

Is everyone good with that?

...I have been formulating the "drawdown protect" strategy, here's an attachment of the graphic, what happens when a certain percentage of equity is obtained...all positions are closed, then another position opens...

...what-ifs

1. price spiking...well when the price falls, triggering "drawdown" protection, then imediately spikes in the other direction, the positions close protecting profit, how does it do this, when spiking occurs there is 1 to 5 pip "profit trailing stop", that triggers when breached...

2. trending, "drawdown" protection is on alert status, while the "ea" takes advantage of volatility...

...how to code all this? Well I am learning c++ it may take awhile...

...here's how to interpret the graphic;

1. BUY GBP/USD AT 2.0215 AT .1 LOT(1 USD)

2. THE PRICE DROPS TO 2.0155, A -60 PIP DROP

3. DRAWDOWN IS -$60.00

4. $500.00 DEPOSIT BECOMES $440.00

5. DRAWDOWN PROTECTION IS ACTIVATED AT 2.0210 AT .15 LOT(1.50 USD)

6. EQUITY IS NOW $522.50

POSITIONS ARE CLOSED TO LOCK IN PROFIT, REPEAT THIS CONSTANTLY AND YOU WILL HAVE AN

INTERESTING EQUITY CURVE, PLUS ADD IN STEPPING...

Files:
 

Erm, that could be some way off yet.

Meanwhile, see the attached new indicator which never looses money (fully commented )

Please feel free to add something functional to it, add comments to your code too so we understand what's going on when we look at it and study it. Then we pass it on to our other friends here to add to and comment on.

 

v0.2 introduces the Day() and Month() functions. These return the value of the current day number in the current month and current month number respectively

 
Sadly:
v0.2 introduces the Day() and Month() functions. These return the value of the current day number in the current month and current month number respectively

...ok your thinking in stages, I was theorizing and idealizing..., but I could be of big help to you, after I absorbed c+++++++++++++++++++++++++++, and that's how long it takes to learn it...

 

Here's a indicator which plots the low price relative to the previous bars low price. When the histogram is above the zero line this represents a higher low than the previous bar. When the histogram is below the zero line this represents a lower low than the previous bar. The difference in price between the lows is shown on the X axis.

Files:
 

high_plot_v0.1

Here's a indicator which plots the high price relative to the previous bars high price. When the histogram is above the zero line this represents a higher high than the previous bar. When the histogram is below the zero line this represents a lower high than the previous bar. The difference in price between the highs is shown on the X axis.

Files: