stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

10.7 trading helpers by Steve and others
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3561
Page 6 of 9
Author:  SteveHopwood [ Wed May 14, 2014 9:51 pm ]
Post subject:  10.7 trading helpers by Steve and others

zader » Wed May 14, 2014 6:53 pm wrote:
In the trade twice helpers changing line 900 in the Sell Twice into the trend from

Code: Select all

if ((StoCrossStatus == crossshort70 && !Trade1Open) || (StoCrossStatus == crossshort90 && !Trade2Open))
to

Code: Select all

if ((StoCrossStatus == crossshort70 && !Trade2Open) || (StoCrossStatus == crossshort90 && !Trade1Open))
and line 886 in the Buy Twice into the trend to

Code: Select all

if ((StoCrossStatus == crosslong10 && !Trade2Open) || (StoCrossStatus == crosslong30 && !Trade1Open))
seems to work and also if I understand the CT is against the weekly and towards the daily if so all the CT helpers have the order backwards
Waiting to Sell into the retrace has

Code: Select all

      if (DailyStochMain == 100)
         if(HT2StochMain == 0)
shouldn't that be Daily =0 on bottom weekly=100 on top?? same for the buys if thats the case.

I'm very new to coding and this was a couple of hrs trial and error today so I hope I'm on the right track, if I'm way off and messed up please don't tear me a new one! I'm just trying to help while you've got more important things to worry about.
Thanks very much for trying - and succeeding - to help. About the Sell Twice, yep dead right and I cannot believe I made that bloop.

Naah, t'wasnt me - twas someone else pirating my work. :arrrg: :arrrg: :arrrg:

Re your post about the Buy Twice, I am not so sure. Your quoted is not my code (I hope) and the original would be correct as a cross upwards of the 10 is trade 1. Unless I have buggered up making the cross of the 10 trade 1, in which case correcting that would be good. I just looked at the code that sets this up in ReadIndicatorValues() and it looks ok to me. We shall see.

zader, great to see you trying this stuff out for yourself and catching me out in a bloop that far more experienced coders appear to have been unable to spot - including myself. Thanks for your help.

Guys, not making any changes and uploads tonight. More tomorrow instead.


Cheers
Author:  SteveHopwood [ Wed May 14, 2014 9:57 pm ]
Post subject:  10.7 trading helpers by Steve and others

I missed this last bit:
Waiting to Sell into the retrace has

Code: Select all

      if (DailyStochMain == 100)
         if(HT2StochMain == 0)
shouldn't that be Daily =0 on bottom weekly=100 on top?? same for the buys if thats the case.
I think you are correct but will look again in the morning to check. Many thanks.

:xm:
Author:  zader [ Thu May 15, 2014 7:26 am ]
Post subject:  10.7 trading helpers by Steve and others

SteveHopwood » Wed May 14, 2014 9:51 pm wrote:
Re your post about the Buy Twice, I am not so sure. Your quoted is not my code (I hope) and the original would be correct as a cross upwards of the 10 is trade 1. Unless I have buggered up making the cross of the 10 trade 1, in which case correcting that would be good. I just looked at the code that sets this up in ReadIndicatorValues() and it looks ok to me. We shall see.

Cheers
You're 100% correct about the Buy Twice code, my bad :oops:
Author:  SteveHopwood [ Thu May 15, 2014 9:31 am ]
Post subject:  10.7 trading helpers by Steve and others

Updated versions of both Sell Twice EA's is in post 1, with zader's fix. You can make the changes yourselves by going to line 900 in both the trend and retrace versions.

To confirm in everyone's minds:
  • a trade following a cross upwards of the 10 sets Trade1Open to 'true'.
  • a trade following a cross upwards of the 30 sets Trade2Open to 'true'.
  • a trade following a cross downwards of the 90 sets Trade1Open to 'true'.
  • a trade following a cross downwards of the 70 sets Trade2Open to 'true'.
Definitions of crosslong10 etc are at the top of the code:

Code: Select all

//Sto7 cross status
#define crossnone "No cross"
#define crosslong10 "Long cross of Sto 10 line"
#define crosslong30 "Long cross of Sto 30 line"
#define crossshort70 "Short cross of Sto 70 line"
#define crossshort90 "Short cross of Sto 90 line"
:xm:
Author:  zader [ Thu May 15, 2014 11:47 am ]
Post subject:  10.7 trading helpers by Steve and others

2 tiny teeny little errors left in buy and sell twice counter trade helpers. Please make the changes yourselves I'm sure Steve's sick of this already.
In the Waiting to Sell Twice into the retrace (CT).mq4 goto lines 901 & 902 and change it to

Code: Select all

      if (DailyStochMain == 0)
         if(HT2StochMain == 100)
and in the Waiting to Buy Twice into the retrace (CT).mq4 goto lines 888 & 889 and change it to

Code: Select all

      if (DailyStochMain == 100)
         if(HT2StochMain == 0)
Author:  SteveHopwood [ Thu May 15, 2014 1:05 pm ]
Post subject:  10.7 trading helpers by Steve and others

Hell's bells and buckets of blood; what was I on when I coded this little lot?

Thanks zader; you have been invaluable. In fact, the logic in the single CT sell trader was wrong as well - and probably the single buy ct trader as well, but I just spent an hour checking the logic of all 8 traders and then uploading them to post 1 so I can't remember.

I suggest you guys re-download all 8 ea's from post 1. There is a 1 in a 100 chance they will work correctly now.

Coders, I reckon I could not spot what was wrong because of the confusing HT2StochMain variable name. I renamed it WeeklyStochMain in the shell that Tommaso and I created and will do a seargh/replace on all of them in the 8 helper ea's. I will not bother uploading them; the variables will have their new names next time I do an update.

:xm:
Author:  SpiderX [ Thu May 15, 2014 1:30 pm ]
Post subject:  10.7 trading helpers by Steve and others

Should it be

Code: Select all

      if (CloseEnough(DailyStochMain, 0))
         if(CloseEnough(HT2StochMain, 100))
instead ?

Cheers
Author:  SteveHopwood [ Thu May 15, 2014 1:41 pm ]
Post subject:  10.7 trading helpers by Steve and others

SpiderX » Thu May 15, 2014 1:30 pm wrote:Should it be

Code: Select all

      if (CloseEnough(DailyStochMain, 0))
         if(CloseEnough(HT2StochMain, 100))
instead ?

Cheers
Which ea Spi?

:xm:
Author:  SteveHopwood [ Thu May 15, 2014 1:50 pm ]
Post subject:  10.7 trading helpers by Steve and others

Spi has made me look again at the conditionals and they are still not all correct.

:xm:
Author:  SteveHopwood [ Thu May 15, 2014 1:57 pm ]
Post subject:  10.7 trading helpers by Steve and others

Check on these for me please, guys. I have changed the variable name:

Buying the retrace and buying twice the retrace should be

Code: Select all

//Specific system filters
   if ((StoCrossStatus == crosslong10 && !Trade1Open) || (StoCrossStatus == crosslong30 && !Trade2Open)) 
      if (DailyStochMain == 100)
         if(WeeklyStochMain == 0)
            SendLong = true;
   
Buying the trend and buying twice into the trend should be

Code: Select all

 //Specific system filters
   if (StoCrossStatus == crosslong10 || StoCrossStatus == crosslong30) 
      if (DailyStochMain == 100)
         if(WeeklyStochMain == 100)
            SendLong = true;
   
  
Selling the retrace and selling twice the retrace should be

Code: Select all

//Specific system filters
      if (StoCrossStatus == crossshort70 || StoCrossStatus == crossshort90) 
      if (DailyStochMain == 0)
         if(WeeklyStochMain == 100)
            SendShort = true;
      
Selling the trend and selling twice the trend should be

Code: Select all

//Specific system filters
      if (StoCrossStatus == crossshort70 || StoCrossStatus == crossshort90) 
      if (DailyStochMain == 0)
         if(WeeklyStochMain == 0)
            SendShort = true;
      
Does all this look good? :arrrg: :arrrg: :arrrg: :arrrg: :arrrg:

:xm:
All times are UTC Page 6 of 9