Stochy Bob

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
jlcgarcia

Stochy Bob

Post by jlcgarcia »

jlcgarcia » Wed Nov 19, 2014 4:21 pm wrote:Hello friends,

I think there is a little bug in the OnInit() section of the code referred to the followiong lines:

Code: Select all

   if (TradeComment == "") TradeComment = " ";
   if (Buy30Comment == "") Buy30Comment = "Buy30";
   if (Buy20Comment == "") Buy20Comment = "Buy20";
   if (Buy10Comment == "") Buy10Comment = "Buy10";
   if (Sell90Comment == "") Sell90Comment = "Sell90";
   if (Sell80Comment == "") Sell90Comment = "Sell80";
   if (Sell70Comment == "") Sell90Comment = "Sell70";

They must be as follows:

Code: Select all

  if (TradeComment == "") TradeComment = " ";
   if (Buy30Comment == "") Buy30Comment = "Buy30";
   if (Buy20Comment == "") Buy20Comment = "Buy20";
   if (Buy10Comment == "") Buy10Comment = "Buy10";
   if (Sell90Comment == "") Sell90Comment = "Sell90";
   if (Sell80Comment == "") Sell80Comment = "Sell80";
   if (Sell70Comment == "") Sell70Comment = "Sell70";

Also, tell you that I have developed a simple multipair version of this EA, that I am trading live at the moment. Also the EA allows you to introduce two stochastics inputs (two stochastics with different parameters) and trade both at the same time. This multipair version (codenamed Zodiaco) is still a work in progress and I will not post it in this forum without the permission of SH.

Regards


José Luis

Hi,

excuse me again, but I find anothe bug referred to the following parameters,

Code: Select all

extern string   sep1="================================================================";
extern string   tch="---- Trade level choices and trading styles ----";
extern string   tlc="-- Trade levels --";
extern bool     Buy30=true;//Send a pending sell stop at < 30  
extern string   Buy30Comment="Buy30";
extern bool     Buy20=true;//Send a pending sell stop at < 20
extern string   Buy20Comment="Buy20";
extern bool     Buy10=true;//Send a pending sell stop at < 10
extern string   Buy10Comment="Buy10";
extern bool     Sell90=true;//Send a pending sell stop at > 90
extern string   Sell90Comment="Sell90";
extern bool     Sell80=true;//Send a pending sell stop at > 80
extern string   Sell80Comment="Sell80";
extern bool     Sell70=true;//Send a pending sell stop at > 70
extern string   Sell70Comment="Sell70";

Independently, that you made them false, the program will consider them as true.

The modification affects to the LookForTradingOpportunities() function. I am posting here the text modified of this function for Steve to take a look.
Stochy Bob.txt

Regards


José Luis
You do not have the required permissions to view the files attached to this post.
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.

Stochy Bob

Post by SteveHopwood »

jlcgarcia » Wed Nov 19, 2014 2:21 pm wrote:Hello friends,

I think there is a little bug in the OnInit() section of the code referred to the followiong lines:

Code: Select all

   if (TradeComment == "") TradeComment = " ";
   if (Buy30Comment == "") Buy30Comment = "Buy30";
   if (Buy20Comment == "") Buy20Comment = "Buy20";
   if (Buy10Comment == "") Buy10Comment = "Buy10";
   if (Sell90Comment == "") Sell90Comment = "Sell90";
   if (Sell80Comment == "") Sell90Comment = "Sell80";
   if (Sell70Comment == "") Sell90Comment = "Sell70";

They must be as follows:

Code: Select all

  if (TradeComment == "") TradeComment = " ";
   if (Buy30Comment == "") Buy30Comment = "Buy30";
   if (Buy20Comment == "") Buy20Comment = "Buy20";
   if (Buy10Comment == "") Buy10Comment = "Buy10";
   if (Sell90Comment == "") Sell90Comment = "Sell90";
   if (Sell80Comment == "") Sell80Comment = "Sell80";
   if (Sell70Comment == "") Sell70Comment = "Sell70";

Also, tell you that I have developed a simple multipair version of this EA, that I am trading live at the moment. Also the EA allows you to introduce two stochastics inputs (two stochastics with different parameters) and trade both at the same time. This multipair version (codenamed Zodiaco) is still a work in progress and I will not post it in this forum without the permission of SH.

Regards


José Luis
Thanks for spotting that, José Luis. :clap: It has not arisen as an issue because people go ootb for stuff like that. I will correct it in the next update.

Please do post your multi-pair version once finished.

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

Stochy Bob

Post by SteveHopwood »

jlcgarcia » Wed Nov 19, 2014 4:09 pm wrote:
Hi,

excuse me again, but I find anothe bug referred to the following parameters,

Code: Select all

extern string   sep1="================================================================";
extern string   tch="---- Trade level choices and trading styles ----";
extern string   tlc="-- Trade levels --";
extern bool     Buy30=true;//Send a pending sell stop at < 30  
extern string   Buy30Comment="Buy30";
extern bool     Buy20=true;//Send a pending sell stop at < 20
extern string   Buy20Comment="Buy20";
extern bool     Buy10=true;//Send a pending sell stop at < 10
extern string   Buy10Comment="Buy10";
extern bool     Sell90=true;//Send a pending sell stop at > 90
extern string   Sell90Comment="Sell90";
extern bool     Sell80=true;//Send a pending sell stop at > 80
extern string   Sell80Comment="Sell80";
extern bool     Sell70=true;//Send a pending sell stop at > 70
extern string   Sell70Comment="Sell70";
Independently, that you made them false, the program will consider them as true.

The modification affects to the LookForTradingOpportunities() function. I am posting here the text modified of this function for Steve to take a look.



Regards

José Luis
Sorry José Luis, but I do not get your point.

: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. 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.
jlcgarcia

Stochy Bob

Post by jlcgarcia »

Hi Steve,

perhaps I have not explain the problem properly. One can not exclude specific Stoch entries. The program will trade all the Stoch levels although you made them false.

For example, in the following piece of code

Code: Select all

//Buying at < 20
         if (StochVal[1] < 20 && StochVal[1] > 10)//Sto must be in the 10 - 20 band
            if (StochVal[2] > 20 || StochVal[2] < 10)//Sto must have risen from below 20 or fallen from above 30
            {


   THIS LINE MUST BE REPLACED           if (!Buy20Open)//Not already trading this band  


               {
                  SendLong = true;
                  TradeComment = Buy20Comment;
               }//if (!Buy20Open)      
            }//if (StochVal[2] > 20 || StochVal[2] < 10) )
must be replaced by

Code: Select all

//Buying at < 20
         if (StochVal[1] < 20 && StochVal[1] > 10)//Sto must be in the 10 - 20 band
            if (StochVal[2] > 20 || StochVal[2] < 10)//Sto must have risen from below 20 or fallen from above 30
            {


  WITH THIS LINE             if (!Buy20Open && Buy20)//Not already trading this band


               {


                  SendLong = true;
                  TradeComment = Buy20Comment;
               }//if (!Buy20Open)      
            }//if (StochVal[2] > 20 || StochVal[2] < 10) )
This way if you select

Code: Select all

extern bool     Buy20=false;//Send a pending sell stop at < 20
this Stoch level will not be traded.

Please take a look at the txt file I have posted with the modified LookForTradingOpportunities() function.

Regards

José Luis
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.

Stochy Bob

Post by SteveHopwood »

jlcgarcia » Wed Nov 19, 2014 6:31 pm wrote:Hi Steve,

perhaps I have not explain the problem properly. One can not exclude specific Stoch entries. The program will trade all the Stoch levels although you made them false.

For example, in the following piece of code

Code: Select all

//Buying at < 20
         if (StochVal[1] < 20 && StochVal[1] > 10)//Sto must be in the 10 - 20 band
            if (StochVal[2] > 20 || StochVal[2] < 10)//Sto must have risen from below 20 or fallen from above 30
            {

   THIS LINE MUST BE REPLACED           if (!Buy20Open)//Not already trading this band  

               {
                  SendLong = true;
                  TradeComment = Buy20Comment;
               }//if (!Buy20Open)      
            }//if (StochVal[2] > 20 || StochVal[2] < 10) )
must be replaced by

Code: Select all

//Buying at < 20
         if (StochVal[1] < 20 && StochVal[1] > 10)//Sto must be in the 10 - 20 band
            if (StochVal[2] > 20 || StochVal[2] < 10)//Sto must have risen from below 20 or fallen from above 30
            {

  WITH THIS LINE             if (!Buy20Open && Buy20)//Not already trading this band

               {

                  SendLong = true;
                  TradeComment = Buy20Comment;
               }//if (!Buy20Open)      
            }//if (StochVal[2] > 20 || StochVal[2] < 10) )
This way if you select

Code: Select all

extern bool     Buy20=false;//Send a pending sell stop at < 20
this Stoch level will not be traded.

Please take a look at the txt file I have posted with the modified LookForTradingOpportunities() function.

Regards

José Luis
Which line? Couldn't point me to an actual line number, could you? With a description of what is wrong and how to fix it?

: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. 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.
jlcgarcia

Stochy Bob

Post by jlcgarcia »

SteveHopwood » Thu Nov 20, 2014 12:30 am wrote: Which line? Couldn't point me to an actual line number, could you? With a description of what is wrong and how to fix it?

:xm:
Hi Steve,

the wrong lines are 1440, 1452, 1469, 1479, 1489, 1541, 1553, 1565, 1582, 1592 and 1602.


I am posting here the corrected version, so you can compare with the original.

Excuse me if I have not explained properly the modifications.


Also I have opened a demo for the multipair version of this EA, as I have said before I use two 4H stochastics at the same time for the entries. The trail stop loss and the trail tp are calculated taking into account the volatility of the pairs. There is still a lot of work to do. Let's see.

Regards

José Luis
gringoh

Stochy Bob

Post by gringoh »

Hi Steve,

I have a situation here with a buy trade open and a sell trade open on USDCHF.

- Price was above MA 240 and a buy trade was opened, normal.
- Price drop below MA and then, later, reach 70s level (between 70 & 80 level), so a sell trade was opened, normal.

As the price never went above 90 level and Stop Loss was not hit, the buy trade remain opened while the sell trade was opened.

Result is a hedge situation. What is your view on this?

- Keep the hedge open and close manually at best price?

- Or to avoid this situation, if so, I see 2 solutions:

1 – Avoid Sell entries if buy are opened and vice versa
2 – or add a stop condition like this one:

Code: Select all

e.g. for buy
(if StochVal[2] > 70)
     (If StochVal[1] < 70)
          CloseThisTrade = true;
Best,
G
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.

Stochy Bob

Post by SteveHopwood »

jlcgarcia » Thu Nov 20, 2014 5:28 am wrote:
SteveHopwood » Thu Nov 20, 2014 12:30 am wrote: Which line? Couldn't point me to an actual line number, could you? With a description of what is wrong and how to fix it?

:xm:
Hi Steve,

the wrong lines are 1440, 1452, 1469, 1479, 1489, 1541, 1553, 1565, 1582, 1592 and 1602.


I am posting here the corrected version, so you can compare with the original.

Excuse me if I have not explained properly the modifications.


Also I have opened a demo for the multipair version of this EA, as I have said before I use two 4H stochastics at the same time for the entries. The trail stop loss and the trail tp are calculated taking into account the volatility of the pairs. There is still a lot of work to do. Let's see.

Regards

José Luis
Ahhhhh. I see what happened. Thanks very much for posting this or my bloop might not have manifested itself for some time.

I could see no difference between your code and mine - in fact there is no difference. So I downloaded the version in post 1 and it holds the incorrect code.

Here is what happens folks. I have a dedicated code-development platform. I code an ea then move it to its dedicated demo if it looks promising and continue to develop it from there. I must have uploaded the wrong file to post 1 - the one in the development platform not the one I worked on subsequently.

V 1a is in post 1 and everyone interested in this bot must re-download. Sorry about that, and warm :clap: to José Luis for bringing this up.

: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. 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.
Vlokkies
Trader
Posts: 41
Joined: Fri Oct 17, 2014 12:55 pm

Stochy Bob

Post by Vlokkies »

SteveHopwood » Thu Nov 20, 2014 11:45 pm wrote: Ahhhhh. I see what happened. Thanks very much for posting this or my bloop might not have manifested itself for some time.

I could see no difference between your code and mine - in fact there is no difference. So I downloaded the version in post 1 and it holds the incorrect code.

Here is what happens folks. I have a dedicated code-development platform. I code an ea then move it to its dedicated demo if it looks promising and continue to develop it from there. I must have uploaded the wrong file to post 1 - the one in the development platform not the one I worked on subsequently.

V 1b is in post 1 and everyone interested in this bot must re-download. Sorry about that, and warm :clap: to José Luis for bringing this up.

:xm:
Hi Steve.

The bot in post 1 is version 1a, not 1b. Is that correct?
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.

Stochy Bob

Post by SteveHopwood »

Vlokkies » Fri Nov 21, 2014 3:19 am wrote:
Hi Steve.

The bot in post 1 is version 1a, not 1b. Is that correct?
Yes. That was a typing error that I have corrected. Thanks. V 1a, definitely.

: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. 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.
Post Reply

Return to “Thingy Bob EA's”