MPTM_Global

MPTM's new home
Locked
Dr.Phoenix
Trader
Posts: 24
Joined: Thu May 09, 2013 4:54 pm

Re: MPTM_Global

Post by Dr.Phoenix »

Global, thank you for your money management introduced.
global wrote:Yes, my risk is reduced after the price goes 20pips in my favor but if the price reverses before reaching 20pips and my stop loss gets hit then my risk will be 3 times as compared to a 1 lot trade. Plus, since I always enter my trade with a minimum stop loss, if I reduce it further, that may increase the probability of my stop being hit since the price will not have enough room to allow for fluctuation before the price goes in my direction. I welcome any insights you may have on this.
And you are right again.

As for 3 lots, it was just an example. My risk is no more 2% (the 20 pips stop loss is used) as yours.
Of course if you do not have possibilities to reduce the stop loss more than you use, you should not.

Using 20 pips for a stop loss, I have found that it is enough if you trade intraday. And if price is about to go in wrong direction, it passes 20 pips and hits the stop loss, it afterwards passes 20 pips more.

The last 20 pips allow me to capture the lost and to get the new 20 pips additionally (as lots doubled). That is why using stop and reverse technique is important critically. That is why I am looking for someone who could program it carefully within the framework of the EA.
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote: Using 20 pips for a stop loss, I have found that it is enough if you trade intraday. And if price is about to go in wrong direction, it passes 20 pips and hits the stop loss, it afterwards passes 20 pips more.

The last 20 pips allow me to capture the lost and to get the new 20 pips additionally (as lots doubled). That is why using stop and reverse technique is important critically. That is why I am looking for someone who could program it carefully within the framework of the EA.

2. I hedge a position using the martingale system. If a stop loss is hit, a reverse position is opened. The reverse position has the 20-25 pips take profit with the lot doubled.
Oh, now I see how the hedge fits into the trade technique -- brilliant. I didn't pay much attention to it when you first wrote about it. So you cover your losses with the hedge plus make an extra 20 pips. Would the reverse hedge position also use the stop and reverse technique but this time without opening another hedge if the price reverses again? This is very interesting.
Dr.Phoenix
Trader
Posts: 24
Joined: Thu May 09, 2013 4:54 pm

Re: MPTM_Global

Post by Dr.Phoenix »

global wrote:
Dr.Phoenix wrote: Would the reverse hedge position also use the stop and reverse technique but this time without opening another hedge if the price reverses again? This is very interesting.
The feature is that the price is hardly fluctuated back and forth many times at some level (but I had such a thing one day and lost 1*20+2*20+4*20 pips). As a rule, if the price goes backward, it passes more than 20 pips. The real problem is to get into the market right way as close to the extremum as possible.

As for your question, yes it would. After I lost the above pips I decided not to hedge the hedge (but you see the EA has such a pissibility). If lost, then lost.

In the EA the hedge option is already realized. It only needs tuning a little. I think the difficulties I faced with have to do with the slippage, so the reverse position is not opened sometimes.

UPDATE 06.06.2013: Global, do you know how to apply different sets of options to the different currency pairs?
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote: UPDATE 06.06.2013: Global, do you know how to apply different sets of options to the different currency pairs?
There are different ways to do this. One way is to save a different .set file for each currency and load the one you want when you attach the EA to the chart.

Another way is to change the input values within the code for each currency and save multiple copies of the EA with a currency symbol suffix such as MPTMG_AUDUSD.mq4 and load the correct EA for the currency chart you are attaching it to.

And finally, for one MPTMG.mq4 EA to automatically change the input values automatically according to the currency of the chart you attach it to, you can put the following code at the top of the extern variables section of the EA:

Code: Select all

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

Code: Select all

int init()
{

if (UseCustomSettings) {

    if (Symbol()=="EURUSD") { 
    // Put all the settings you want to change from
    // the default for this currency pair here
    BreakEven=1;
    BreakEvenPips=20;
    BreakEvenProfit=2;
    HideBreakEvenStop=0;
    PipsAwayFromVisualBE=100;
    }
    if (Symbol()=="USDJPY") {
    // Put all the settings you want to change from
    // the default for this currency pair here
    }
    if (Symbol()=="NZDUSD") {
    // Put all the settings you want to change from
    // the default for this currency pair here 
    // and continue the code for all the pairs you 
   // want to automatically change the settings for.
    }

} // end of if (UseCustomSettings)

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

   return(0);
  } // end of int init()
Whenever you want to use the default values, just set UseCustomSettings to false.
Dr.Phoenix
Trader
Posts: 24
Joined: Thu May 09, 2013 4:54 pm

Re: MPTM_Global

Post by Dr.Phoenix »

Global, thank you for your variants. I have been myself thinking about the second variant proposed (the files are separate for the different currency pairs). However the third one is the most interesting I suppose. Thanks. I will research it.

Update: Are the global params changed in this case? I mean these params:
extern bool ManageThisPairOnly = true;
extern bool ManageSpecifiedPairs = false;
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote:Global, thank you for your variants. I have been myself thinking about the second variant proposed (the files are separate for the different currency pairs). However the third one is the most interesting I suppose. Thanks. I will research it.

Update: Are the global params changed in this case? I mean these params:
extern bool ManageThisPairOnly = true;
extern bool ManageSpecifiedPairs = false;
As far as I know the global params set by the extern variables are changed once you change them in the code as in the example I wrote. I did this within the MPTM_Global code where I changed the following extern global params found within the void TightenStopLoss() function:

Code: Select all

   UseTsPercentageTp  = false;
   UseTsPercentageATR = true;
The change worked as I expected so you shouldn't have any problems changing any of the extern variables by inserting code as in my example.
Dr.Phoenix
Trader
Posts: 24
Joined: Thu May 09, 2013 4:54 pm

Re: MPTM_Global

Post by Dr.Phoenix »

Understood.

I have integrated the code below into the int init() section:

// the custom parameters
if (UseCustomSettings)
{
if (Symbol()=="EURUSD") {
MissingStopLossPips = 20;
}
if (Symbol()=="EURJPY") {
MissingStopLossPips = 30;
}
}

and of course included:

// The custom parameters allowance
extern bool UseCustomSettings = true;

We will see next week what happens.

As for the global parameters I would like to know if I need switching
ManageSpecifiedPairs = false to true in order to choose the pairs I need.
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote:Understood.

We will see next week what happens.

As for the global parameters I would like to know if I need switching
ManageSpecifiedPairs = false to true in order to choose the pairs I need.
Only if you don't want the EA to manage certain pairs then you can set ManageSpecifiedPairs to true and list only the pairs you want the Ea to manage in the PairsToManage list. I'm not sure but I think that the ManageSpecifiedPairs setting may be useful when you trade a basket of pairs and you want to simultaneously trade other pairs not in the basket. Since I use a separate instance of MPTM_Global for each pair I trade I just leave ManageSpecifiedPairs as false.
Dr.Phoenix
Trader
Posts: 24
Joined: Thu May 09, 2013 4:54 pm

Re: MPTM_Global

Post by Dr.Phoenix »

Global, I am testing the EA with the parameters above for 3 days and the EA still represents the 20 pips stop-loss on both charts (EurUsd and EurJpy). I do not know why? Any thoughts?

The EA is attached. Would you like seeing it? Maybe you will find out.
You do not have the required permissions to view the files attached to this post.
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote:Global, I am testing the EA with the parameters above for 3 days and the EA still represents the 20 pips stop-loss on both charts (EurUsd and EurJpy). I do not know why? Any thoughts?

The EA is attached. Would you like seeing it? Maybe you will find out.
I tested it with EURUSD and EURJPY and it worked perfectly with a 20 pip SL for EURUSD and 30 pip SL for EURJPY so I really don't see any error there.

I'm not sure whether or not Empty4 automatically recompiles all mq4 files when the program is restarted. Therefore, whenever you edit the MPTMG code make sure that first save your changes then click the compile button to recompile the code, otherwise you may be using the previous version that was compiled before you made changes to the code.
Locked

Return to “Utilities Indicators and Scripts”