Gday: a D1 Stochastic OB/OS trading robot

Locked
User avatar
fxozgirl
Trader
Posts: 1176
Joined: Wed Nov 16, 2011 9:16 am
Location: Melbourne, Australia

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by fxozgirl »

peterke wrote:Yeah same for me but GMT+2 has its advantages. I read Steve's earlier post regarding the weather in the UK. I am working at a remote mine site in WA and as I type its 46 deg C. Bloody hell I must be mad!

Balmy 22 degrees here in Melbourne , perfect one day, cold wet hot, windy crap the next

rgds

Peter[/quote]


Aha...another Melbournian :D
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: Gday: a D1 Stochastic OB/OS trading robot

Post by SteveHopwood »

Latest update in post 1 (this includes those extra inputs from last night).

I have some pleasant trades open and the jumping stop function was not working. JS and BE have to be used together, 'cos JS will not kick in until the stop is at BE.

To counter misunderstanding, I have added code that enforces BE if JS is set. Try setting BE to false; on loadup, you will find BE magically enabled at the same level as JS.

Here we are in the run up to Christmas when the markets are so difficult that a lot of experienced traders shut down their platforms altogether, and we have a system that is making pips. Remarkable achievement, Shelley.

: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.
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: Gday: a D1 Stochastic OB/OS trading robot

Post by SteveHopwood »

garyfritz wrote:I threw together a Tradestation system to test Shelley's strategy, or something close to it.

I wanted to act on the close of the daily bar only, so it's easy to do visual backtesting. It even works almost as well if you only adjust stops (jumping, breakeven) at the end of the bar. Other than that I think I've implemented the same rules as Shelley's original strategy:

* Open 3 units, default to 200 pip SL
* Take off 1 unit at +50 pips and move stop to +2
* Take off 2nd unit at +100 pips
* Let 3rd unit ride with 50pip jumping stop: move stop to +50 when you hit +100, move stop to +100 when you hit +150, etc. (Right?)
* Exit if stochastic slowK crosses over/under slowD.

I've backtested it quite a bit. I'm finding it works great on some pairs and lousy on others. Different pairs do best with different SL sizes. I haven't played much with varying the TP size.

In general EUR and USD pairs do pretty well; AUD, CAD, and CHF pairs do so-so, GBP and NZD pairs do poorly. I would trade it with the "Good pairs" below, probably using 200 pip SL for all pairs. Trading those 9 pairs with SL=200 would have made 891+2322+2784+2680+857+1599+1631+880+2127 = 15771 pips in 2011. The equity curve is almost ruler-straight, but unfortunately that's cherry-picking the best pairs with hindsight. You'd almost certainly do worse than that trading forward.

BTW I'm not sure yet but I'm not certain the 3-lot model is necessary. It seems to work almost as well exiting the full position at a single TP -- at least almost as well as my simplified end-of-bar model. The 3-lot model might work better if you're doing realtime jumping stops &etc.

Gary


Good pairs:
AUDUSD: very good for SL = 300, OK for 250
CADCHF: very good for SL >= 150
EURAUD: good at any level, awsome at 150-200 or above
EURJPY: good at SL = 100, INCREDIBLE at >= 150
GBPUSD: Bad in 2010, good in 2011 for 200-250
NZDCHF: good in 2011 at 100-150, best at 200-250
NZDJPY: good in 2011 at SL > 100-150
USDCAD: good at any level, best 100-150
USDJPY: Great at SL 150-250

OK pairs:
AUDJPY: SL = 100 OK for last year
EURCAD: OK at SL = 150-200, great at >= 250
EURCHF: Good at 200 but several recent losses hurt it, great at 300
EURGBP: Great for last 6 months at SL >= 150, terrible before
EURNZD: Great until mid-2011 for SL 150-250, lots of losses since
GBPJPY: Great until early/mid 2011, then sideways
USDCHF: Great for SL 100-250 until mid-2011, then down

Not recommended:
AUDCAD: have to use 300 SL, then it's great for the last year
AUDCHF: SL = 50 is good for the past 6 months
AUDNZD: up & down, small SLs OK for the last few months
CHFJPY
EURUSD
GBPAUD: OK at SL=50, bad above
GBPCAD
GBPCHF
GBPNZD
NZDCAD
NZDUSD
Thanks for doing all this Gary. I have linked this post so that newcomers do not miss it.

: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.
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: Gday: a D1 Stochastic OB/OS trading robot

Post by SteveHopwood »

fxozgirl wrote:Once we know the ea is working as it should, I will ask Steve for permission to post it in my thread.
Anyone can post anything at FF that I develop here. There is no need to ask permission.

: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.
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: Gday: a D1 Stochastic OB/OS trading robot

Post by SteveHopwood »

gaheitman wrote:Steve,

I think JumpingStopLoss() still relies on it being at breakeven. The code still expect "sl" to have a valid value and makes sure its above the OrderOpenPrice().

This

Code: Select all

   if (OrderType()==OP_BUY)
   {
      if (sl < OrderOpenPrice() ) return;//Not at breakeven yet
      // Increment sl by sl + JumpingStopPips.
      // This will happen when market price >= (sl + JumpingStopPips)
      //if (Bid>= sl + ((JumpingStopPips*2)*Point) ) 
      if (Bid >= MathMax(sl, OrderOpenPrice() ) + ((JumpingStopPips * 2) * Point) )//George{
      {
         NewStop = NormalizeDouble(sl + (JumpingStopPips * Point), Digits);
         if (HiddenPips > 0) ObjectMove(LineName, 0, Time[0], NewStop);
         if (NewStop - OrderStopLoss() >= Point) modify = true;//George again. What a guy
         modify = true;   
      }// if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())      
   }//if (OrderType()==OP_BUY)
   
   if (OrderType()==OP_SELL)
   {
      if (sl > OrderOpenPrice() ) return;//Not at breakeven yet
      // Decrement sl by sl - JumpingStopPips.
      // This will happen when market price <= (sl - JumpingStopPips)
      //if (Bid<= sl - ((JumpingStopPips*2)*Point)) Original code
      if (Bid <= MathMin(sl, OrderOpenPrice() ) - ((JumpingStopPips * 2) * Point) )//George
      {
         NewStop = NormalizeDouble(sl - (JumpingStopPips * Point), Digits);
         if (HiddenPips > 0) ObjectMove(LineName, 0, Time[0], NewStop);
         if (OrderStopLoss() - NewStop >= Point || OrderStopLoss() == 0) modify = true;//George again. What a guy   
         modify = true;   
      }// close if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())         
   }//if (OrderType()==OP_SELL)
should be this

Code: Select all

   if (OrderType()==OP_BUY)
   {
      //if (sl < OrderOpenPrice() ) return;//Not at breakeven yet
      // Increment sl by sl + JumpingStopPips.
      // This will happen when market price >= (sl + JumpingStopPips)
      //if (Bid>= sl + ((JumpingStopPips*2)*Point) ) 
      sl = MathMax(sl, OrderOpenPrice());
      if (Bid >=  sl + ((JumpingStopPips * 2) * Point) )//George{
      {
         NewStop = NormalizeDouble(sl + (JumpingStopPips * Point), Digits);
         if (HiddenPips > 0) ObjectMove(LineName, 0, Time[0], NewStop);
         if (NewStop - OrderStopLoss() >= Point) modify = true;//George again. What a guy
         modify = true;   
      }// if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())      
   }//if (OrderType()==OP_BUY)
   
   if (OrderType()==OP_SELL)
   {
      //if (sl > OrderOpenPrice() ) return;//Not at breakeven yet
      // Decrement sl by sl - JumpingStopPips.
      // This will happen when market price <= (sl - JumpingStopPips)
      //if (Bid<= sl - ((JumpingStopPips*2)*Point)) Original code
      sl = MathMin(sl, OrderOpenPrice());
      if (sl == 0) sl = OrderOpenPrice();
      if (Bid <= sl - ((JumpingStopPips * 2) * Point) )//George
      {
         NewStop = NormalizeDouble(sl - (JumpingStopPips * Point), Digits);
         if (HiddenPips > 0) ObjectMove(LineName, 0, Time[0], NewStop);
         if (OrderStopLoss() - NewStop >= Point || OrderStopLoss() == 0) modify = true;//George again. What a guy   
         modify = true;   
      }// close if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())         
   }//if (OrderType()==OP_SELL)
I commented out the "if (sl < OrderOpenPrice() ) return;" line and reset "sl" to be the value we want to use later, including a second test for sells to make sure it isn't zero.

George
George, that is brilliant.

Guys, you might want to hang on before downloading the latest update. TIG's solution is better than mine, so I am just going to finish catching up on the posts and then will make the edits to the code.

: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.
User avatar
fxozgirl
Trader
Posts: 1176
Joined: Wed Nov 16, 2011 9:16 am
Location: Melbourne, Australia

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by fxozgirl »

fxozgirl wrote:
As for the pairs I put Gday on this morning

eurusd - Gday stayed out as signal line had not quite crossed out of ob/os
usdcad - Sell taken @ 1.02919, trade currently +29 pips
nzdusd - Gday did not trade (as above stoch & signal line had already crossed out of ob/os during yesterdays candle)
audusd - buy taken @ 1.00807, trade currently +77 pips (breakeven function currently disabled, but JS did not move at +50 pips
eurjpy - Gday stayed out as signal line had not quite crossed out of ob/os
audjpy - buy taken @ 78.481, trade currently + 59 pips (breakeven function currently disabled, but as for audusd JS was not moved at +50 pips
gbpaud - Gday stayed out as signal line had not quite crossed out of ob/os
cadjpy Buy taken @ 75.686, trade currently +9 pips
nzdjpy - same as nzdusd (in future when this type of trade sets up, I will use ChillWithShelley function

So far for today then, all trades taken are in profit (including the usdchf trade taken yesterday +77 pips)
all trades are currently up a combined 310 pips :D
Because the breakeven/jumping stop function are not working correctly for now, I removed Gday from these pairs and put mptm on

All of these trades are progressing nicely, currently...

usdcad - 1/3 part of trade closed +67 (this is higher due to the time I attached mptm)
2/3 part of trade closed +77
3rd part of trade still open, currently at +65
Equals 144 banked pips with more to come :D

audusd - 1/3 closed +113 (this is higher due to the time I attached mptm)
2/3 closed +127
3/3 still open, currently +98

audjpy - 1/3 closed +71 (this is higher due to the time I attached mptm)
2 & 3/3 still open, currently + 59

cadjpy - trade hasn't reached BE yet, currently +30

usdchf - 1/3 closed +99 (this is higher due to the time I attached mptm)
2 & 3/3 still open, currently +72

All trades are safe (except cadjpy) with 554 pips already banked and safe :D
User avatar
fxozgirl
Trader
Posts: 1176
Joined: Wed Nov 16, 2011 9:16 am
Location: Melbourne, Australia

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by fxozgirl »

SteveHopwood wrote:Latest update in post 1 (this includes those extra inputs from last night).

I have some pleasant trades open and the jumping stop function was not working. JS and BE have to be used together, 'cos JS will not kick in until the stop is at BE.

To counter misunderstanding, I have added code that enforces BE if JS is set. Try setting BE to false; on loadup, you will find BE magically enabled at the same level as JS.

Here we are in the run up to Christmas when the markets are so difficult that a lot of experienced traders shut down their platforms altogether, and we have a system that is making pips. Remarkable achievement, Shelley.

:D
I have not traded this system at this time of year before, and I must admit I didn't really think the market would have enough momentum for this system to be effective, but so far it is very effective :D
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by gaheitman »

fxozgirl wrote:Because the breakeven/jumping stop function are not working correctly for now, I removed Gday from these pairs and put mptm on

All of these trades are progressing nicely, currently...

usdcad - 1/3 part of trade closed +67 (this is higher due to the time I attached mptm)
2/3 part of trade closed +77
3rd part of trade still open, currently at +65
Equals 144 banked pips with more to come :D

audusd - 1/3 closed +113 (this is higher due to the time I attached mptm)
2/3 closed +127
3/3 still open, currently +98

audjpy - 1/3 closed +71 (this is higher due to the time I attached mptm)
2 & 3/3 still open, currently + 59

cadjpy - trade hasn't reached BE yet, currently +30

usdchf - 1/3 closed +99 (this is higher due to the time I attached mptm)
2 & 3/3 still open, currently +72

All trades are safe (except cadjpy) with 554 pips already banked and safe :D
That is certainly an encouraging start! :D
User avatar
fxozgirl
Trader
Posts: 1176
Joined: Wed Nov 16, 2011 9:16 am
Location: Melbourne, Australia

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by fxozgirl »

SteveHopwood wrote:
fxozgirl wrote:Once we know the ea is working as it should, I will ask Steve for permission to post it in my thread.
Anyone can post anything at FF that I develop here. There is no need to ask permission.

:D
Thank you Steve, I will wait until the ea has been tested for a while before I post there...I did not want to impinge on your rights :D
User avatar
fxozgirl
Trader
Posts: 1176
Joined: Wed Nov 16, 2011 9:16 am
Location: Melbourne, Australia

Re: Gday: a D1 Stochastic OB/OS trading robot

Post by fxozgirl »

SteveHopwood wrote:
garyfritz wrote:I threw together a Tradestation system to test Shelley's strategy, or something close to it.

I wanted to act on the close of the daily bar only, so it's easy to do visual backtesting. It even works almost as well if you only adjust stops (jumping, breakeven) at the end of the bar. Other than that I think I've implemented the same rules as Shelley's original strategy:

* Open 3 units, default to 200 pip SL
* Take off 1 unit at +50 pips and move stop to +2
* Take off 2nd unit at +100 pips
* Let 3rd unit ride with 50pip jumping stop: move stop to +50 when you hit +100, move stop to +100 when you hit +150, etc. (Right?)
* Exit if stochastic slowK crosses over/under slowD.

I've backtested it quite a bit. I'm finding it works great on some pairs and lousy on others. Different pairs do best with different SL sizes. I haven't played much with varying the TP size.

In general EUR and USD pairs do pretty well; AUD, CAD, and CHF pairs do so-so, GBP and NZD pairs do poorly. I would trade it with the "Good pairs" below, probably using 200 pip SL for all pairs. Trading those 9 pairs with SL=200 would have made 891+2322+2784+2680+857+1599+1631+880+2127 = 15771 pips in 2011. The equity curve is almost ruler-straight, but unfortunately that's cherry-picking the best pairs with hindsight. You'd almost certainly do worse than that trading forward.

BTW I'm not sure yet but I'm not certain the 3-lot model is necessary. It seems to work almost as well exiting the full position at a single TP -- at least almost as well as my simplified end-of-bar model. The 3-lot model might work better if you're doing realtime jumping stops &etc.

Gary


Good pairs:
AUDUSD: very good for SL = 300, OK for 250
CADCHF: very good for SL >= 150
EURAUD: good at any level, awsome at 150-200 or above
EURJPY: good at SL = 100, INCREDIBLE at >= 150
GBPUSD: Bad in 2010, good in 2011 for 200-250
NZDCHF: good in 2011 at 100-150, best at 200-250
NZDJPY: good in 2011 at SL > 100-150
USDCAD: good at any level, best 100-150
USDJPY: Great at SL 150-250

OK pairs:
AUDJPY: SL = 100 OK for last year
EURCAD: OK at SL = 150-200, great at >= 250
EURCHF: Good at 200 but several recent losses hurt it, great at 300
EURGBP: Great for last 6 months at SL >= 150, terrible before
EURNZD: Great until mid-2011 for SL 150-250, lots of losses since
GBPJPY: Great until early/mid 2011, then sideways
USDCHF: Great for SL 100-250 until mid-2011, then down

Not recommended:
AUDCAD: have to use 300 SL, then it's great for the last year
AUDCHF: SL = 50 is good for the past 6 months
AUDNZD: up & down, small SLs OK for the last few months
CHFJPY
EURUSD
GBPAUD: OK at SL=50, bad above
GBPCAD
GBPCHF
GBPNZD
NZDCAD
NZDUSD
Thanks for doing all this Gary. I have linked this post so that newcomers do not miss it.

:D
I agree, this is valuable research and information to be utilised :)
Locked

Return to “Automated trading systems”