Jem's MACD and SuperTrend trade manager

MPTM's new home

Jem's MACD and SuperTrend trade manager

Postby SteveHopwood » Sun Nov 08, 2020 11:18 am

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?

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.

Jem's MACD and SuperTrend trade manager

Postby Jemook » Mon Nov 09, 2020 5:33 am

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

Cheers
Jeremy
Global Prime Forex - The best broker in the world as voted by us! Click here to visit our website and join the 500+ Steve Hopwood members who choose GP as their broker of choice.

Forex Peace Army rated 4.8 out of 5 stars from over 300+ reviews - click here to view.
User avatar
Jemook
 
Posts: 1910
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Postby Pipstubborn » Mon Nov 09, 2020 3:44 pm

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

Pipstubborn/William
Pipstubborn
 
Posts: 264
Joined: Thu Jul 12, 2012 5:17 pm

Jem's MACD and SuperTrend trade manager

Postby SteveHopwood » Tue Nov 10, 2020 9:49 pm

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?

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.

Jem's MACD and SuperTrend trade manager

Postby Jemook » Wed Nov 11, 2020 5:16 am

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.
Global Prime Forex - The best broker in the world as voted by us! Click here to visit our website and join the 500+ Steve Hopwood members who choose GP as their broker of choice.

Forex Peace Army rated 4.8 out of 5 stars from over 300+ reviews - click here to view.
User avatar
Jemook
 
Posts: 1910
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Postby SteveHopwood » Wed Nov 11, 2020 6:55 am

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?

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.

Jem's MACD and SuperTrend trade manager

Postby SteveHopwood » Wed Nov 11, 2020 7:31 am

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?

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.

Jem's MACD and SuperTrend trade manager

Postby Jemook » Wed Nov 11, 2020 12:05 pm

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
Global Prime Forex - The best broker in the world as voted by us! Click here to visit our website and join the 500+ Steve Hopwood members who choose GP as their broker of choice.

Forex Peace Army rated 4.8 out of 5 stars from over 300+ reviews - click here to view.
User avatar
Jemook
 
Posts: 1910
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Postby Jemook » Thu Nov 12, 2020 5:34 am

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
Global Prime Forex - The best broker in the world as voted by us! Click here to visit our website and join the 500+ Steve Hopwood members who choose GP as their broker of choice.

Forex Peace Army rated 4.8 out of 5 stars from over 300+ reviews - click here to view.
User avatar
Jemook
 
Posts: 1910
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Jem's MACD and SuperTrend trade manager

Postby SteveHopwood » Thu Nov 12, 2020 6:01 am

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?

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.

Next

Return to Utilities Indicators and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest