AllPairTradeManager(APTM)

MPTM's new home
Post Reply
dclayw
Trader
Posts: 139
Joined: Wed Nov 13, 2013 6:53 am
Location: Australia

AllPairTradeManager(APTM)

Post by dclayw »

dclayw » Tue Aug 15, 2017 11:56 pm wrote: This is all running on demo. I've checked and re-checked the settings. There are no other time closings activated. The CloseFriday function is what is writing the journal entries for these closed trades, i.e.:

Print("APTM:CloseFriday:Close ",IntegerToString(ticket)," Succeeded !");

These are the entries in the journal in my screen shot. They were written on Monday at around 23.45 broker time.

I do not believe it is a problem with the EA or the EA settings. It's as if the time settings on my VPS have gone a little bit haywire, although they "look" right. The VPS was booted just prior to starting the tests at market open on Monday morning.

Just wondering if anyone had come across something similar in the past. The solution will be a simple one I'm sure, I'll come back when I find it.
I never got to the bottom of the problem described above. The behaviour was not consistent. For some reason (and only sometimes) the EA was closing my trades on Monday night, rather then Friday night.

Anyway, in the EA rather then using "if((DayOfWeek()==5)" I changed this to "if((TimeDayOfWeek(TimeCurrent())==5)". I did not do exhaustive testing but I have not seen the problem since.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

AllPairTradeManager(APTM)

Post by milanese »

dclayw » Wed Sep 20, 2017 5:34 am wrote:
I never got to the bottom of the problem described above. The behaviour was not consistent. For some reason (and only sometimes) the EA was closing my trades on Monday night, rather then Friday night.

Anyway, in the EA rather then using "if((DayOfWeek()==5)" I changed this to "if((TimeDayOfWeek(TimeCurrent())==5)". I did not do exhaustive testing but I have not seen the problem since.
this is a tricky solution :clap: :clap:

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

[update]AllPairTradeManager(APTM)

Post by milanese »

update version 2.50 September 20,2017
resolves the "Friday Close Problem" thanks to dclayw :clap: see http://www.stevehopwoodforex.com/phpBB3 ... 81#p156681
go to first post for downloading.

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
sabbah
Posts: 2
Joined: Tue Jun 25, 2013 5:42 pm

AllPairTradeManager(APTM)

Post by sabbah »

Trying to partial close 50% after 5pips and move the BE & SL then trailstop steps 2. This is the settings I'm using, but nothing is happening. What did I miss?
You do not have the required permissions to view the files attached to this post.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

AllPairTradeManager(APTM)

Post by milanese »

sabbah » Wed Sep 20, 2017 6:15 pm wrote:Trying to partial close 50% after 5pips and move the BE & SL then trailstop steps 2. This is the settings I'm using, but nothing is happening. What did I miss?
you should take a look what min distance to price you use and re-read first post and the parts of threads explaining these functions ..

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
dclayw
Trader
Posts: 139
Joined: Wed Nov 13, 2013 6:53 am
Location: Australia

[update]AllPairTradeManager(APTM)

Post by dclayw »

milanese » Wed Sep 20, 2017 4:38 pm wrote:update version 2.50 September 20,2017
resolves the "Friday Close Problem" thanks to dclayw :clap: see http://www.stevehopwoodforex.com/phpBB3 ... 81#p156681
go to first post for downloading.

Cheers :)

Tommaso
Hi Tommaso,
I realised a while back that CloseFriday function doesn't delete pendings. The main idea behind closing on Fridays is to avoid weekend gaps, so it makes sense that pendings should be deleted by CloseFriday function.

I could probably add that in myself but I think it should be applied to the production version so that anyone who wants to close on Friday will have the pendings deleted as well.

David
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

[update]AllPairTradeManager(APTM)

Post by milanese »

dclayw » Fri Oct 20, 2017 8:04 am wrote: Hi Tommaso,
I realised a while back that CloseFriday function doesn't delete pendings. The main idea behind closing on Fridays is to avoid weekend gaps, so it makes sense that pendings should be deleted by CloseFriday function.

I could probably add that in myself but I think it should be applied to the production version so that anyone who wants to close on Friday will have the pendings deleted as well.

David
update version 2.51 October 20,2017
Close Friday and Defined TimeClose will now delete to all pending orders, as dclayw asked for this function.
As always update can be found on first post.

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
dclayw
Trader
Posts: 139
Joined: Wed Nov 13, 2013 6:53 am
Location: Australia

[update]AllPairTradeManager(APTM)

Post by dclayw »

milanese » Fri Oct 20, 2017 9:45 pm wrote: update version 2.51 October 20,2017
Close Friday and Defined TimeClose will now delete to all pending orders, as dclayw asked for this function.
As always update can be found on first post.

Cheers :)

Tommaso
Tommaso, Thanks for doing it and thanks for getting it done so quickly. :good:
User avatar
jedrula
Trader
Posts: 253
Joined: Wed May 01, 2013 2:09 pm
Location: Poland

[update]AllPairTradeManager(APTM)

Post by jedrula »

milanese » 20 Oct 2017, 13:45 wrote:
dclayw » Fri Oct 20, 2017 8:04 am wrote: Hi Tommaso,
I realised a while back that CloseFriday function doesn't delete pendings. The main idea behind closing on Fridays is to avoid weekend gaps, so it makes sense that pendings should be deleted by CloseFriday function.

I could probably add that in myself but I think it should be applied to the production version so that anyone who wants to close on Friday will have the pendings deleted as well.

David
update version 2.51 October 20,2017
Close Friday and Defined TimeClose will now delete to all pending orders, as dclayw asked for this function.
As always update can be found on first post.

Cheers :)

Tommaso
Thank You :good:
User avatar
macman
Trader
Posts: 118
Joined: Tue Nov 15, 2011 7:47 pm
Location: Somewhere on a European waterway, on my classic (old) Dutch barge

AllPairTradeManager(APTM)

Post by macman »

Hi Tommaso,

I recently posted asking if anyone knew of an EA which will zero hedge when a selected margin level is reached. So far no replies so I think maybe it does not exist and now I wonder if you might consider adding it as an option to your APTM.

As I am sure you know, brokers now regularly cut account leverage, often with little warning, so suddenly a 500:1 account can become a 50:1 account. A market movement against your open trades, which would be safe at 500:1, can bring a margin call at 50:1. There are even brokers who lower the leverage for the last hour of the week, making life difficult for any trader who wants to keep trades open during the weekend. I am also sure we will see more of this 'disappearing margin trick' in the future.

To protect against this, the routine would simply zero hedge the total position when account margin drops below the trigger level. This will also protect an account if there is a weekend gap, unlike a stop loss or pending order.

A zero hedge order could be given a 'ZH' comment, which would then allow APTM to control it using the existing managebyordercomment function.

The basic logic is here:
IMG_1568.JPG
Best regards,
macman
You do not have the required permissions to view the files attached to this post.
This account takes ALL software generated trade calls from my FXW training course and is used to develop money management routines.
http://www.mt4i.com/mt4ichart.aspx?c=ch ... udent-demo
Post Reply

Return to “Utilities Indicators and Scripts”