Pivoty Slope

Share your 10.x automated traders here.
Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Pivoty Slope

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 tells you there is, is either a liar or an idiot. This EA will need 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.
      - Pivots. These are calculated for the relevant time frame with this formula: (High + Low + Close) / 3
      - How to use the Slope indi from Nanningbob's 10.2 system:
      • - first visit Jemook's thread at http://www.stevehopwoodforex.com/phpBB3 ... 562#p17562 Here you will find where to start reading about Nanninbob's 10.2 and learn to trade. Bob's stuff is the best thing to arrive during my time trading Forex. It is massive. Jem's thread will help you get started if this is new to you. I once stated that Recovery may well turn out to be Bob's lasting legacy to us retail Forex traders. I was wrong; this is actually going to be Slope, and it will have a part to play in everything we do from now on.

DO NOT USE THIS EA ON A LIVE TRADING ACCOUNT. IT IS EXPERIMENTAL.

Background
'Bob and Jem and Shelley's Pivot Basket auto-trader' (http://www.stevehopwoodforex.com/phpBB3 ... f=44&t=658) is the inspiration for this one. I found myself wondering what would happen if we had an individual-pair ea that uses Slope as part of the trading decision.

I started a demo last week, trading a break of the D1 pivot so long as all three pivots line up. It has been successful and it is fascinating to watch trades that start badly eventually return to profit - Bunker's 'snap back' perhaps? I toyed with the idea of adding Slope to the mix, but did not get around to doing so and so have coded Pivoty Slope to do this for me.

Pivoty Slope trades long when the Weekly pivot is above the Monthly, and short when below. EnforceTripleAlignment forces PS to wait for all three pivots to line up, so Daily > Weekly > Monthly for long, vice versa for short.

In addition, Slope is used to ascertain the overall trend and forces PS to wait for the pivots to line up in the direction of the trend, or sit out if either there is no trend or the pivots do not line up. There are the usual Slope inputs; a zero value in the relevant xxxTimeFrame turns them off.

My original plan was this, taking a buy as an example (and vice versa for a sell). Buy when:
  • - Htf Slope >= HtfBuyLevel
    - all 3 pivots line up
    - market crosses the Daily pivot
Here is where serendipity kicks in, because I use Empty4's Strategy Tester to (try to) make sure my rubbishy code comes within hailing distance of doing what it is intended to do. The first thingy I forgot to do was code the cross of the daily pivot. All that had to be in place for a buy was the pivots lining up and Slope being at the appropriate strength.

In backtesting on M5 Open Candle, with PivotCrossTimeFrame = 240 was magnificently profitable. I only noticed that I had not coded the D1 pivot cross in a visual backtest.

I added the cross code and it killed trading stone dead - maybe two trades in umpteen months. Mind, they were profitable. :lol: So, I added EnforcePivotCross; if 'true' PS will wait for all the above conditions and and D1 pivot cross before trading. If 'false', it will trade long as soon as the pivots and Slope line up.

So, we have a group of inputs with a vast amount of flexibility. There is a wide range of combinations of pivot/Slope enforcement to play with. Inveterate tinkerers have oodles to inveterately tinker with. Have fun guys.

Other inputs
I leave you to work most of them out for yourself. Here are those that might not be obvious to noobs:
  • - CriminalIsECN: set this to 'true' if your crim is a two-stage order sending bastard and you are using either a stop loss or take profit.
    - CriminalHasSundayCandle: this makes PS ignore the Sunday candle should your crim have one, in calculating the D1 pivot.
    - MaxSlippagePips: the most pips you will allow the bastard crims to move the market by in between PS sending the trade and the bc's accepting it. If you do not understand this, the go to BabyPips.com
Trade exit
As usual, I have not a clue what the best approach is. Using a stop loss kills the account in backtesting. Coders who look into bool LookForTradeClosure(int ticket) will see commented out attempts to close trades on a recross of the D1 pivot; these kill the account. By default, I have adopted the BreakEven/JumpingStop combo I have been manually demoing this week - successfully.

How to exit the inevitable loosing trades will be one of the keys to success here. Maybe this will become more obvious with demo testing.

Slope
Guys, you really need to understand what the Slope indi tells you, so do not take this brief summary as The Definitive Statement. Basically, Slope tells us this:
  • - >= 0.4: look to buy and take profit somewhere along the line.
    - >= 0.8: look to buy and hold the trade, and add to the position as the market continues to rise.
    - <= -0.4: look to sell and take profit somewhere along the line.
    - <= -0.8: look to sell and hold the trade, and add to the position as the market continues to fall.
We have zznbrm to thank for his coding of Slope. Without it, this thread could not exist. Thanks, zznbrm. Frank Muir describes himself as "I only did a couple cosmetic things to that indi." but they are damn good cosmetics, so out thanks to Frank also.

You do not need Slope on your chart or in your indi folder; Baluda sent me the code that brings the calculation 'in-house' a long time ago. Our thanks to Paul for that.

In conclusion
Let's see if this puppy has a decent tail to wag.

Have fun.

:D



Matters of general interest

Read this post:
http://www.stevehopwoodforex.com/phpBB3 ... p=800#p800 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration. There is a thread devoted to Sam's trading method at http://www.forexfactory.com/showthre...25#post5118825

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 ... p=803#p803, at the bottom of the post.

Useful utilities/EA's/scripts
Matt's chart-population script at http://www.stevehopwoodforex.com/phpBB3 ... 5733#p5733. Use this every time you start a fresh platform.
MaryJane has posted a fabulous utility to allow us to resize EA input windows: http://www.forexfactory.com/showthread.php?t=299017
Multi purpose trade manager: http://www.stevehopwoodforex.com/phpBB3 ... p=516#p516
Account equity analyser: http://www.forexfactory.com/showthread. ... ost4693716Also at http://www.forexfactory.com/showthread. ... ost4709098, which includes a template for both USD and the Euro.
Past-trades display indi by squalou; shows a graphical display of the success/failure of trades in your History tab. Breathtaking piece of work. http://www.forexfactory.com/showthread. ... ost3830610
My shell EA – the code I use to produce EA's so quickly. http://www.stevehopwoodforex.com/phpBB3 ... p=803#p803
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. pianodoodler@hotmail.com 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.
garyfritz

Re: Pivoty Slope

Post by garyfritz »

Let me make sure I understand...
SteveHopwood wrote:My original plan was this, taking a buy as an example (and vice versa for a sell). Buy when:
  • - Htf Slope >= HtfBuyLevel
    - all 3 pivots line up
    - market crosses the Daily pivot
...but you forgot to do the DP check, so you were just buying when HTF slope is happy and all 3 pivots line up? And that was what worked well? So set EnforcePivotCross to false (NOT the default value) for the magnificently profitable version?
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Pivoty Slope

Post by SteveHopwood »

garyfritz wrote:Let me make sure I understand...
SteveHopwood wrote:My original plan was this, taking a buy as an example (and vice versa for a sell). Buy when:
  • - Htf Slope >= HtfBuyLevel
    - all 3 pivots line up
    - market crosses the Daily pivot
...but you forgot to do the DP check, so you were just buying when HTF slope is happy and all 3 pivots line up? And that was what worked well? So set EnforcePivotCross to false (NOT the default value) for the magnificently profitable version?
Yup. At first, I had not even coded that Bid must be the correct side of D1 pivot.

:D
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. pianodoodler@hotmail.com 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.
zen4x
Trader
Posts: 22
Joined: Wed Nov 23, 2011 2:36 pm

Re: Pivoty Slope

Post by zen4x »

I would love to be a genius like you guys, I am serious ;)
Bunker

Re: Pivoty Slope

Post by Bunker »

SteveHopwood wrote:
garyfritz wrote:Let me make sure I understand...
SteveHopwood wrote:My original plan was this, taking a buy as an example (and vice versa for a sell). Buy when:
  • - Htf Slope >= HtfBuyLevel
    - all 3 pivots line up
    - market crosses the Daily pivot
...but you forgot to do the DP check, so you were just buying when HTF slope is happy and all 3 pivots line up? And that was what worked well? So set EnforcePivotCross to false (NOT the default value) for the magnificently profitable version?
Yup. At first, I had not even coded that Bid must be the correct side of D1 pivot.

:D
Oh Man!, the elasticity theory is now becoming the slingshot theory. We use the pivots as the sticks holding the rubber band! Steve!! this stuff prevents me from sleeping at night! It is simply out of this world all the concepts that emerge from the pivot and slope indicators!!!

OK…before I start all my analysis (where is the mini-icon for drooling ?) Let’s see if I get it right.

So, in a buy example

If I place the EA on a chart where WP > DP and….

SCENARIO 1:
HtfSlope >= 0.8 but DP < WP, the trigger will be when DP crosses WP to get the right order ?

SCENARIO 2

We get the right pivots order but HtfSlope < 0.8, the trigger will be when HtfSlope move to 0.8 ?

Did I get it ?
grimweasel
Trader
Posts: 95
Joined: Sun Nov 20, 2011 3:48 pm

Re: Pivoty Slope

Post by grimweasel »

Very interesting Steve - I love it that you forgot to code the daily pivot cross and it worked better!! Downloaded ready for testing on Mon open!
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Pivoty Slope

Post by SteveHopwood »

Bunker wrote:Oh Man!, the elasticity theory is now becoming the slingshot theory. We use the pivots as the sticks holding the rubber band! Steve!! this stuff prevents me from sleeping at night! It is simply out of this world all the concepts that emerge from the pivot and slope indicators!!!

OK…before I start all my analysis (where is the mini-icon for drooling ?) Let’s see if I get it right.

So, in a buy example

If I place the EA on a chart where WP > DP and….

SCENARIO 1:
HtfSlope >= 0.8 but DP < WP, the trigger will be when DP crosses WP to get the right order ?
Yep. If WP > MP, as described in post 1.

SCENARIO 2

We get the right pivots order but HtfSlope < 0.8, the trigger will be when HtfSlope move to 0.8 ?

Did I get it ?
Yep. If you have your inputs set up for this. As described in post 1.

I believe I explained all this in post 1?

:D
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. pianodoodler@hotmail.com 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.
Bunker

Re: Pivoty Slope

Post by Bunker »

SteveHopwood wrote:
Bunker wrote:Oh Man!, the elasticity theory is now becoming the slingshot theory. We use the pivots as the sticks holding the rubber band! Steve!! this stuff prevents me from sleeping at night! It is simply out of this world all the concepts that emerge from the pivot and slope indicators!!!

OK…before I start all my analysis (where is the mini-icon for drooling ?) Let’s see if I get it right.

So, in a buy example

If I place the EA on a chart where WP > DP and….

SCENARIO 1:
HtfSlope >= 0.8 but DP < WP, the trigger will be when DP crosses WP to get the right order ?
Yep. If WP > MP, as described in post 1.

SCENARIO 2

We get the right pivots order but HtfSlope < 0.8, the trigger will be when HtfSlope move to 0.8 ?

Did I get it ?
Yep. If you have your inputs set up for this. As described in post 1.

I believe I explained all this in post 1?

:D
You sure did ! I was just verifying my english comprehension skills.
I think I'm doing ok for a Frenchie ;)

Thanks for confirming !

Bunker
User avatar
ivanyong
Posts: 2
Joined: Thu Jun 28, 2012 8:17 am

Re: Pivoty Slope

Post by ivanyong »

Thanks you very much Steve, I will test it and see how good is the result.
sandybeach
Trader
Posts: 72
Joined: Fri Mar 09, 2012 9:43 pm
Location: Queensland, Australia

Re: Pivoty Slope

Post by sandybeach »

Another big thank you, I can't believe how many systems Bob & friend's TMA Slope is enhancing.

Thanks for this new toy, will put it into the mix this week and report how it goes.

Cheers
Marlene
Post Reply

Return to “10.x EA forum”