MPTM updated

MPTM's new home

MPTM updated

Postby SteveHopwood » Fri Oct 16, 2020 2:59 pm

stevenforex » Fri Oct 16, 2020 8:03 am wrote:
Hey Steve!

I just checked the code a bit and found that in the DoTradeManagement() the part-close Lot-Size calculation is done twice. Lines 1891 and 1915

One using the "CloseEnough()" and the other one without...

Could that be the problem?

If the compare of the two doubles gets different results for both parts :?

Cheers

You probably guessed that I forgot all about this.

The Close_Lots calculation is not needed twice but would make no difference as it will result in the same value. Delete the second calculation.

I will manage some trades next week and see if I can work out what is wrong.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9267
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Minor bug on MPTM

Postby K-Lander » Mon Nov 16, 2020 2:48 pm

Hi folks,
Just found a small bug on MPTM´s InsertTakeProfit function (line 1732). When calculating the TP, it does so from current price instead of the order´s open price. The needed changes are as follows:

Line # ..... Replace... ....... With...
1753........ ask............ OrderOpenPrice()
1762........ bid............ OrderOpenPrice()


Credit goes to laziness, as I couldn´t be bothered to manually placing the SL and TP to some pending orders, which led to finding the glitch.

I am not attaching the amended EA as it would not be an authentic, certified, made-in-Hopwoodshire version of the thing.

My very small $0.02.

Cheers,
K-Lander
 
Posts: 36
Joined: Thu Nov 17, 2011 9:03 pm
Location: Buenos Aires, Argentina

Minor bug on MPTM

Postby SteveHopwood » Mon Nov 16, 2020 4:19 pm

K-Lander » Mon Nov 16, 2020 2:48 pm wrote:Hi folks,
Just found a small bug on MPTM´s InsertTakeProfit function (line 1732). When calculating the TP, it does so from current price instead of the order´s open price. The needed changes are as follows:

Line # ..... Replace... ....... With...
1753........ ask............ OrderOpenPrice()
1762........ bid............ OrderOpenPrice()


Credit goes to laziness, as I couldn´t be bothered to manually placing the SL and TP to some pending orders, which led to finding the glitch.

I am not attaching the amended EA as it would not be an authentic, certified, made-in-Hopwoodshire version of the thing.

My very small $0.02.

Cheers,


Not sure what you are looking at; the code is correct in my version and in the post 1 version. Are you sure yours is up to date?

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9267
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Minor bug on MPTM

Postby K-Lander » Mon Nov 16, 2020 4:27 pm

SteveHopwood » Mon Nov 16, 2020 1:19 pm wrote:
K-Lander » Mon Nov 16, 2020 2:48 pm wrote:Hi folks,


Not sure what you are looking at; the code is correct in my version and in the post 1 version. Are you sure yours is up to date?

:xm: :rocket:


Seems I have an old version of MPTM and the bug seems to have been fixed in the updated one. My bad, sorry.

Have a nice weekend

K
K-Lander
 
Posts: 36
Joined: Thu Nov 17, 2011 9:03 pm
Location: Buenos Aires, Argentina

MPTM updated

Postby Fourxxxx » Tue Nov 24, 2020 1:54 am

I seem to be missing something trying to get MPTM to close trades using HGI Blue Wavy lines.

I have the latest HGI Indicators and library files (fresh download) installed and HGI is displaying on the charts. MPTM will close trades if I set take profit in Pips but I would like it to close trades when the Blue Wavy lines are displayed. I have tried everything but I am running out of hair to pull out very fast.

MPTM 4H.tpl
You do not have the required permissions to view the files attached to this post.
Fourxxxx
 
Posts: 57
Joined: Fri Feb 24, 2012 4:50 am

MPTM updated

Postby SteveHopwood » Tue Nov 24, 2020 1:51 pm

Fourxxxx » Tue Nov 24, 2020 1:54 am wrote:I seem to be missing something trying to get MPTM to close trades using HGI Blue Wavy lines.

I have the latest HGI Indicators and library files (fresh download) installed and HGI is displaying on the charts. MPTM will close trades if I set take profit in Pips but I would like it to close trades when the Blue Wavy lines are displayed. I have tried everything but I am running out of hair to pull out very fast.


You will be sort of glad to know that the fault was in the coding, not in your attempts to use mptm. Fixed in 1c in post 1.

Coders and most DIYers will understand the bloop immediately. Go to the bool UsingHgiToCloseTrade(int ticket) function and scroll down to:
//The HGI library functionality was added by tomele. Many thanks Thomas.

These two lines need editing:
signal = getHGISignal(Symbol(), HgiTimeFrameC, shift);//This library function looks for arrows.
slope = getHGISlope (Symbol(), HgiTimeFrameC, shift);//This library function looks for wavy lines.

Change the highlighted words to these:
signal = getHGISignal(OrderSymbol(), HgiTimeFrameC, shift);//This library function looks for arrows.
slope = getHGISlope (OrderSymbol(), HgiTimeFrameC, shift);//This library function looks for wavy lines.

FYI folks, in looking for the fault I noticed how similar the hgi closure input names were to the hgi hedging input names, so I changed them. It should not affect the running of mptm if you leave yours as they are.


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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9267
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

MPTM updated

Postby Fourxxxx » Wed Nov 25, 2020 2:03 am

Thank you :clap: :clap: :clap: :clap: still testing but seems to be closing trades as expected for Blue Wavy lines. The logic for the Yellow Wavy's does not seem right though. I have changed it to this and seems to be doing what I need.
if (slope == RANGEABOVE && HgiCloseOnYellowWavyC) and if (slope==RANGEBELOW && HgiCloseOnYellowWavyC)
R
Code: [Select all]
 Please Login or Register to see this content
<


if (slope == RANGEABOVE && HgiCloseOnYellowWavyC) and if (slope==RANGEBELOW && if (slope == RANGEABOVE && HgiCloseOnYellowWavyC) and if (slope==RANGEBELOW && HgiCloseOnYellowWavyC)giCloseOnYellowWavyC) were the other way around in Buy and Sell.
Fourxxxx
 
Posts: 57
Joined: Fri Feb 24, 2012 4:50 am

MPTM updated

Postby SteveHopwood » Wed Nov 25, 2020 10:53 am

:xm:
Fourxxxx » Wed Nov 25, 2020 2:03 am wrote:The logic for the Yellow Wavy's does not seem right though.


Thanks for a really helpful contribution. :clap: :clap: :clap: :clap: I have added the fix to 1c in post 1. Remember folks, if you are updating from post 1, to delete the existing .ex4 file to force recompilation when you restart the platform.

I have added a slightly different solution to Fourxxxx's, so the easiest DIY is to copy the entire function over the top of the existing one:
Code: [Select all]
 Please Login or Register to see this content
<


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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9267
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Previous

Return to Utilities Indicators and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest