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 wrote:
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.
Thank you for your help, Global. I will retest once again.

UPDATE: Yes, it is working but with the other broker / terminal. It is strange indeed.
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Dr.Phoenix wrote: UPDATE: Yes, it is working but with the other broker / terminal. It is strange indeed.
Metatrader4 does many strange things as it's not perfectly programmed. MT5 may be better but it's too much trouble especially for programmers to make the switch.
Mocean
Posts: 9
Joined: Sat Jun 22, 2013 1:14 am
Location: Bondi - Australia

Re: MPTM_Global

Post by Mocean »

Global - awesome updates to Steve's already powerful MPTM, I use it on every trade.

Just wondering if you have any desire to convert this code for cAlgo / cTrader?

Thanks,
Andrew
Dare to fail....live to succeed
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

Mocean wrote:Global - awesome updates to Steve's already powerful MPTM, I use it on every trade.

Just wondering if you have any desire to convert this code for cAlgo / cTrader?

Thanks,
Andrew
I too use MPTM on every trade :-) I never tried cAlgo / cTrader though, neither have I ever thought of code conversion to any other trading client, plus from what I read, code conversion isn't that easy. Nevertheless, I can point you to a post I read about this. Here it is:

I read here http://www.stevehopwoodforex.com/phpBB3 ... mq4#p64174 that:
CTrader is a reasonable platform, widely available across brokers for free - not like ninjatrader. They will convert mq4 EAs and indicators for free - send them a mail: enange@ctrader.com

web: http://www.spotware.com/products/client ... ions/calgo
However, someone responded that enange@ctrader.com bounced when they I tried it so maybe you can visit the cTrader / Algo website to find their working email address and ask them if they would be willing to convert MPTM for you.
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: MPTM_Global

Post by dudest »

Hallo Global!

Think you could spare some time to help me with this? :)

Thanks

Idea: LibMPTM
=================

Hallo mates :)!

Has anyone (by any good fortune) come up with a library of MPTM's functions that can be called from an EA?

MPTM: http://www.stevehopwoodforex.com/phpBB3 ... ?f=21&t=64

For example: right now, I need to incorporate JumpingStop (alone) into an EA I'm working on. I've gone through the MPTM code but can't seem to see the wood for the trees :)

Would be great to have an MPTM lib to call required functionality from... (unfortunately, don't think Steve is interested in any further work regarding MPTM)

Cheers!

PS: In the meantime, if anyone can help with how to integrate JumpingStop into an EA, that would be much appreciated!

Thanks
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: MPTM_Global

Post by dudest »

Update:

After posting this, I had another look at MPTM's code and finally figured it out.

Testing out the EA now to see if the JS works OK

Still think would be great to have an MPTM lib, I'm sure would come in handy for many

Cheers
global
Trader
Posts: 67
Joined: Wed Aug 15, 2012 2:16 am

Re: MPTM_Global

Post by global »

I'm sorry dudest, creating an MPTM library is beyond me at this point. I'm not yet that good at programming in the mq4 language.
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: MPTM_Global

Post by dudest »

global wrote:I'm sorry dudest, creating an MPTM library is beyond me at this point. I'm not yet that good at programming in the mq4 language.
No problemo sir; you're already doing quite some good work here :)

Cheers!
mcomsa

Re: MPTM_Global

Post by mcomsa »

Hi everybody!

Maybe an easy question but I am a beginner at using MPTM.
I want to manage multiple pairs + use ATR in order to move the stop loss (1 x ATR of that pair or 0.5 x ATR, depending on timeframe). Is this possible?

Thank you for your time and work!
Mircea
Collector
Posts: 2
Joined: Thu Jun 13, 2013 11:52 pm

Re: MPTM's new home

Post by Collector »

SteveHopwood wrote:
global wrote:
SteveHopwood wrote:If, say, StopLoss is declared as an integer as in int StopLoss = 20:
double NewStop = NewStop = OrderOpenPrice() - (StopLoss * Point); is allowed and (StopLoss * Point) creates a 0.xxxxxxxx result.

The command using factor is OrderOpenPrice() - (StopLoss / factor); But, if StopLoss is an integer then the code (StopLoss / factor) returns a zero value.

All the pip values in mptm were declared as integers, so when interacting with factor resulted in 0 being added to whatever the bot was supposed to be doing, and so trades were closing prematurely. All that was needed was to convert them to doubles - something Paul forgot to do and that I did not notice.

So, fix is in post 1; sing out if I am barking at the wrong moon and the fix does not work.
:D
Thanks for the update Steve. I checked your updated code and I'm wondering if the int iPipsAboveVisual variable in line 901 needs to be converted to double iPipsAboveVisual from this line of code...

Code: Select all

bool CheckForHiddenStopLossHit(int type, int iPipsAboveVisual, double stop )
...because a little further down you divide iPipsAboveVisual by Pipfactor as below:

Code: Select all

double sl = NormalizeDouble(stop + (iPipsAboveVisual /Pipfactor), digits);
Nice one global and seems likely you are correct. Even if not, I have made the change and updated the post 1 version.

I tamper with mptm's code with the greatest reluctance. The Steve who started coding it back in about 2007 and the Steve who codes these days are completely different coding individuals. Had I understood even a fraction back then of what I understand now, the code would be completely different. Anybody updating my code now has the me back from 2007 to contend with, and does so at the peril of the entire EA. I shall probably ignore well-intentioned updates in the future.

Added to my early inexperience is the fact that mptm's code has been expanded by several contributors over the years. I rarely have any idea what they were doing and just go with the flow. mptm is ridiculously complex and we are left this this unavoidable truth: tampering with mptm code invites LUC (Law of Unintended Consequences) to throw the bender of the decade for his buddies. What has happened here is a great example.

:D
Hi Steve and all

I hope this post is in the right place...

I have just joined and this is my first post. I have found many interesting, informative and potentially useful 'bits and pieces' here. One of many questions which came to mind is in relation MPTM_Global, as it seems to be called now.

Steve (and anybody else who has played a part in the development of MPTM_Global), given what you have said above, is there any chance of a less complex-looking, easier to follow, not so susceptible to LUC version of the trade manager becoming available in the near future, or are all the gun coders, such as yourself, too preoccupied with other projects?

Is there something better in the works .........?

I did not have the privilege of following MPTM in it's development from an earlier stage, so need some guidance as to what some of the terms mean, and how the parameters interact with each other. I read somewhere about a pdf guide, but don't seem to be able to find that now........or would it be out of date now?

Here's a thought: Is there a place where user-guides/manuals and their revisions are or can be posted?

Thanks in advance
Chiman

PS. Although I know nothing about coding, I am keen to be an active contributor (rather than just a 'taker'). For example, I would be pleased to become part of any testing process that might be going on, as I am reasonably good at creatively conceptualising, analysing and evaluating, so may have something to offer there.....(no apologies for the UK spelling - even though my editor is telling me it's wrong :P ).
Locked

Return to “Utilities Indicators and Scripts”