Holy Graily Bob 'n 'n Dotty 'n Pivots

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
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.

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by SteveHopwood »

SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
  • At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
  • To trade this robot, you have to understand:
    • How to use EA's.
    • Bob's HGI.
    • Pivots
MAKE SURE YOU READ THIS POST http://www.stevehopwoodforex.com/phpBB3 ... 41#p111241 There was a Forex bloodbath on Jan 15th 2015 that you need to know about.

You need to download two libraries because the bot will not run without them: HGBnDnP is inspired by Leon's post at http://www.stevehopwoodforex.com/phpBB3 ... 12#p152112. It is not an attempt to automate everything he wrote in that post. The bot:
  • combines trend trading as defined by the relationship of three pivots and HGI:
    • Monthly pivot > Weekly pivot > Daily pivot: we are in a down trend so sell when HGI agrees.
    • Monthly pivot < Weekly pivot < Daily pivot: we are in an up trend so buy when HGI agrees.
  • we do not range trade i.e. when the pivots are mixed or HGI is showing an opposite signal.
The bot will draw the pivots at the open of each new TradingTimeFrame candle and define the market as: trending long, trending short, or ranging. It will also define the TradingTimeFrame supports1/2/3 and resistances1/2/3 and draw those as dashed lines. Taking a long trend as an example with TradingTimeFrame set to Daily, HGBnDnP will then:
  • send buy stops at the DP and support/resistance levels that are above the market and are below S3 - so a total 6 pending orders.
  • send buy limits at those levels below the market.
  • each pending trade has an expiry time set by the PostTradeAttemptWaitSeconds inputs (last input in "General inputs"). This input is in minutes so the default is 16 hours. You will need to adjust this if playing with lower time frames.
  • you have a choice of the usual TakeProfitPips and StopLossPips for your TP/SL. These are automated if left set to zero:
    • TP is S3 for all buys and R3 for all sells.
    • SL is PivotStopLossPips ("General inputs", straight after StopLossPips) below S3 for a buy and above R3 for a sell.
There are two more groups of inputs that help you control trade opening and closing:
  • Automatic position closure:
    • TradeClosureHour: this is the hour at which to start looking to close positions for the day. Use broker time. Set to 24+ or 0- to stop this feature.
    • MinCashProfitToAllowClosure: this tells the bot only to close the position if it is in profit and for you to specify the minimum acceptable profit. < 0 turns this off
  • Next day trades (or next candle if you are playing with other time frames)
    • AllowNewTradingWhenPreviousStillOpen: thhere may still be trades open from a previous candle fresh trades may not be helpful. This input allows us to disable adding fresh trades at the open of a new candle.
All the usual Dotty stuff is included, and I think I have coded this bot so it will still work but it has no place in the trading strategy and so have not tested it. Experiment with this stuff, don't just go with OOTB defaults. There are lots and lots of you guys but only one of me; there is a limit to how much testing I can do.

It makes a huge difference to our CPU usage if we only have charts open that are tradable - this is where the "HGBnDnPivot dashboard EA" comes in. You will be familiar with how it works if you have been using my DFC version - this one here is what inspired me to create the DFC version. The dashboard EA will:
  • scan the charts for those where the market is trending.
  • display a list of potential pairs to trade.
  • open charts and add your chosen template to each new chart when the market is in a trading or close proximity zone.
  • delete the chart if there are no open trades and the market has moved into a range.
  • the inputs are:
    • AutomateChartOpeningAndClosing: tells the ea to open and close charts automatically. Turn this to 'false' if you want complete control of your charts.
    • ReservedPair: this is the chart that will host the EA. It will leave this chart alone. It should be a pair that you would not usually trade.
    • TemplateName: the name of the template to apply to each chart.
    • NewChartTimeFrame: the time frame for each chart that the EA opens. Pick the one that you find the easiest to view - it has no impact on the trading EA.
    • MagicNumber: this tells the EA whether it should recognise open trades. Manually-sent trades have a magic number of 0.
    • 3 time frames that must match those of your trading EA.
    • BrokerHasSundayCandle is for those of us whose broker has one of these. If 'true' then the bot will ignore the D1 Sunday candle and work instead with the Friday candle.
    • EventTimerIntervalSeconds: this EA does not work with quotes from the broker. It works on a timer and this input controls how often the timer fires. This is in seconds, so the default is every 10 minutes.
  • To use the Dashboard EA:
    • Set up a trading chart chart as you wish it to look and with HGBnDnP loaded up with the inputs of your choice. Save the template.
    • Load your 'reserved chart';
    • Drag the dashboard EA onto the chart, inserting your template name into the TemplateName input.
I have attached a setfile that will set the bot to trade as I have been trading it. To stimulate your appetite, here is my trading since starting the demo on 5th April:
HGBnDnPivots.png
I have intervened manually and closed a few profitable positions that were starting to turn around.

Have fun girls and girlesses.

:xm:


Matters of general interest
Go here to download and run the script that will fill your platform's missing chart history: http://www.stevehopwoodforex.com/phpBB3 ... f=15&t=254
Read this post:
http://www.stevehopwoodforex.com/phpBB3 ... p?f=6&t=78 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration.

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79, at the bottom of the post.

Useful utilities/EA's/scripts -

-
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
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by Wavegarrick »

Hi Guys,

It is the first time that I have had the priviledge in seeing all the hard work and effort that Steve puts into creating all these Ea's for us. A big thanks and hats off :hi: We are priviledged to have Steve.

Cheers
Leon
puffoley
Trader
Posts: 26
Joined: Tue Oct 07, 2014 2:12 pm
Location: Berlin

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by puffoley »

A new toy, again :shock: Do you sleep sometimes Steve?
Thanks a lot for all the hard work, i will start testing this beast next month.

Alan
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.

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by SteveHopwood »

puffoley » Sat Apr 15, 2017 9:59 pm wrote:A new toy, again :shock: Do you sleep sometimes Steve?
Only when I have bugger all else to do. It is an overrated pastime.

:xm:
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
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by tomele »

Thanks for the nice new toy, Steve.

:yahoo: :yahoo: :good: :good: :clap: :clap: :party: :party:
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
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.

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by SteveHopwood »

tomele » Sun Apr 16, 2017 9:23 pm wrote:Thanks for the nice new toy, Steve.

:yahoo: :yahoo: :good: :good: :clap: :clap: :party: :party:
You are most welcome. As always though, I am merely the mechanic here bolting the bits together. The people really to thank are Bob and Leon. I would not have bolted the bits together if Leon had not come up with the bits to bolt. Leon would not have come up with the bits to bolt if Bob had not manufactured them in the first place.

:xm:
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
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by Wavegarrick »

Leon would not have come up with the bits to bolt if Bob had not manufactured them in the first place.
Could not agree with you more Steve. :good:

I am currently testing HgbnDottynPivots with a few flavours of my own. As Steve has mentioned he had to manually intervene and this is quite correct using pivots especially when we are getting close to weekly/monthly resistance/support or even peak hilo's etc. My attempt is to let the the Ea work on its own and close profits or losses at the slightest hint of a reversal and hopefully ride the trend in the opposite direction :)

Anyway still working on tweaks this week and hopefully will be able to share towards next week.

Cheers
Leon
User avatar
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by tomele »

SteveHopwood » 15 Apr 2017, 18:10 wrote: Please note folks
This bot does not like it when you change time frames - it will delete itself from the chart. For any coders able to spot what is wrong:
  • the block starting at line 25 defines a list of values that make it easy to access the ttfPivotPrices[8] array (line 139).
  • void GetSupportResistanceLevels(string symbol, int tf) calculate s/r and works when the ea is loaded.
  • changing time frames throws up an error in the platform's Experts tab the shows, "Array out of range" at line 644
Any ideas?
Yes. Have a look at line 345. You resize the array to 0 there.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
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.

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by SteveHopwood »

tomele » Mon Apr 17, 2017 10:02 am wrote:
SteveHopwood » 15 Apr 2017, 18:10 wrote: Please note folks
This bot does not like it when you change time frames - it will delete itself from the chart. For any coders able to spot what is wrong:
  • the block starting at line 25 defines a list of values that make it easy to access the ttfPivotPrices[8] array (line 139).
  • void GetSupportResistanceLevels(string symbol, int tf) calculate s/r and works when the ea is loaded.
  • changing time frames throws up an error in the platform's Experts tab the shows, "Array out of range" at line 644
Any ideas?
Yes. Have a look at line 345. You resize the array to 0 there.
Thanks Thomas. :clap: :clap: :clap: I live and learn. The fix is in 1a in post 1.

DIYers, I have changed line 139 to:
double ttfPivotPrices[];//Resized in OnInit().

and added this at line 314:
ArrayResize( ttfPivotPrices, 8);//This will need expanding if we introduce mid pivots

:xm:
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.
saintalan
Trader
Posts: 46
Joined: Fri Nov 30, 2012 1:30 pm
Location: Windsor, UK

Holy Graily Bob 'n 'n Dotty 'n Pivots

Post by saintalan »

Hi

Excuse me if I am having a dimwitty day today but try as I might I cant get this to load.

The other 'n Dottys are working inc Super Slope.

My files show no .ex4 which I assume (?) there should be? I tried a Compile and get an error 'Pending ExpiryMinutes' undeclared identifier as below.

//PendingExpiryMinutes is delcared in the core library and needs initialising
//to the value required by individual EA's.'
PendingExpiryMinutes = PendingTradeExpiryMinutes;

As I say apologies if I am just not doing it right.

Cheers

Alan
Post Reply

Return to “Thingy Bob EA's”