Jem's MACD and SuperTrend trade manager

MPTM's new home
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Jem's MACD and SuperTrend trade manager

Post by SteveHopwood »

Jem wanted a multi-pair EA that would close trades when either or both of MACD and SuperTrend move/change in the opposite direction i.e. down/red closes buys and up/green closes sells. This is an EA and so goes in your Experts folder. Make sure that all the pairs you trade are in your PairsToTrade input list.

I coded the manager is such a way that it is easy for competent coders to add their own indi's into the mix. The pdf document explains how.

A couple of extra notes:
The manager will read the indicators when loaded up, for an initial screen display. These will not change again until there are open trades to manage and at the open of a new candle (EveryTickMode = false).

Jem needs a manager that closes trades at the open of each new candle. The EveryTickMode input (fourth one down) tells the manager to work once a second and examine the situation as it is in real time.

:xm: :rocket:
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

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 Thomas (tomele) for all the incredible work he does here.
User avatar
Jemook
Trader
Posts: 1075
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Post by Jemook »

Thanks Steve, working brilliantly to manage my positions. Appreciate the effort that went into this!

Cheers
Jeremy
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
Pipstubborn
Trader
Posts: 272
Joined: Thu Jul 12, 2012 5:17 pm

Jem's MACD and SuperTrend trade manager

Post by Pipstubborn »

Congratulations Jem and Steve. Looks great and very promising. :cheer: :yahoo:

Pipstubborn/William
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Jem's MACD and SuperTrend trade manager

Post by SteveHopwood »

A bloop has emerged that should cause an 'array out of range error' and stop the EA from running. Fixed in post 1.

Easy DIY. Do a search for:
//Initialise the bar times to ensure the ea waits for the open of a new candle

The next line of actual code is:
for (int cc = 0; cc <= noOfPairs; cc++)

Remove the '=' from the command, so that it becomes:
for (int cc = 0; cc < noOfPairs; cc++)

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

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

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 Thomas (tomele) for all the incredible work he does here.
User avatar
Jemook
Trader
Posts: 1075
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Post by Jemook »

Steve-o almighty lord and saviour of the nether realms!

The first version of your EA is still working great and shows the MACD values in the display.
firstversion.png
The latest version I can't seem to get the MACD values in the display.
newversion.png
Attached some screenshots for reference incl. settings.

Please let me know if I'm missing something :)

Cheers
Jem
You do not have the required permissions to view the files attached to this post.
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Jem's MACD and SuperTrend trade manager

Post by SteveHopwood »

Jemook » Wed Nov 11, 2020 5:16 am wrote:Steve-o almighty lord and saviour of the nether realms!

The first version of your EA is still working great and shows the MACD values in the display.

The latest version I can't seem to get the MACD values in the display.


Please let me know if I'm missing something :)

Cheers
Jem
That is a cpu saver. The manager does not read any values until the open of a new candle when first loaded or if there are no trades open. It would only take a few seconds to add a block of code to OnInit() to take a reading on start up, without looking for any trade closures.

Would you like me to do this?

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

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

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

Jem's MACD and SuperTrend trade manager

Post by SteveHopwood »

I decided to add the extra code block anyway. V 1c in post 1. I have also added our old friend EveryTickMode.

Please see the notes added to the bottom of post 1.

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

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

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 Thomas (tomele) for all the incredible work he does here.
User avatar
Jemook
Trader
Posts: 1075
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Post by Jemook »

Awesome thank you, I’ll give it a go. This EA is a lifesaver for my trading. As always absolutely solid work form the maestro himself.

Cheers
Jeremy
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
Jemook
Trader
Posts: 1075
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Post by Jemook »

Hey Steve - if you can still be bothered looking into this one read ahead :)

The new EveryTickMode works great to see the values. Thanks!

I'm still getting trades closed out as I open them rather than closing out ONLY on the bar close.

Example.. current MACD bar is green, I go short and it auto-closes the position

Correct functionality would be to not take any action until the bar closes on the specified TradingTimeFrame

Thanks me lord

Cheers,
Jeremy
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Jem's MACD and SuperTrend trade manager

Post by SteveHopwood »

Jemook » Thu Nov 12, 2020 5:34 am wrote:Hey Steve - if you can still be bothered looking into this one read ahead :)

The new EveryTickMode works great to see the values. Thanks!

I'm still getting trades closed out as I open them rather than closing out ONLY on the bar close.

Example.. current MACD bar is green, I go short and it auto-closes the position

Correct functionality would be to not take any action until the bar closes on the specified TradingTimeFrame

Thanks me lord

Cheers,
Jeremy
Not if you have enabled EveryTickMode. Then the manager examines the situation at every tick and compares the close of shift 1 with now. When these are closure conditions then the manager closes the trade.

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

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

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 Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Utilities Indicators and Scripts”