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

Once a Month EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3649
Page 3 of 18
Author:  excalibre30 [ Fri Jun 06, 2014 4:09 am ]
Post subject:  Once a Month EA

Haha. Everyone's anticipating and really itching to get this started too.
SteveHopwood » Fri Jun 06, 2014 5:43 am wrote:Earlier today being 'trading day no 4' I ran the simulator and saw a just over 6000 pip profit for the default stuff, so I launched OAM to see what would happen.

4 trades have hit tp, so 19 remain outstanding. Closed profit pips are c. 230, whilst closing the remaining trades would leave a profit of about 170 pips.

Going to leave the trades to run and see what happens. I am just getting itchy feet before the 7th trading day. :x

:xm:
Author:  zader [ Fri Jun 06, 2014 10:07 am ]
Post subject:  Once a Month EA

excalibre30 » Fri Jun 06, 2014 4:09 am wrote:Haha. Everyone's anticipating and really itching to get this started too.
SteveHopwood » Fri Jun 06, 2014 5:43 am wrote:I am just getting itchy feet before the 7th trading day. :x
:xm:
Spare a thought for me, I'm not starting mine till day 17 :shock: The table I posted on page1 shows day 17 as the 1st day with no red numbers, so I expect it to go right into profit with no DD at all :lol:
Author:  excalibre30 [ Fri Jun 06, 2014 10:14 am ]
Post subject:  Once a Month EA

Spare a thought for me, I'm not starting mine till day 17 :shock: The table I posted on page1 shows day 17 as the 1st day with no red numbers, so I expect it to go right into profit with no DD at all :lol:
Yeah. I did not notice that. There is a difference of 400 pips though but the DD looks good if that happens.
Author:  Elixe [ Tue Jun 10, 2014 7:23 pm ]
Post subject:  Once a Month EA

Steve, I might have found a bloop in the EA :

My parameters are :

Code: Select all

SendTradesDay = 7;
SendTradesHour = 9;
My trades got triggered 09/06 at 23h CET. I'm in France, CET (GMT + 2).

So, what I found out :
In GetTodayTradingDayNumber, you are counting TradingDay based on TimeCurrent(), that is the server time, for GP it is GMT + 3.

In onTick function, you are defining the hour :

Code: Select all

int hour = TimeHour(TimeLocal() );
(starting to see were i'm going ? Image)

Lower in the onTick, we have this :

Code: Select all

   if (DayTradingStatus == opentrading)
      if (hour >= SendTradesHour)
That's were lies the issue I think, when TimeCurrent() switched to day 7 / 00:00, TimeLocal() was day 6 / 23h. So DayTrading was saying "Hey Hour, go on i'm on the 7th day", and hour answered "Okay then, I'm at 23, that's way greater than 9, let's send thoses trades".

Haven't tested yet a solution as I just found that out, but just switching to an exact hour check will probably solve this.

There's probably the same issue in the closing code.
Author:  SteveHopwood [ Tue Jun 10, 2014 7:36 pm ]
Post subject:  Once a Month EA

Elixe » Tue Jun 10, 2014 7:23 pm wrote:Steve, I might have found a bloop in the EA :

My parameters are :

Code: Select all

SendTradesDay = 7;
SendTradesHour = 9;
My trades got triggered 09/06 at 23h CET. I'm in France, CET (GMT + 2).

So, what I found out :
In GetTodayTradingDayNumber, you are counting TradingDay based on TimeCurrent(), that is the server time, for GP it is GMT + 3.

In onTick function, you are defining the hour :

Code: Select all

int hour = TimeHour(TimeLocal() );
(starting to see were i'm going ? Image)

Lower in the onTick, we have this :

Code: Select all

   if (DayTradingStatus == opentrading)
      if (hour >= SendTradesHour)
That's were lies the issue I think, when TimeCurrent() switched to day 7 / 00:00, TimeLocal() was day 6 / 23h. So DayTrading was saying "Hey Hour, go on i'm on the 7th day", and hour answered "Okay then, I'm at 23, that's way greater than 9, let's send thoses trades".

Haven't tested yet a solution as I just found that out, but just switching to an exact hour check will probably solve this.

There's probably the same issue in the closing code.
I know. Mixing TimeCurrent() and TimeLocal() doesn't work here - I found out the same way you did. I will add the fixes soon.

:xm:
Author:  fxozgirl [ Tue Jun 10, 2014 8:58 pm ]
Post subject:  Once a Month EA

fxozgirl » Tue Jun 03, 2014 7:27 am wrote:
So I think I am going to run the following demo's:

1. Based on last 12 months analysis Trade Day 7 using TakeProfitMultiplierPercent at 50%
2. Based on last 12 months analysis Trade Day 7 and using Paul's MPBM set for 250 pips TP per pair (does anyone know if MPBM has been update to work on Empty4 6xx?)
3. Based on last 12 months analysis Trade Day 7 and using the average highest pips won & lowest pips won, I will set an individual TP for each pair.

My 3 demo's fired up yesterday:
Demo 1 & 2, Day 7 - 8.00am start time, which is 1 hour into the new trading day here.
Demo 3 - 7.00am start time (1 hour earlier at day open)

Demo 1 & 3 results almost identical
OAM_open_trades_11.06.14.png
Demo 2 - OAM set all TP at the same price as the open price...just wondering if that would be caused by changing the TakeProfitMultiplierPercent to 0.0? I did have MPBM set up to manage the trades as a basket. I re-set the EA to open on Day 8 so will see if the same thing occurs again.
OAM2_closed_trades_10.6.2014.png
Author:  OldTrader [ Tue Jun 10, 2014 9:07 pm ]
Post subject:  Once a Month EA

mine did the same thing, and i had my tp set to 50%. so dunno
Author:  Elixe [ Tue Jun 10, 2014 9:37 pm ]
Post subject:  Once a Month EA

fxozgirl » 25 minutes ago wrote:just wondering if that would be caused by changing the TakeProfitMultiplierPercent to 0.0?
Glancing at the code, I would say yes, as the take profit is computed by adding the average TP multiplied by TakeProfitMultiplierPercent to the order open price.

One fast fix would be to edit lines 916 & 922 this way but wait for Steve's opinion on this :

Code: Select all

916 : if (type == OP_BUY && TakeProfitMultiplierPercent > 0)
922 : if (type == OP_SELL && TakeProfitMultiplierPercent > 0)
OldTrader, in the user feedback, does the av prof has a value ? another reason for this TP = Open Price would be that the average profit calculation returned 0 (that might be a missing history issue then ?).
Author:  SteveHopwood [ Tue Jun 10, 2014 9:42 pm ]
Post subject:  Once a Month EA

fxozgirl » Tue Jun 10, 2014 8:58 pm wrote:
fxozgirl » Tue Jun 03, 2014 7:27 am wrote:
So I think I am going to run the following demo's:

1. Based on last 12 months analysis Trade Day 7 using TakeProfitMultiplierPercent at 50%
2. Based on last 12 months analysis Trade Day 7 and using Paul's MPBM set for 250 pips TP per pair (does anyone know if MPBM has been update to work on Empty4 6xx?)
3. Based on last 12 months analysis Trade Day 7 and using the average highest pips won & lowest pips won, I will set an individual TP for each pair.

My 3 demo's fired up yesterday:
Demo 1 & 2, Day 7 - 8.00am start time, which is 1 hour into the new trading day here.
Demo 3 - 7.00am start time (1 hour earlier at day open)

Demo 1 & 3 results almost identical


Demo 2 - OAM set all TP at the same price as the open price...just wondering if that would be caused by changing the TakeProfitMultiplierPercent to 0.0? I did have MPBM set up to manage the trades as a basket. I re-set the EA to open on Day 8 so will see if the same thing occurs again.
If you set a multiplier value to zero, then it multiplies the figure it is multiplying by zero, giving a result of zero. So, you add zero to the order open price and your tp is the same as the order open price. I am surprised your platform did not whinge at you and refuse to play ball.

:xm:
Author:  OldTrader [ Tue Jun 10, 2014 9:44 pm ]
Post subject:  Once a Month EA

thanks yeah, apparently i just didn't notice that it was 0. i just changed chart tf and back, and i get the av tp now.
All times are UTC Page 3 of 18