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

Slopey Peaky Stochy Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5691
Page 1 of 2
Author:  SteveHopwood [ Wed Jun 26, 2019 4:19 pm ]
Post subject:  Slopey Peaky Stochy Bob

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:
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 the "SPB core library.mqh" file in your platform's Include folder. Download it from viewtopic.php?p=159559#p159559


This EA uses Stochastic to generate a trade in the direction indicated by your choice of Super Slope and Peaky inputs. It uses the Slopey Peaky Bob engine found at viewtopic.php?p=159559#p159559. Read SPB's User guide for information about everything apart from using the Stochastic indicator.

Stochy has two trading methods:
  • The cross from overbought/sold back into the main body.
  • From within the main body:
    • Stoch must be rising for a buy trade, and falling for a sell.
The other specific inputs are:
  • TradingMethod: tells Stochy whether to trade the cross or from within the main body.
  • EveryTickMode:
    • when true, Stochy will look for trading opportunities at every tick.
    • when false, Stochy will look for trading opportunities at the close of each candle.
  • The next 6 inputs represent those you would use when loading Stochastic onto your chart.
  • OverBought and OverSold are your choice of OBOS levels. The space in between is the 'main' area the Stochy will use if you choose the 'area' trading option.
  • CloseAtOppositeEnd: tells Stochy to close buys at your choice of OverBought and sells at your choice of OverSold.


:xm: :rocket:

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 -

-
Author:  Dragonian [ Thu Jun 27, 2019 1:46 am ]
Post subject:  Slopey Peaky Stochy Bob

Hello Steve,

Great to have these new additions, thanks.

I notice that, whereas when using SPSwingyB the triggers "CP" and"FR" both show up as columns displayed as Solo signals, when using either SPStochyB or SPHGB neither the Stochastic nor the HGI triggers are shown, just the "PK" and "SS" columns. Is this correct?
TDesk 1.png
Author:  SteveHopwood [ Thu Jun 27, 2019 9:38 am ]
Post subject:  Slopey Peaky Stochy Bob

Dragonian » Thu Jun 27, 2019 1:46 am wrote:Hello Steve,

Great to have these new additions, thanks.

I notice that, whereas when using SPSwingyB the triggers "CP" and"FR" both show up as columns displayed as Solo signals, when using either SPStochyB or SPHGB neither the Stochastic nor the HGI triggers are shown, just the "PK" and "SS" columns. Is this correct?
Nope. I forgot to adapt the code. I have done so and they should now send "Sto" and "HGI" columns as appropriate, to TDesk.

:xm: :rocket:
Author:  Dragonian [ Thu Jun 27, 2019 9:41 am ]
Post subject:  Slopey Peaky Stochy Bob

Thank you Steve :hi:
Author:  SteveHopwood [ Thu Jun 27, 2019 8:02 pm ]
Post subject:  Slopey Peaky Stochy Bob

I made a daft mistake with the closure code. I had buys closing at oversold and sells at overbought. This is fixed in post 1.

Easy DIY for those of you who enjoy it. Do a search for: //BB at 'wrong' end

There are two of them. The first block of code closes buys so replace the code with:

Code: Select all

      //Stoch at 'wrong' end
      if (!CloseThisTrade)
         if (CloseAtOppositeEnd)
            if (stoVal[pairIndex] > OverBought)
               CloseThisTrade = true;
 
The second block closes sells, so replace the code with:

Code: Select all

      //Stoch at 'wrong' end
      if (!CloseThisTrade)
         if (CloseAtOppositeEnd)
            if (stoVal[pairIndex] < OverSold)
               CloseThisTrade = true;
:xm: :rocket:
Author:  SteveHopwood [ Mon Jul 01, 2019 6:44 pm ]
Post subject:  Slopey Peaky Stochy Bob

Turn Stochy off for now folks. He is doing the rapid opening/closing of trades and I cannot see why.

:xm: :rocket:
Author:  SteveHopwood [ Tue Jul 02, 2019 2:50 pm ]
Post subject:  Slopey Peaky Stochy Bob

I had the conditional logic coded with all the skill of a geriatric poodle. Stochy is running correctly now, so please redownload from post 1.

DIYers, this is bitty. The easy bit first.
Do a search for: //Using the cross trading method.

Replace the next two blocks of cod with this:

Code: Select all

         //Using the cross trading method
         if (TradingMethod == cross)
         {
            //Cross long
            if (oldStoVal[pairIndex] < OverSold)
               if (stoVal[pairIndex] > OverSold)
                  stoStatus[pairIndex] = tradablelong;
                  
            //Cross short
            if (stoStatus[pairIndex] == untradable)
               if (oldStoVal[pairIndex] > OverBought)
                  if (stoVal[pairIndex] < OverBought)
                     stoStatus[pairIndex] = tradableshort;
                     
         }//if (TradingMethod == cross)
         
         //Using the trading area method
         if (stoVal[pairIndex] < OverBought)
            if (stoVal[pairIndex] > OverSold)
            {
               //Is sto rising?
               if (oldStoVal[pairIndex] < stoVal[pairIndex])
                  stoStatus[pairIndex] = tradablelong;
               else
               if (oldStoVal[pairIndex] > stoVal[pairIndex])//It is falling
                  stoStatus[pairIndex] = tradableshort;
                  
            }//if (stoVal[pairIndex] > OverSold)
Compare the above with the existing code before replacing if you want to laugh at my first effort.

Here is where it gets bitty. Scroll down to: if (SendToTDesk). Replace the entire block with this:

Code: Select all

         if (SendToTDesk)
            if (oldStoStatus[pairIndex] != stoStatus[pairIndex])
            {
               if (stoStatus[pairIndex] == untradable) PublishTDeskSignal("Sto",TradingTimeFrame,symbol,FLAT); else
               //We can go long if there has been a swing low
               if(stoStatus[pairIndex] == tradablelong)  PublishTDeskSignal("Sto",TradingTimeFrame,symbol,LONG); else
               //We can go short if there has been a swing high
               if(stoStatus[pairIndex] == tradableshort)   PublishTDeskSignal("Sto",TradingTimeFrame,symbol,SHORT);
            }//if (oldStoStatus[pairIndex] != stoStatus[pairIndex])
         oldStoStatus[pairIndex] = stoStatus[pairIndex];
               
      }//if (oldCandleReadTime[pairIndex] != iTime(symbol, CandleTimeFrame, 0) )
Compiling here will throw up a host of errors because you need a new array. I noticed that I had omitted a check that stops Stochy bombarding TDesk with unchanged signals so I have added an array to keep a note of each changed signal.

Do a search for: double stoVal[];
Insert this immediately underneath:
// TDesk code
string oldStoStatus[];//Prevents unchanged signals being sent to TDesk

Do a search for: ArrayResize(sellCashUpl, noOfPairs);
Insert this immediately underneath:
// TDesk code
ArrayResize(oldStoStatus, noOfPairs);

Do a search for: oldPrevCandleReadTime[cc] = 0;
Insert this immediately underneath:
// TDesk code
oldStoStatus[cc] = "";

Do a search for: ArrayFree(sellCashUpl);
Insert this immediately underneath:
// TDesk code
ArrayFree(oldStoStatus);

I have a horrible feeling that we are going to be reproducing this over the entire tribe. I am going to start checking.

:xm: :rocket:
Author:  c1borg [ Tue Jul 02, 2019 3:25 pm ]
Post subject:  Slopey Peaky Stochy Bob

SteveHopwood » Tue Jul 02, 2019 2:50 pm wrote:
I have a horrible feeling that we are going to be reproducing this over the entire tribe. I am going to start checking.

:xm: :rocket:
Might be a very stupid question but im good at them :lol: does this effect Desky?
Author:  SteveHopwood [ Tue Jul 02, 2019 3:56 pm ]
Post subject:  Slopey Peaky Stochy Bob

c1borg » Tue Jul 02, 2019 3:25 pm wrote:
SteveHopwood » Tue Jul 02, 2019 2:50 pm wrote:
I have a horrible feeling that we are going to be reproducing this over the entire tribe. I am going to start checking.

:xm: :rocket:
Might be a very stupid question but im good at them :lol: does this effect Desky?
Nope.

:xm: :rocket:
Author:  tomele [ Tue Jul 02, 2019 5:03 pm ]
Post subject:  Slopey Peaky Stochy Bob

SteveHopwood » 02 Jul 2019, 16:56 wrote:
c1borg » Tue Jul 02, 2019 3:25 pm wrote:
SteveHopwood » Tue Jul 02, 2019 2:50 pm wrote:
I have a horrible feeling that we are going to be reproducing this over the entire tribe. I am going to start checking.

:xm: :rocket:
Might be a very stupid question but im good at them :lol: does this effect Desky?
Nope.

:xm: :rocket:
It does not even affect TDesk. You can update your signals for TDesk as frequently as you want. TDesk reads them every 10 seconds. They are not working as a trigger forcing TDesk into any action when you update them without changing.
All times are UTC Page 1 of 2