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

Gday Mark 2
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=917
Page 1 of 30
Author:  SteveHopwood [ Tue Oct 30, 2012 2:35 pm ]
Post subject:  Gday Mark 2

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.
    • Stochastic


Introduction
Go to http://www.stevehopwoodforex.com/phpBB3 ... ?f=5&t=168 to read about the early version of Gday, first posted in December 2011.

I lost interest in the EA and forgot about it until Shelley posted that she is still trading the method successfully, some 8 months or so after I coded Gday. I decided to do a revamp in light of developments in Shelley's method and improvements in my own coding.

Trading method
This remains essentially the same:
  • D1 timeframe.
  • buy when Stochastic has left over sold.
  • sell when Stochastic has left over bought.
Shelley's original pm to me last year stated:
  • buy when Stochastic was over sold at the close of the previous candle and out of over sold at the first tick of the new candle.
  • sell when Stochastic was over bought at the close of the previous candle and out of over bought at the first tick of the new candle.
The basic fallacy in the premise is obvious, and many trades are missed. In the period between my losing interest and having it reawakened, Shelley modified her method. She still trades as described earlier but has added a second option:
  • buy when Stoch was over sold at the close two candles ago, came out of over sold during the previous candle, and remained out of over sold at the open of the current candle. Vice-versa for a sell at the overbought level. Whether buy or sell, the trade still takes place at the first tick of the new candle.
Both the Stoch lines had to be in the ob/os region for it to be regarded as having been ob/os. Both lines have to be out of ob/os to allow the trade.

Stochastic is fully configurable via the inputs. The meaning of OverBought and OverSold is obvious. ShortTradeTrigger and its partner LongTradeTrigger allow you to experiment with different trade trigger levels. For example, you might want to show ob at 80, but not to trigger a sell until Stoch drops to 75; you would make ShortTradeTrigger = 75.


Trade exit
There are the usual take profit and stop loss inputs. The trade also closes if not at breakeven and Stoch Main crosses the Signal in the wrong direction.

Shelly has innovated dealing with winning trades:
  • Lot size must be divisible by 3.
  • close one third of the trade at +50 and move the stop to breakeven + 2.
  • close one third of the trade at +100 and jump the stop by 50.
  • keep going with a +50 jumping stop until the market retraces to hit the stop, or manual closure.
The default breakeven and jumping stop inputs facilitate Shelley's phased closure. EnablePartClosure turns on the one third at a time closure.

I have learned to trade small lot sizes, so a trade can go a long way against me without it causing bother. I am happy to leave a loser up and running so long as it is making positive swap. KeepOpenPositiveSwapLosers is the input that allows Gday to override the normal trade exit if the trade is losing but the swap is positive.

Conclusion
Gday Mark 2 is a robust implementation of an excellent trading strategy.I trade it on my live account.

Have fun.

:D

MrLong's multi-pair version
Andy has posted this at http://www.stevehopwoodforex.com/phpBB3 ... 126#p29126. Initially he posted it in this thread and I added it to this post, so there are a few posts from pages 11 - 13 that might appear confused. They were discussing Andy's multi-pair ea.


Read this post at http://www.stevehopwoodforex.com/phpBB3 ... 652#p28652 for the details.

Nice one Andy. Cheers.

:D

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:  jiaxingx [ Tue Oct 30, 2012 3:49 pm ]
Post subject:  Re: Gday Mark 2

that are good!
:D
Author:  Tebis [ Tue Oct 30, 2012 4:01 pm ]
Post subject:  Re: Gday Mark 2

Hi Steve,

your first Version of Gday is already a great EA. Thank you very much for the new Version !

Have a sucessfull week.

Cheers

Tebis
Author:  garyfritz [ Tue Oct 30, 2012 4:20 pm ]
Post subject:  Re: Gday Mark 2

I'm glad to see Shelley's EA getting another go!
SteveHopwood wrote:The basic fallacy in the premise is obvious, and many trades are missed. In the period between my losing interest and having it reawakened, Shelley modified her method. She still trades as described earlier but has added a second option:
  • buy when Stoch was over sold at the close two candles ago, came out of over sold during the previous candle, and remained out of over sold at the open of the current candle. Vice-versa for a sell. The trade still takes place at the first tick of the new candle.
Does this mean "oversold at the close two candles ago, came out of oversold AT THE CLOSE of the previous candle, and stayed out of oversold at the open of the current" ? I.e. does it have to be out of OS at the close of previous, or at any time during previous?

If I understand your LookForXXXSetup() code, I think it has to be out of oversold AT THE CLOSE of the previous, at least for Option2. That's good for me because it's easier in Tradestation.

But Steve, I think you've got an oops in LookForXXXSetup(). In Option2, it only returns true if the last TWO candles are oversold. Shouldn't your previous-candle check set status=false if v<=OverSold ?

BTW you currently have Option1 and Option2 both defaulting to True. The logic in the Option1/Option2 section seems a bit wonky. The way it's implemented, it says "(Option1:) If previous candle is OS at close, return true. (Option2:) Only if Option1 test returns false, if previous candle is OS and 2 candles ago is OS, return true." That doesn't seem right, especially since I think the Option2 test should be testing previous candle for NOT OS.

Do you ever want to use BOTH the Option1 and Option2 tests? They seem to be mutually exclusive.

How about something like this? (Assuming you'd use either Option1 or Option2 but not both)

Code: Select all

//Option2;////ob/os Close[2]: out of ob/os Close[1]: still out of ob/os Open[0];
else
{
   v = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MaMethod,PriceField,MODE_MAIN,1);
   if (v <= OverSold) status = false;
   
   v = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MaMethod,PriceField,MODE_SIGNAL,1);
   if (v <= OverSold) status = false;
...etc
(I can't color code to show the changes. I replaced the "if Option2" test with an "else," removed the now-unnecessary "status=true;", and changed the previous-candle tests to "<=".)
Both the Stoch lines had to be in the ob/os region for it to be regarded as having been ob/os. Both lines have to be out of ob/os to allow the trade.
Hrm. That leaves us with a fuzzy definition, with the two lines possibly straddling the OB/OS line. E.g. what happens if both lines go below OS, then the fast line goes above OS during previous but the slow line stays below? That doesn't allow a trade on this candle because both lines aren't out of OS in the previous, and it won't allow a trade on the next candle because you don't meet the "both lines below OS" condition for "two candles ago." If you're OK with missing trades in this case I guess it's OK, but I suspect it would work fine using only the slow line. I'll see if I can test that.

Other than those concerns, I like this definition. I'll see about updating my TS system so I can hopefully finally run an accurate backtest.
Author:  theforexedge [ Tue Oct 30, 2012 4:46 pm ]
Post subject:  Re: Gday Mark 2

Steve

Does this update fix the issue that Gday had with certian brokers? I know Shelly reported this on the orignal thread!

Thanks for recoding this..

Jason
Author:  musky [ Tue Oct 30, 2012 5:16 pm ]
Post subject:  Re: Gday Mark 2

Cant get this to take a single trade in 2012 works fine in 1974 lol .
Author:  cuzgeorge [ Tue Oct 30, 2012 5:41 pm ]
Post subject:  Re: Gday Mark 2

Hello,
lets see,
Thanks Steve and Shelley,
been waiting for this one.
cuz

EDIT - removed link to old demo
Author:  SteveHopwood [ Tue Oct 30, 2012 6:40 pm ]
Post subject:  Re: Gday Mark 2

V 1a is in post 1.

Nice spot, Gary. Thanks. I had indeed got the conditionals for candle shift 1 the wrong way around.
garyfritz wrote:I'm glad to see Shelley's EA getting another go!
SteveHopwood wrote:The basic fallacy in the premise is obvious, and many trades are missed. In the period between my losing interest and having it reawakened, Shelley modified her method. She still trades as described earlier but has added a second option:
  • buy when Stoch was over sold at the close two candles ago, came out of over sold during the previous candle, and remained out of over sold at the open of the current candle. Vice-versa for a sell. The trade still takes place at the first tick of the new candle.
Does this mean "oversold at the close two candles ago, came out of oversold AT THE CLOSE of the previous candle, and stayed out of oversold at the open of the current" ? I.e. does it have to be out of OS at the close of previous, or at any time during previous?

If I understand your LookForXXXSetup() code, I think it has to be out of oversold AT THE CLOSE of the previous, at least for Option2. That's good for me because it's easier in Tradestation.
It is the only way to do it without relying on the bot running all day and setting a variable that says, "Yes, Stoch has been out of ob/os today" and all the faffing around required to deal with a restart.

Empty4 indi's are fixed at the candle close at a single value. It might have screamed up and down like a demented yo-yo in a high-speed lift run by a manic lift driver on drugs, but that will not show. What you see historically is the close.

Besides, it doesn't matter when Stoch has left ob/os; it does have to close outside otherwise there is no setup.
BTW you currently have Option1 and Option2 both defaulting to True. The logic in the Option1/Option2 section seems a bit wonky. The way it's implemented, it says "(Option1:) If previous candle is OS at close, return true. (Option2:) Only if Option1 test returns false, if previous candle is OS and 2 candles ago is OS, return true." That doesn't seem right, especially since I think the Option2 test should be testing previous candle for NOT OS.
Nice spot. Thanks again.
Do you ever want to use BOTH the Option1 and Option2 tests? They seem to be mutually exclusive.
Yes. At least I do. Don't know about Shelley but these are the options she wanted.

Both the Stoch lines had to be in the ob/os region for it to be regarded as having been ob/os. Both lines have to be out of ob/os to allow the trade.

E.g. what happens if both lines go below OS, then the fast line goes above OS during previous but the slow line stays below? That doesn't allow a trade on this candle because both lines aren't out of OS in the previous, and it won't allow a trade on the next candle because you don't meet the "both lines below OS" condition for "two candles ago." If you're OK with missing trades in this case I guess it's OK, but I suspect it would work fine using only the slow line. I'll see if I can test that.
Yep, but it is what Shelley wanted.

:D
Author:  guilhermecarva [ Tue Oct 30, 2012 7:00 pm ]
Post subject:  Re: Gday Mark 2

it seems the attachment is not working
Author:  fxozgirl [ Tue Oct 30, 2012 7:46 pm ]
Post subject:  Re: Gday Mark 2

SteveHopwood wrote:V 1a is in post 1.

Nice spot, Gary. Thanks. I had indeed got the conditionals for candle shift 1 the wrong way around.

garyfritz wrote:Do you ever want to use BOTH the Option1 and Option2 tests? They seem to be mutually exclusive.
SteveHopwood wrote:Yes. At least I do. Don't know about Shelley but these are the options she wanted.
Yes, I use both options

garyfritz wrote:Both the Stoch lines had to be in the ob/os region for it to be regarded as having been ob/os. Both lines have to be out of ob/os to allow the trade.

E.g. what happens if both lines go below OS, then the fast line goes above OS during previous but the slow line stays below? That doesn't allow a trade on this candle because both lines aren't out of OS in the previous, and it won't allow a trade on the next candle because you don't meet the "both lines below OS" condition for "two candles ago." If you're OK with missing trades in this case I guess it's OK, but I suspect it would work fine using only the slow line. I'll see if I can test that.
SteveHopwood wrote:Yep, but it is what Shelley wanted.
I asked for that to prevent trades being taken when the signal line moves out of ob/os but the stoch lines stays in, as there are times when the move has not really started and price turns back and causes a bad trade. Not really sure how many trades would be missed due to this, but I suspect not too many.

Any feedback on this is welcome :D
All times are UTC Page 1 of 30