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

MPTM_Global
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1633
Page 7 of 14
Author:  dudest [ Fri Jul 19, 2013 9:18 am ]
Post subject:  Re: MPTM_Global

Hallo Collector,

MPTM_Global is global's spin on MPTM (lots of kul added functionality)

The original MPTM thread ( + pdf guide ) are here: http://www.stevehopwoodforex.com/phpBB3 ... p=516#p516

Cheers
Author:  Collector [ Fri Jul 19, 2013 5:45 pm ]
Post subject:  Re: MPTM_Global

dudest wrote:Hallo Collector,

MPTM_Global is global's spin on MPTM (lots of kul added functionality)

The original MPTM thread ( + pdf guide ) are here: http://www.stevehopwoodforex.com/phpBB3 ... p=516#p516

Cheers
Hi Dudest

Thanks for the link.

Yes, I understood Global's part in it, but was also interested to know if Steve (or anyone else) was working on an upgrade, based upon improving what Steve seems to think are potentially problematic shortcomings.

Anyways, I think I'll do a bit more research before I comment further. There are parts of the forum I haven't read yet.....

Thanks for your time
Author:  Dr.Phoenix [ Sat Jul 20, 2013 3:47 pm ]
Post subject:  Re: MPTM_Global

Global, Hello Fellow

An one million question. Is there a possibility to have two sets (maybe more) of parameters for one cross pair? All sets should be active on the same chart but one of them is for one order, the other one is for another.

UPDATED. I have thought over what exactly I need and found that two sets of parameters to each pair are needful. These sets should help controlling two directions of traiding. There should be one set of parameters for the sell position(s) to be controlled and the other set of parameters - for the buy position(s).

How do you think it is realizable?
Author:  dudest [ Sat Jul 20, 2013 7:15 pm ]
Post subject:  Re: MPTM_Global

Collector wrote: Hi Dudest

Thanks for the link.

Yes, I understood Global's part in it, but was also interested to know if Steve (or anyone else) was working on an upgrade, based upon improving what Steve seems to think are potentially problematic shortcomings.

Anyways, I think I'll do a bit more research before I comment further. There are parts of the forum I haven't read yet.....

Thanks for your time
Hallo,

Steve has said in the past that (essentially) MPTM is a done deal ( i.e, no further work to be put in ). Hence why kul dudes like Global had to go out and add improvements (thanks to Global for posting his!)

Are there any shortcomings you've noticed? Maybe (in Global's thread) we can find a way of solving them...

Cheers!
Author:  global [ Wed Jul 24, 2013 10:12 pm ]
Post subject:  Re: MPTM_Global

Dr.Phoenix wrote:Global, Hello Fellow

An one million question. Is there a possibility to have two sets (maybe more) of parameters for one cross pair? All sets should be active on the same chart but one of them is for one order, the other one is for another.

UPDATED. I have thought over what exactly I need and found that two sets of parameters to each pair are needful. These sets should help controlling two directions of traiding. There should be one set of parameters for the sell position(s) to be controlled and the other set of parameters - for the buy position(s).

How do you think it is realizable?
Sorry for the long delay in getting back to you Dr. Phoenix. Anyway here is what you can do to set two sets of parameters, one for buy and one for sell, for each pair.


There are different ways to do this.

1) One way is to save two different .set files, one for buy orders and one for sell orders, then load the one you want when you attach the EA to the chart.

2) Another way is to change the input values within the code for buy and sell orders then save two copies of the EA with a BUY or SELL suffix, such as MPTM_Global__BUY.mq4 or MPTM_Global_SELL.mq4 and load the correct EA for the chart you are attaching it to.

3) And finally, for one MPTM_Global.mq4 EA to automatically change the input values automatically according to the currency of the chart you attach it to and whether you make a BUY or a SELL trade, you can put the following code at the top of the extern variables section of the EA:

Code: Select all

extern bool UseCustomBuySell = true;
Then put the following code at the top of the int init() section of the EA:

Code: Select all

int init()
  {
if (UseCustomBuySell) {

int ticketLast=0, ticketFirst=0;
for(int pos = OrdersTotal()-1; pos >= 0 ; pos--){
    // Select only my orders with:
    if (OrderSelect(pos, SELECT_BY_POS)
    // uncomment the line below for orders with a specific magic number
    //&&  OrderMagicNumber()  == MagicNumber 
    &&  OrderSymbol()       == Symbol() ){   // and my pair.
    if (ticketLast == 0)    ticketLast = OrderTicket();
    ticketFirst = OrderTicket();
   }
   }//for(int pos = OrdersTotal()-1; pos >= 0 ; pos--)
   
  if (ticketFirst != 0 && OrderSelect(ticketFirst, SELECT_BY_TICKET)){

    // uncomment the line below and the matching parenthesis line
    // marked with an * at the end of this block of code if you want specific
    // setting for different currency pairs. You can copy and paste this
    // block of code to set specific buy/sell parameters for other pairs.
    //if (Symbol()=="EURUSD") {
    
    // Put all the settings you want to change from
    // the default for this currency pair here
    if (OrderType() == OP_BUY) {
    // Put all the settings here that you want to change from
    // the default for all buy orders. For example:
    BreakEven=1;
    BreakEvenPips=40;
    BreakEvenProfit=2;
    HideBreakEvenStop=0;
    PipsAwayFromVisualBE=100;    
    }
    
    if (OrderType() == OP_SELL) {
    // Put all the settings here that you want to change from
    // the default for all sell orders. For example:
    BreakEven=1;
    BreakEvenPips=80;
    BreakEvenProfit=2;
    HideBreakEvenStop=0;
    PipsAwayFromVisualBE=100; 
    }
    
    //}// * if (Symbol()=="EURUSD")
    
  } //if (ticketFirst != 0 && OrderSelect(ticketFirst, SELECT_BY_TICKET)

} //if (UseCustomBuySell)

//Rest of the original int init() code continues here ...

   return(0);
  } // end of int init()
I already tested the code and it works well. Hope that helps.
Author:  Dr.Phoenix [ Fri Jul 26, 2013 6:29 pm ]
Post subject:  Re: MPTM_Global

Global, thank you for your reply even if it is late a little bit. All of your advices are valuable.

... I am investigating your code.
Author:  global [ Sun Jul 28, 2013 1:21 am ]
Post subject:  Re: MPTM_Global

You are welcome. Just in case my previous post was not clear enough, here is the code again with the lines to activate the code for different currency pairs already uncommented.

Put the following code at the top of the extern variables section of the EA:

Code: Select all

extern bool UseCustomBuySell = true;
Then put the following code at the top of the int init() section of the EA:

Code: Select all

int init()
  {
if (UseCustomBuySell) {

int ticketLast=0, ticketFirst=0;
for(int pos = OrdersTotal()-1; pos >= 0 ; pos--){
    // Select only my orders with:
    if (OrderSelect(pos, SELECT_BY_POS)
    // uncomment the line below for orders with a specific magic number
    //&&  OrderMagicNumber()  == MagicNumber
    &&  OrderSymbol()       == Symbol() ){   // and my pair.
    if (ticketLast == 0)    ticketLast = OrderTicket();
    ticketFirst = OrderTicket();
   }
   }//for(int pos = OrdersTotal()-1; pos >= 0 ; pos--)
   
  if (ticketFirst != 0 && OrderSelect(ticketFirst, SELECT_BY_TICKET)){

    // uncomment the line below and the matching parenthesis line
    // marked with an * at the end of this block of code if you want specific
    // setting for different currency pairs. You can copy and paste this
    // block of code to set specific buy/sell parameters for other pairs.
    // Note: I already uncommented the line below and the related * line to
    // activate this feature.
    if (Symbol()=="EURUSD") {
   
    // Put all the settings you want to change from
    // the default for this currency pair here
    if (OrderType() == OP_BUY) {
    // Put all the settings here that you want to change from
    // the default for all buy orders. For example:
    BreakEven=1;
    BreakEvenPips=40;
    BreakEvenProfit=2;
    HideBreakEvenStop=0;
    PipsAwayFromVisualBE=100;   
    }
   
    if (OrderType() == OP_SELL) {
    // Put all the settings here that you want to change from
    // the default for all sell orders. For example:
    BreakEven=1;
    BreakEvenPips=80;
    BreakEvenProfit=2;
    HideBreakEvenStop=0;
    PipsAwayFromVisualBE=100;
    }
   
    }// * if (Symbol()=="EURUSD")
   
  } //if (ticketFirst != 0 && OrderSelect(ticketFirst, SELECT_BY_TICKET)

} //if (UseCustomBuySell)

//Rest of the original int init() code continues here ...

   return(0);
  } // end of int init()
Author:  stpehen2013 [ Mon Sep 02, 2013 1:38 pm ]
Post subject:  Re: MPTM_Global

I'm still new to Empty4 - how do I get the MTPM_Global indicator to work? I dropped it on a chart but the order dialogue box just looks the same. Do I need to drop it into templates or something.

Sorry to be a dunce. Complete newby
Thanks
Author:  global [ Mon Sep 02, 2013 10:04 pm ]
Post subject:  Re: MPTM_Global

stpehen2013 wrote:I'm still new to Empty4 - how do I get the MTPM_Global indicator to work? I dropped it on a chart but the order dialogue box just looks the same. Do I need to drop it into templates or something.

Sorry to be a dunce. Complete newby
Thanks
I consider myself a newbie as well so feel free to ask anything. MTPM_Global is not an indicator, it is an expert advisor (EA) so you should put it into your Empty4 expert folder. Once it is in that folder, restart Empty4 and it will now appear in the list of EAs in the Expert Advisors section of the Empty4 Navigator. From there you can drop it onto a chart to manage any trades you open or alternatively you can right click on the MTPM_Global name then left click "Attach to a chart."

You will need to understand all the features by following my advice in the first post to this thread to expand the EA input dialog window so you can read the descriptions of each feature and understand how they relate to each other. I suggest that by reading the feature descriptions from top to bottom would help to make it easier to understand how they work together. I admit that it wasn't easy for me to understand Steve's original version and my additions may be equally difficult to understand but once you understand it you may find this trade manager to be an indispensable part of your trading toolbox.
Author:  TonkaTuff [ Wed Sep 25, 2013 7:19 am ]
Post subject:  Re: MPTM_Global

Hi All,

I've been playing with MPTM_Global for a while and can sort of get things working. I've searched for example set files, with no luck. So I spent a bit of time putting the attached spreadsheet together. I found it made things a lot easier to work out what related to what and how to get the settings working.

Sheet 1: Setting. Has all of the variables with a list of the OOTB and my attempt at a few variants.
Sheet 2: EXPORT. Copy from here and paste into a set file.
Sheet 3: MPTM_Global.mq4 code used.

Please review and let me know if my settings are correct.
Also, could anyone please post their working set files so a LOT of other people can get using this GREAT piece of programming.

Cheers,
TT
All times are UTC Page 7 of 14