stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

James16: the EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=377
Page 6 of 8
Author:  fxozgirl [ Sat Mar 17, 2012 3:00 am ]
Post subject:  Re: James16: the EA

SteveHopwood wrote: Shelley, that is just plain awesome.

What I coded was a misunderstanding of the idea, so the correction is in post 1. At least it should be. I have had a busy day, am tired, and made the correction under The Affluence. It might need checking in the sober light of tomorrow. :lol:

Note to fledgling coders: despite being a non-coder, Shelley was able to spot my error because of the comment that showed what I had coded. Ok, so she clearly has a brain the size of Jupiter, but the comment merely made it easier for her to spot the error. So, comment everything you do. I am not the greatest commenter in the world, but am getting better. I once read some advice from a pro programmer who said that his comments were always longer than his code. I am gradually coming to understand why.

If you look at code produced by the likes of squalou, the comments are both extensive and comprehensive. So yep; comment everything.

Nice one Shelley.

:D
LOL Steve, not sure about a brain the size of Jupiter...some days I'm pretty sure it shrinks to the size of Pluto instead :lol:

And....

the only way I would have picked up the error/misunderstanding was because of your comments...if you hadn't commented it, I would still have been sitting here with eyes glazed over completely oblivious :oops:

Anyway, thanks for the fix, hopefully we shall see when markets open on Monday that all is well :D

Thanks again :D
Author:  fxozgirl [ Sat Mar 17, 2012 3:04 am ]
Post subject:  Re: James16: the EA

blahn wrote:
fxozgirl wrote:
blahn wrote:Ya, that's what I figured. D1 is pretty smooth. On the other hand, my 16 h1 trades at $45 have increased to 18 floating trades at over $80 profit. it's been a while since i've had a demo acct show roughly 800 pips profit in 1 day. will have to wait to see how it handles the closures tho.
james floating 2.gif

Very nice...what are you using as your exit strategy?
...I'll probably just use mptm with really loose break evens and jumps depending how strong the signals are.
Yes, this is important...either trail too close and get closed out on a smallish retrace, and then have price push ahead on you or don't trail close enough and fail to lock in pips.

So far on the Daily chart, I feel setting BE at 30 pips has been ideal, I have a JS set at 20, but still deliberating whether it would get more pips at JS30...just trial and error I guess.
Author:  fxozgirl [ Sat Mar 17, 2012 3:12 am ]
Post subject:  Re: James16: the EA

fxozgirl wrote:AUDUSD TMH - Potential set up

Looks like there is a TMH setting up for audusd, current and previous candle's highs are within 2 pips of each other, so if the current candle's high remains within the 2 pips and then continues up and breaks the high, we should be looking at a buy trade...

These trades seem to be fairly rare, so we will see what happens
audusd_tmh001.gif

The EA didn't take this trade, so I set up a pending buy order at 1.05601 (which was 5 pips above the high of the first candle), Buy order was triggered and break even has been set. At close of trading it was +27 pips
audusd_tmh001a.gif
Author:  fxozgirl [ Sat Mar 17, 2012 3:17 am ]
Post subject:  Re: James16: the EA

fxozgirl wrote: I have set up a myfxbook link, however when viewing the trade history you will need to ignore the TMHL trades as they were all taken due to a bloop in the EA when that strategy was first added & I just closed the trades (Steve has since fixed this).

In addition to ignoring the TMHL commented trades for now, I have also been taking a few manual trades to help me learn and understand the strategy better, so the stats are getting a bit messy...sorry
Author:  MiTija [ Sat Mar 17, 2012 4:36 am ]
Post subject:  Re: James16: the EA

fxozgirl wrote:
In addition to ignoring the TMHL commented trades for now, I have also been taking a few manual trades to help me learn and understand the strategy better, so the stats are getting a bit messy...sorry
No Worries!!! This is a work in progress.

Rage on, someday it will be a ripper.

Cheers,


MiTija
Author:  garyfritz [ Sat Mar 17, 2012 5:35 pm ]
Post subject:  Re: James16: the EA

SteveHopwood wrote:Shelley, that is just plain awesome.

What I coded was a misunderstanding of the idea, so the correction is in post 1. At least it should be. I have had a busy day, am tired, and made the correction under The Affluence. It might need checking in the sober light of tomorrow. :lol:
Steve, if I understand the code right, I think you still have a problem. Note the two cases:

Code: Select all

//2nd bars high must be no higher than 2 pips above the first
if (iHigh(NULL, Dbc.TimeFrame, 2) - iHigh(NULL, Dbc.TimeFrame, 1) > (Dbc.Pips * Point) ) SendLong = false;

//2nd bars low must be no lower than 2 pips above the first
if (iLow(NULL, Dbc.TimeFrame, 2) - iLow(NULL, Dbc.TimeFrame, 1) > (Dbc.Pips * Point) ) SendShort = false;
The first one says "H[2] - H[1] must be <= 2 pips."
The second one says "L[2] - L[1] must be <= 2 pips."

The two tests are the same, but since one tests highs & one tests lows, they should be mirror images. Assuming "2nd bar" in your comment means bar #1 (the most recent bar, the second bar in the sequence), then I think the test on highs is backwards.

Also: Shelley actually said the two highs/lows have to be "within 2 pips of each other." Right, Shelley? If so, then shouldn't the test be something like
if (MathAbs(iHigh(NULL, Dbc.TimeFrame, 2) - iHigh(NULL, Dbc.TimeFrame, 1)) > (Dbc.Pips * Point) ) SendLong = false;
?
Author:  SteveHopwood [ Sat Mar 17, 2012 7:03 pm ]
Post subject:  Re: James16: the EA

Nice one again Gary, thanks.

It is the High code that is wrong. It should be :

Code: Select all

      //2nd bars high must be no higher than 2 pips above the first
      if (iHigh(NULL, Dbc.TimeFrame, 1) - iHigh(NULL, Dbc.TimeFrame, 2) > (Dbc.Pips * Point) ) SendLong = false;
Fix in post 1 for those of you unable to make this change yourselves.

:D
Author:  garyfritz [ Sun Mar 18, 2012 3:13 am ]
Post subject:  Re: James16: the EA

So it shouldn't be the "within 2 pips" test using MathAbs?
Author:  fxozgirl [ Sun Mar 18, 2012 5:12 am ]
Post subject:  Re: James16: the EA

garyfritz wrote: Also: Shelley actually said the two highs/lows have to be "within 2 pips of each other." Right, Shelley?
That's correct
Author:  SteveHopwood [ Sun Mar 18, 2012 9:06 am ]
Post subject:  Re: James16: the EA

Nice one again Gary. Thanks. My misunderstanding. My thread starters often include statements along the lines of, "I have coded my understanding of xxxxx. I may have misunderstood." I am not joking when I write this. :lol:

Correction made to the latest update in post 1.

Cheers

:D
All times are UTC Page 6 of 8