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

MPTM's new home
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=64
Page 18 of 57
Author:  takijedensuchy [ Sun Dec 23, 2012 6:46 am ]
Post subject:  Re: Stumped

ChicagoRob wrote:I'm having a problem with MPTM stopping out trades immediately after the orders are placed. I recently put on a sell trade with a SL 35 pips away from the entry price. However, every time I tried to place the trade, MPTM would stop it out instantaneously. I had two buy trades set up with similar stop losses and they were executed without any problems.

If anyone can enlighten me as to what I may be doing wrong, please do not hesitate.

Rob
Trades closing out immediately...

Hey Rob,
I'm having the same issue. I use InvestTechFX as my broker. Recently, only the live account showed this error but now both live and demo accounts are coming up the same. I split up the pairs into 3 digit and 5 digit. Used 4 MPTMs to manage the 3,5 digit pairs and pairs with and without a suffix # at the end of the pair name. All attached to the very volatile GBPJPY or as my broker uses GBPJPY#
Still coming up the same. It seems that the jumping stop and break even doesn't seem to be working. Whether I enter it on its own or in conjunction with another setting.
I tried using separate instance of MPTM on every pair traded and still the same.
Always the same error:

2012.12.19 23:10:03 MPTM 25+10 GBPJPY,H1: Stop loss hit. Close of NZDJPY ticket no 17781596 failed with error (4108): invalid ticket

The trade closes within seconds after I enter . :?: :?: :?: :cry:
Set SL and TP work great but the Stop loss and break even not so much.
Which broker do you use? Do you have any ideas? I've been trying to crack this nagging issue without resorting to a crimm switch, because of lovely spreads offered.
Hopefully we can come up with a solution.
Read through the entire forum and got a clue. Will look into it tomorrow morning.

:idea: Some people mention that Saving the changes in an EA to a .set file and removing the EA from the chart. Then dragging a new instance of it onto a chart and loading the .set file may work. So if you make any changes, load it all over again. :mrgreen: I will smack myself in the head if that works :)
Been scratching my head on this one for a week. Soon, I will look like a monk.

I know this is not much of an answer to your question but 2 heads are always better than one.

Regards,
P
Author:  Mike [ Sun Dec 23, 2012 9:55 am ]
Post subject:  Re: MPTM's new home

global wrote:Thanks for coding and making MPTM available Steve. I was testing it for managing multiple trades simultaneously in different pairs on different timeframes so I attached the EA to each chart. I set it to ManageAllTrades but should I instead set ManageAllTrades to false and set ManageByMagicNumber to true plus set a different magic number for each new chart I attach it too so that the multiple MPTM instances would not interfere with each other?

If it is necessary to set a different magic number for each new chart/timeframe I attached it to then is there some code I can add to the EA so it creates a new magic number automatically for each new instance of MPTM?

I'm new to EAs so I hope you can forgive my ignorance. Thanks.
If you have redownloades MPTM within the last week you should be able to select trade by ticketnumber, so you do not have to set or change magic numbers.
Author:  global [ Mon Dec 24, 2012 2:37 pm ]
Post subject:  Re: MPTM's new home

Mike wrote:If you have redownloades MPTM within the last week you should be able to select trade by ticketnumber, so you do not have to set or change magic numbers.
Thanks Mike, I'll use both settings together, ManageByTickeNumber as well as ManageThisPairOnly, as the manual says, to achieve more accurate monitoring. Hope that works.

Update: ManageByTickeNumber did not work as expected with ManageThisPairOnly but ManageThisPairOnly by itself seems to be working fine.
Author:  takijedensuchy [ Wed Dec 26, 2012 10:18 am ]
Post subject:  Re: MPTM's new home

An update for those who are having problems with the trades closing out immediately after opening under MPTM. It seems that that the EA will close all open sell positions if the Hide BE option is set to true.
Without this selected, the EA works great. Any ideas?
Author:  global [ Wed Dec 26, 2012 1:25 pm ]
Post subject:  Re: MPTM's new home

takijedensuchy wrote:An update for those who are having problems with the trades closing out immediately after opening under MPTM. It seems that that the EA will close all open sell positions if the Hide BE option is set to true.
Without this selected, the EA works great. Any ideas?
According to the comments in the code, setting the Hide BE option to true checks to see if the market has hit the hidden sl and attempts to close the trade if so. Therefore, unless you set the ManageAllTrades option to true, setting the HideBreakEvenStop to true shouldn't cause closure of other positions.
Author:  takijedensuchy [ Wed Dec 26, 2012 8:15 pm ]
Post subject:  Re: MPTM's new home

global wrote:
takijedensuchy wrote:An update for those who are having problems with the trades closing out immediately after opening under MPTM. It seems that that the EA will close all open sell positions if the Hide BE option is set to true.
Without this selected, the EA works great. Any ideas?
According to the comments in the code, setting the Hide BE option to true checks to see if the market has hit the hidden sl and attempts to close the trade if so. Therefore, unless you set the ManageAllTrades option to true, setting the HideBreakEvenStop to true shouldn't cause closure of other positions.

Hello global,

Thank you for your response. This would be no problem if my broker didn't use 3 and 5 digits on their pairs.
To go around this I split up the pairs into 3 and 5 digit and told the system to manage Specific Pairs only.
Managing all trades triggered a bunch of StopLoss errors. The system learns how many digits it needs to compute and starts treating every trade after that in the same manner. Should the digits go from 3 to 5 or vice versa, the StopLoss errors get triggered right away.
Temporarily, I have it set to show JS and BE. This way it works, but my broker does not let me change an order if it's within 30 pips of price. Would love to keep them hidden and more tight than 40 pips, to be safe.

Thank you once again for your time on this.

P.
Author:  takijedensuchy [ Wed Dec 26, 2012 8:40 pm ]
Post subject:  Re: MPTM's new home

Just one more thing if this helps anyone. The trades that close automatically on entry are *all SELL trades* :shock: .
Maybe this will help.
Author:  SteveHopwood [ Thu Dec 27, 2012 12:44 am ]
Post subject:  Re: MPTM's new home

takijedensuchy wrote:Just one more thing if this helps anyone. The trades that close automatically on entry are *all SELL trades* :shock: .
Maybe this will help.
Ehup guys.

Thanks for all your contributions here.

To try to fill you all in on some brief details, there is an essential component of mptm that requires it to know what a particular variable is worth - this variable is the pair's Point. So, for example, if HiddenStopLossPips is 200 and this is required to be added to a sell trades stop loss, then it is added as OrderStopLoss() + (HiddenStopLossPips * Point).

All well and good, but there is a problem when dealing with a multi-pair EA such as MPTM. Then, Point has to be synthesized, so mptm used to use point = MarketInfo(OrderSymbol(), MODE_POINT);

And here is where the fun really begins, because MarketInfo(OrderSymbol(), MODE_POINT); will frequently return zero - especially on Cowboy IBFX wanker-plonker-dipstick accounts. It does not take a dramatic level of brainpower to work out the chaos this causes, and has frequently done so during my coding career. Ask yourself why these fuckers allow this to happen and you will rapidly come to the conclusion that Cowboy IBFX are not the ones to host your live account.

That is Cowboy IBFX folks, deliberately doing everything they can to derail a live account.

Cowboy IBFX, capiche?

So, I use the double PFactor(string pair) function to return the value of Point because the bastard-wanker-criminals cannot overcome this. It is not my function; Gary provided it originally and Paul adapted it for use here, so cudos to these two fantastic individuals.

With me so far? YOu must be as nuts as I am.

Those bastards who coded the Empty4 Abortion had yet another trick up their criminally-inclined sleeve. An integer is a number that has no decimal points. A double is a number that has decimal points. You would think that a double created by dividing an integer by a number bigger than itself would result in a >0 value? For example, double x = 1 / 10 = 0.01. Not on crapql4 it doesn't. It results in a zero.

So, by declaring HiddenStopLossPips as an integer, originally back in about 2007 when this bloody stuff worked occasionally - probably by accident because the bastard-wally-plonker-dipstick-criminals hadn't got into top gear back then - then adding the PFactor stuff (actually not me but Paul) to tighten up the code has resulted in unreliable code. Not sure if this caused all those trades to close immediately mptm is loaded, but it will not help.

I am not going to do anything about this tonight - post_Christmas drinkies and coding do not go well together. I may not necessarily do anything about it immediately.

I will sort it out sometime soon. If I can. mptm code is now at the tipping point where a change here can cause utter chaos there, there and there. I guarantee nothing.

Watch this space.

:D
Author:  takijedensuchy [ Thu Dec 27, 2012 2:59 am ]
Post subject:  Re: MPTM's new home

Please add InvestTechFX to the list of known terrorists... :twisted:
As a former programmer, I'm trying to wrap my head around the PFactor(string pair) function.
Didn't find it in my version of the MPTM so looking for ways of sticking itha in there without causing too many problems. I will try to get up to speed with the language and be productive here as well.
Thank you all for doing this. This is awesome material.

P.

P.S. Looking forward to 2013 Steve ;)
Author:  SteveHopwood [ Thu Dec 27, 2012 10:46 am ]
Post subject:  Re: MPTM's new home

takijedensuchy wrote:Please add InvestTechFX to the list of known terrorists... :twisted:
As a former programmer, I'm trying to wrap my head around the PFactor(string pair) function.
Didn't find it in my version of the MPTM so looking for ways of sticking itha in there without causing too many problems. I will try to get up to speed with the language and be productive here as well.
Thank you all for doing this. This is awesome material.

P.

P.S. Looking forward to 2013 Steve ;)
It might be easier to inject your personal coding into the current version rather than trying to retro-fit PFactor. Only a suggestion. Paul (Baluda) did the retrofitting quickly enough, but he is an awesome programmer.

Or, check to see if your crim returns zero for the MarketInfo(Symbol(), MODE_POINT) function on any of your charts. If not, then you do not actually need PFactor().

2013 is going to be stellar.

:D
All times are UTC Page 18 of 57