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

Round Number Trap!
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=266
Page 2 of 3
Author:  magft [ Thu Jan 19, 2012 3:43 pm ]
Post subject:  Re: Round Number Trap!

Here is the first version, though i think it is not exactly right at the moment.

Can you test it and report back as i need to do some other things now?

Thanks

Mike
Author:  Alpenkorps [ Thu Jan 19, 2012 4:09 pm ]
Post subject:  Re: Round Number Trap!

magft wrote:Here is the first version, though i think it is not exactly right at the moment.

Can you test it and report back as i need to do some other things now?

Thanks

Mike
It seems to me that lots are not multiplying. Everything else is working fine.
I'll do more test and let you know.

I could be wrong (I have this amazing ability about messing up EA's settings) so could you please check again? Martingale set to true, lot multi set to 2.
Author:  magft [ Thu Jan 19, 2012 4:16 pm ]
Post subject:  Re: Round Number Trap!

Use this version, i had added some bugs whilst messing around with the code!!

This still isnt quite right though.
Author:  Alpenkorps [ Thu Jan 19, 2012 4:59 pm ]
Post subject:  Re: Round Number Trap!

magft wrote:Use this version, i had added some bugs whilst messing around with the code!!

This still isnt quite right though.
Martingale working now. But there are still some problems in taking orders.
Author:  magft [ Thu Jan 19, 2012 6:02 pm ]
Post subject:  Re: Round Number Trap!

Alpenkorps wrote:
magft wrote:Use this version, i had added some bugs whilst messing around with the code!!

This still isnt quite right though.
Martingale working now. But there are still some problems in taking orders.
If possible could you draw on a chart from last couple of days the trades the EA should have taken so i can then test in ST. Or can you describe what is wrong so i know what to fix.

Thanks

Mike
Author:  magft [ Thu Jan 19, 2012 7:54 pm ]
Post subject:  Re: Round Number Trap!

Okay, done another rewrite of the code and it seems to work for SL as well as TP now finally :roll:

Try this one and if you are happy with it i'll open a new tread for others to test. This has been a real logic nightmare with several coding bloops that were difficult to spot! Anyway i learnt more about pending trades so all good.

Mike
Author:  Alpenkorps [ Fri Jan 20, 2012 3:16 am ]
Post subject:  Re: Round Number Trap!

EA works up to level 2 nicely. At level 3 it doesn't increase the lot size, But then again, does for level 4.
Attached image is an example.
Arrow 1 = Closed 0.1 lot
Arrow 2 = Closed 0.2 lot
Arrow 3 = Closed 0.2 lot (it should be 0.4)
Arrow 4 = Closed 0.4 lot (ok considering last lot, but overall should be 0.8)

Thank you for your work so far Mike, we are almost there :)
Author:  magft [ Fri Jan 20, 2012 8:47 am ]
Post subject:  Re: Round Number Trap!

Alpenkorps wrote:EA works up to level 2 nicely. At level 3 it doesn't increase the lot size, But then again, does for level 4.
Attached image is an example.
Arrow 1 = Closed 0.1 lot
Arrow 2 = Closed 0.2 lot
Arrow 3 = Closed 0.2 lot (it should be 0.4)
Arrow 4 = Closed 0.4 lot (ok considering last lot, but overall should be 0.8)

Thank you for your work so far Mike, we are almost there :)

That is very strange, but doesnt suprise me :roll: I will check the sequencing again it must still be a typo like in the last version i missed!

Have I added everything you requested at first? Once i have fixed this bug i will open a new thread for serious testing. Do you want lines drawn at the round numbers? I noticed in the picture you had added one, so i could get it to draw nearest two numbers or even all the ones listed in the user display (half round, round and big numbers high and low).

Regards

Mike
Author:  Alpenkorps [ Fri Jan 20, 2012 9:08 am ]
Post subject:  Re: Round Number Trap!

magft wrote:
Have I added everything you requested at first? Once i have fixed this bug i will open a new thread for serious testing. Do you want lines drawn at the round numbers? I noticed in the picture you had added one, so i could get it to draw nearest two numbers or even all the ones listed in the user display (half round, round and big numbers high and low).

Regards

Mike
Yes everything is there, I cant think of something else. A forced margin check would be good, but not essential. And I would like to clear another point, Pending orders are placed +/- 10 pips from the round numbers, not according to the open order or anything. Stop loss and Take profit are placed after a PO gets triggered because of the slippage.

No need to draw the lines, you are already fighting enough problems. I have found an indi that can draw the lines (attached).

Thank You.
Author:  magft [ Fri Jan 20, 2012 9:25 am ]
Post subject:  Re: Round Number Trap!

Alpenkorps wrote:
magft wrote:
Have I added everything you requested at first? Once i have fixed this bug i will open a new thread for serious testing. Do you want lines drawn at the round numbers? I noticed in the picture you had added one, so i could get it to draw nearest two numbers or even all the ones listed in the user display (half round, round and big numbers high and low).

Regards

Mike
Yes everything is there, I cant think of something else. A forced margin check would be good, but not essential. And I would like to clear another point, Pending orders are placed +/- 10 pips from the round numbers, not according to the open order or anything. Stop loss and Take profit are placed after a PO gets triggered because of the slippage.

No need to draw the lines, you are already fighting enough problems. I have found an indi that can draw the lines (attached).

Thank You.
Scoobs and ForexKiwi margin checks are in there already. Currently i have set the EA to enter the PO and then once order is in place it then uses the order open price, this should include any slippage, to add on SL/TP as per your original description. When a PO is deleted and lot size doubled i do take the order open price and use that at the moment but i can change this to the round number again as that sounds more like what you mean. I'll do this for the thread version later on, adding lines is fine as i have the code already if you want it. If your happy with the extra indy then i'll leave it.

Regards

Mike
All times are UTC Page 2 of 3