MPTM updated

MPTM's new home
Post Reply
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

MPTM updated

Post by SteveHopwood »

Fourxxxx » Sat Jan 09, 2021 1:15 am wrote:Thank you Steve, I see now my original logic was flawed, to me it looks like the code you wrote would act as per the image, which is exactly what I am trying to achieve.



A buy at the yellow circle (which is an actual trade I entered) would close in profit at the red circled close after previously closing above the red MA then closing below it if I am understanding the code correctly. Now I will have to wait till Monday to see how it goes.
Good for you for getting your hands dirty and grovelling around under the hood of Empty4. :clap: :clap: :clap: :clap: :clap: :clap: :clap:

I neither know nor care whether my latest posts will help you. What I can say is this: you will never be sorry once you have mastered some basic CrapQl4 coding.

Up an at em, Tiger.


:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
danjuma
Trader
Posts: 68
Joined: Mon Jun 10, 2013 4:14 pm

MPTM updated

Post by danjuma »

Something I have noticed with the use of the part-close at breakeven with the jumping stop loss. If for example you have 0.1 lots and set 'use break even' to true, 'pips to break even' to 100,' allow partial trade closure at break even' to true, 'fraction of the trade lots to close' to 0.5, 'use jumping stop loss' to true, and 'Jump in this pips increment' to 100. What from my understanding should happen is that the EA closes 0.05 lots at BE, and leave the remaining 0.05 lots to run, setting the stop loss after every 100 pips jump. However, what the EA has been doing is still closing a portion (about half in this case as per the fractional setting of 0.5) of the remaining 0.05 lots. So, it closes the initial 0.1 lots at BE, then closes 0.02 lots of the remaining 0.05 lots after jumping 100 pips, instead of just leaving remaining 0.05 lots to run. So, basically, the EA keeps part closing the lots continually instead of just once (at break even). Below is a screenshot of my settings. Thanks
PS. using the latest version 1e
You do not have the required permissions to view the files attached to this post.
Naki003
Posts: 9
Joined: Wed Nov 14, 2012 10:31 pm
Location: Hungary, Szeged

MPTM updated

Post by Naki003 »

Dear Steve,
since 2012 I am mainly silently lurking and just using the neat stuff available here in SHF. English is not my native language, so I try my best to be understandable.

Currently, I am interested in historical graphical backtesting of a certain strategy. My view is that adding a new feature to MPTM would open a completely new field of application possibility.

In detail, let's imagine that there is a naked chart on which the entry points of a certain strategy are marked. This could be coloured horizontal lines (red lines for sells, green lines for buys, always candle open). If MPTM could handle and manage these entry points, with its help it would be possible to backtesting in Strategy Tester any strategy and later on the same expert (MPTM) could manage the previously tested strategy with the same setting in a live account.

I am not a coder, and I do not know whether it is possible and/or how big a challenge to do this...
Anyways, I would like to offer my time and hardware for testing purposes...

Thanks in advance for your answer.
Tom
User avatar
c1borg
Trader
Posts: 454
Joined: Sun Aug 14, 2016 5:09 pm

MPTM updated

Post by c1borg »

Naki003 » Mon Mar 01, 2021 1:57 pm wrote: Currently, I am interested in historical graphical backtesting of a certain strategy. My view is that adding a new feature to MPTM would open a completely new field of application possibility.

If MPTM could handle and manage these entry points, with its help it would be possible to backtesting in Strategy Tester any strategy and later on the same expert (MPTM) could manage the previously tested strategy with the same setting in a live account.
FYI backtesting is a taboo subject on SHF
User avatar
WorldsEnd
Trader
Posts: 95
Joined: Fri Aug 29, 2014 7:36 pm

MPTM updated

Post by WorldsEnd »

Does anybody sees a chance to set up MPTM in such a way that it only handles pending trades? Leaving the market trades for themselves? I'm stuck :?
Sergio
Trader
Posts: 16
Joined: Tue Jul 14, 2020 9:31 pm

MPTM updated

Post by Sergio »

Greetings fellow traders,

MPTM is gold like everything else here. Thanks Steve!

I have a request for the coders if possible.

I usually like to set my TP and SL on BIG numbers.

Is it possible to add a feature into the EA that sets a hidden TP and SL to a specific price for all the trades/pending trades?
Capture.PNG
Sergio
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

MPTM updated

Post by SteveHopwood »

I have updated MPTM. This update is of no significance and so can safely be ignored.

I was using ATR to insert a missing take profit and noticed that the display only shows the 'hard' take profit, so I have updated the display to show the MPTM is using ATR for the calculation.

Easy DIY. Pop this function in somewhere:

Code: Select all

string timeFrameToString(int tf)
  {

   string timeFrame = "";
   
   
   
   switch(tf)
   {
      case PERIOD_M1:
         timeFrame="M1";break;

      case PERIOD_M5:
         timeFrame="M5";break;

      case PERIOD_M15:
         timeFrame="M15";break;

      case PERIOD_M30:
         timeFrame="M30";break;

      case PERIOD_H1:
         timeFrame="H1";break;

      case PERIOD_H4:
         timeFrame="H4";break;

      case PERIOD_D1:
         timeFrame="D1";break;

      case PERIOD_W1:
         timeFrame="W1";break;

      case PERIOD_MN1:
         timeFrame="MN1";break;

      

   }//switch(tf)


   return(timeFrame);

  }//string timeFrameToString(int tf)
Then go to void DisplayUserFeedback() and scroll down to: if(AddMissingTakeProfit)

Replace the existing code block with this:

Code: Select all

   if(AddMissingTakeProfit)
   {
      if(!UseTpAtr)
         SM("Adding missing Take Profit at " + IntegerToString(MissingTakeProfitPips) + " pips." + NL);

      if(UseTpAtr)
      {
         string tf = timeFrameToString(AtrTpTimeFrame);
         SM("Adding missing Take Profit using ATR on the " + tf + NL);
      }//if (UseTpAtr)

   }//if (AddMissingTakeProfit)
:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
DrWho
Posts: 1
Joined: Tue Jun 15, 2021 8:43 am

MPTM updated

Post by DrWho »

Hi,
I've used MPTM successfully on Empty4 in the past but now also have an MT5 account which I would like to run this on which would mean converting the code to MT5.
I can obviously ask Steve if he is interested (for which I would pay him) or I can go to a freelance site. However, there may already be an MT5 version which is the question I'm asking now. Is there ?
I'm quite happy to pay as it's a valuable piece of kit for which I thank Steve.
Keep up the great work.

PS I would also be interested in partnering up with anyone else (or a coder) to get this done.
PPS Apparently this uses a library compiled in Empty4 viz hgi_lib.mq4, does any one have the source code for MQ5 ?
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

MPTM updated

Post by SteveHopwood »

DrWho » Fri Jun 18, 2021 7:59 am wrote:Hi,
I've used MPTM successfully on Empty4 in the past but now also have an MT5 account which I would like to run this on which would mean converting the code to MT5.
I can obviously ask Steve if he is interested (for which I would pay him) or I can go to a freelance site. However, there may already be an MT5 version which is the question I'm asking now. Is there ?
I'm quite happy to pay as it's a valuable piece of kit for which I thank Steve.
Keep up the great work.

PS I would also be interested in partnering up with anyone else (or a coder) to get this done.
PPS Apparently this uses a library compiled in Empty4 viz hgi_lib.mq4, does any one have the source code for MQ5 ?
I have some fantastic news for you.

Thomas' (tomele) genius goes from strength to strength.

I know nothing of the details, but Thomas is developing libraries that will enable instant conversion of .mq4 source files to .ex5 files. He told me this last week. This means that we will not need to convert all of our .mq4 source files to .mq5 source files. Instead we will be able to compile .mq4 into .ex5 format.

Thomas' work is a long way from complete but he has indicated to me privately after I sent him your post, that he is willing to use MPTM as a test/development tool assuming you are both willing to pay and allow the ex5 version of MPTM to be released freely as usual.

Over to you DrWho. You can pay now or wait for the release of the stuff Thomas is concocting - probably several months away. I am guessing that TDesk/Desky would be Thomas' immediate targets for conversion. Send him a pm and discuss this.

For sure, I would spend about 10 days thinking about this before going outside the mild waters of SHF for this; there are huge sharks out there only too happy to separate you from vast wedges of cash; SHF coders do tend to spoil folks like you when it comes to the reality of paying for coding.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

MPTM updated

Post by SteveHopwood »

V 1f is in post 1. From the updated user guide:
  • Global equity target setting: this is the same sort of feature as the global order closure but works slightly differently. Here, MPTM calculates a cash profit target based on a percentage of the account balance (or equity) and then closes the position when the equity reaches this target.
    • UseGlobalEquityTarget: turns this on/off.
    • PercentageTarget: the percentage of the account balance to set as your target. For example:
      • Your account balance is $10,000.
      • Your PercentageTarget is 2%.
      • Your equity target is $10,200.
      • MPTM then recalculates the target on the balance of $10,200.
    • UseAccountBalance: calculate your equity target from the account balance.
    • UseAccountEquity: calculate your equity target from the account equity.
    • ShowAlertAfterTargetHit: tells MPTM to show an Alert message when the position should have been closed.
The inputs are in between the global position closure and shirt protection inputs.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Utilities Indicators and Scripts”