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

Once a Month EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3649
Page 4 of 18
Author:  SteveHopwood [ Tue Jun 10, 2014 9:46 pm ]
Post subject:  Once a Month EA

Elixe » Tue Jun 10, 2014 9:37 pm wrote:
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 ?).
It requires a slightly different approach if guys want trades sent without a take profit and would be different to what I envisaged. Not a problem to do, so let me know if so.

:xm:
Author:  SteveHopwood [ Wed Jun 11, 2014 9:13 am ]
Post subject:  Once a Month EA

V 1b is in post 1, with the fixes. Please read the section in post 1 about trade open hours. Also, I discovered that I had not coded the high swap pairs filter, so I added this. I have described the changes further down so you can make them yourselves should you wish to.

4 of my trades have hit tp so far, and so I am up 356 pips, with c. 190 in drawdown. I have been a bit naughty; these trades are on my tiny Cowboy IBFX mini account, so I am watching OAM with live cash. Let's hope the success continues.

:xm:


Those of you who can, make the changes yourselves to save a download:
line 591. Change

Code: Select all

      //Insert a missing take profit
      if (CloseEnough(OrderTakeProfit(), 0) )  
         InsertTakeProfit(cc, OrderTicket(), OrderType());
to

Code: Select all

      //Insert a missing take profit
      if (CloseEnough(OrderTakeProfit(), 0) )  
         if (!CloseEnough(TakeProfitMultiplierPercent, 0) )
            InsertTakeProfit(cc, OrderTicket(), OrderType());
Line 1013. Change

int hour = TimeHour(TimeLocal() );
(remember to ignore/change the time instruction at line 56)
to

int hour = TimeHour(TimeCurrent() );

Then line 977 and insert

Code: Select all

         //High swap pairs filter
         if (!TradeDirectionBySwap(TradePair[cc], type))
            continue;
Author:  fxozgirl [ Wed Jun 11, 2014 10:07 am ]
Post subject:  Once a Month EA

SteveHopwood » Wed Jun 11, 2014 7:42 am wrote:
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:
No problem Steve, at first I was thinking setting it to 0 would just disable it, but once I actually thought it through I ealised what I had done :D
Author:  SteveHopwood [ Wed Jun 11, 2014 10:20 am ]
Post subject:  Once a Month EA

fxozgirl » Wed Jun 11, 2014 10:07 am wrote:
No problem Steve, at first I was thinking setting it to 0 would just disable it, but once I actually thought it through I realised what I had done :D
Thanks for reminding me. One of the changes I made allows users to disable take profit by setting the input to 0 - I just need to edit post 1 again.

:xm:
Author:  SteveHopwood [ Wed Jun 11, 2014 12:29 pm ]
Post subject:  Once a Month EA

V 1c is in post 1.

We need more data on open trades. Please read 'The chart display' in post 1 for details of the new display I have added, and give some thought to the questions I pose.

:xm:
Author:  SteveHopwood [ Wed Jun 11, 2014 8:30 pm ]
Post subject:  Once a Month EA

Happy birthday Shelley. :party: :party: :party: :party: :party:

:!!: :!!:
Author:  fxozgirl [ Wed Jun 11, 2014 8:41 pm ]
Post subject:  Once a Month EA

SteveHopwood » Thu Jun 12, 2014 6:30 am wrote:Happy birthday Shelley. :party: :party: :party: :party: :party:

:!!: :!!:
Thanks Steve :smile: :party:
Author:  bazze [ Wed Jun 11, 2014 9:26 pm ]
Post subject:  Once a Month EA

Happy Birthday from Norway too :party:
Author:  fxozgirl [ Thu Jun 12, 2014 8:55 am ]
Post subject:  Once a Month EA

bazze » Thu Jun 12, 2014 7:26 am wrote:Happy Birthday from Norway too :party:
Cheers bazze :cheer:
Author:  SteveHopwood [ Thu Jun 12, 2014 10:34 pm ]
Post subject:  Once a Month EA

Interesting times on my live Cowboy IBFX account.

So far, 10 trades closed at their 33% tp. Up until earlier today, closed upl always trailed dd by about 50 pips or so. At the mo, closed upl is leading dd by about 130 pips, and has led dd for most of the day.

Given that I do not want to close out at my realised profit so far, the success or otherwise of the trading this month now largely depends on what happens to the current losers. If they turn around, then great. If not, then oops.

So maybe this throws another question into the mix. When x trades have closed in profit, and the overall position is in profit, should we then close the entire position?

Don't know the answer. The trade simulator based its results on allowing trades to run until either tp or the end of the month, so I am going to allow my live trades to follow to the same conclusion. Don't repeat this on your $50,000 pension fund account guys. I can afford to blow my account. Again. You cannot.

:xm:
All times are UTC Page 4 of 18