I agree -- if you use anything but the Close value, you can't visually backtest it. If she's been visually backtesting at all, she's using the Close.
Another issue is that if you only look at the Signal value at the Close of one candle and the Open of the next, you're going to MISS most signals. Very few Signal crosses of 80/20 are going to happen between the Close tick and the Open tick. (In fact if that's the way Steve's implemented it, I'm confused why it's getting any signals at all!)
I think it should be close-to-close. I'd be really surprised if that's not what she's actually doing. If I'm totally full of hot air, somebody please explain how this is supposed to work.
Gday: a D1 Stochastic OB/OS trading robot
- 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: Trigger Questions
You have a seriously deranged idea of 'fun'.gaheitman wrote:For fun, I was thinking of updating the stochastic indicator to project the next stochastic value (at open). It could then be used to visually backtest this system.
George
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.
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.
- 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
Yet another latest update in post 1 guys. TIG spotted a few more bloops in my code. The update is essential, but no harm in waiting a while in case there are more; Gday is not an M1 scalper, after all.
Hehe. Shelley is sound in the land of Nod whilst all this is going on. She is missing out on having to re-download every 30 seconds.

Hehe. Shelley is sound in the land of Nod whilst all this is going on. She is missing out on having to re-download every 30 seconds.
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.
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.
- 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
Ane yet another update in post 1.
TIG again guys. This one is staggering. When it emerged as a bug, I would have spent a fortnight tracking it down.
Nice one, G.

TIG again guys. This one is staggering. When it emerged as a bug, I would have spent a fortnight tracking it down.
Nice one, G.
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.
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.
- fxozgirl
- Trader
- Posts: 1176
- Joined: Wed Nov 16, 2011 9:16 am
- Location: Melbourne, Australia
Re: Gday: a D1 Stochastic OB/OS trading robot
Good morning, just popped in before getting ready for work (it's 6.30am) - not sure if anyone is around still...I won't respond to every single post overnight, as there's been a few, but let me try and explain the rules of this system (hopefully this will clear up a few things)...
dk blue stoch line MUST cross the light blue signal line up for a buy in the 0-20 zone
dk blue stoch line MUST cross the light blue signal line down for a sell in the 100-80 zone
enter trade:
enter trade on the opening of the next candle once confirmation of the stoch line and signal line has crossed either the 80 or 20 line
(the signals must be clearly below the 80 or above the 20 levels for me to consider it a valid trade setup)
That's it...
this is my thought process when I come to trade (daily time frame):
1. Are both the stoch line and the signal line in ob/os? Yes/No
if No, check again tomorrow
if Yes, go to 2.
2. Has there been a cross of the stoch & signal line in the ob/os zone? Yes/No
if No, check again tomorrow
if Yes, go to 3.
#1 & #2 are checked on the current/old candle just before close
3. Has both the stoch line and the signal line crossed back out into the neutral zone? Yes/No
if No, check again tomorrow
if Yes, take the trade
#3 is checked/actioned at the open of the new candle
1 & 2 can be done 10/15 mins prior to the close of the candle...I check the charts in preparation of the days close/new open, identify potential trades based on #1 & 2 above, then when the old candle closes and the new candle opens I check #3 and either take the trade or not.
I am not a coder so won't pretend to know or understand the technicalities involved with writing an ea to perform the above, but I sure do appreciate Steve and the input from others.
I actually didn't consider Steve would create a fully automatic version (lol should have known better), personally I am happy to just attach the ea to the charts so it's ready to trade at the open of the new candle once I have manually determined #1 & 2 are correct (and I am confident that #3 will be met as well)
Re: the open/close of candles all I know is what I visually see happen on the charts and it happens every day
Once the current candle closes and on the first tick of the new candle the stoch lines update and are confirmed.
This happened yesterday on both the chfjpy & gbpchf trades. On both charts just before the close the stoch's were in ob/os, as soon as the candle closed and the new candle opened the stochs both crossed the 80/20 levels back into neutral ground, thereby confirming the trade (if taken manually).
I have also seen many times, where price has retraced during the day, the stoch's have crossed, price has then turned back in the original direction, the stoch's subsequently uncross and the trade continues on in the desired direction. So if you did not monitor the trade during the day, you wouldn't even know there had been a cross by candle close, however on the other hand if you were monitoring the charts and did see the cross during the day, you may have been tempted to close the trade for a loss only to find that at candle close the stoch's are uncrossed and stochs have been reconfirmed in accordance with the trade.
That is why I never make any decision to open/close a trade until the open of the new candle each day.
It is just under 2 hrs until the close, if anyone is around at that time, please try to take a look (I attached my template in an earlier post if that helps)
I have taken a few screenshots of charts now to get a snap shot of the stoch positions and will take some screenshots later when I get home from work. Hopefully there is enough momentum in the market for me to get some good examples for you.
Sorry for the mammoth post, but hope it helps somewhat
dk blue stoch line MUST cross the light blue signal line up for a buy in the 0-20 zone
dk blue stoch line MUST cross the light blue signal line down for a sell in the 100-80 zone
enter trade:
enter trade on the opening of the next candle once confirmation of the stoch line and signal line has crossed either the 80 or 20 line
(the signals must be clearly below the 80 or above the 20 levels for me to consider it a valid trade setup)
That's it...
this is my thought process when I come to trade (daily time frame):
1. Are both the stoch line and the signal line in ob/os? Yes/No
if No, check again tomorrow
if Yes, go to 2.
2. Has there been a cross of the stoch & signal line in the ob/os zone? Yes/No
if No, check again tomorrow
if Yes, go to 3.
#1 & #2 are checked on the current/old candle just before close
3. Has both the stoch line and the signal line crossed back out into the neutral zone? Yes/No
if No, check again tomorrow
if Yes, take the trade
#3 is checked/actioned at the open of the new candle
1 & 2 can be done 10/15 mins prior to the close of the candle...I check the charts in preparation of the days close/new open, identify potential trades based on #1 & 2 above, then when the old candle closes and the new candle opens I check #3 and either take the trade or not.
I am not a coder so won't pretend to know or understand the technicalities involved with writing an ea to perform the above, but I sure do appreciate Steve and the input from others.
I actually didn't consider Steve would create a fully automatic version (lol should have known better), personally I am happy to just attach the ea to the charts so it's ready to trade at the open of the new candle once I have manually determined #1 & 2 are correct (and I am confident that #3 will be met as well)
Re: the open/close of candles all I know is what I visually see happen on the charts and it happens every day
Once the current candle closes and on the first tick of the new candle the stoch lines update and are confirmed.
This happened yesterday on both the chfjpy & gbpchf trades. On both charts just before the close the stoch's were in ob/os, as soon as the candle closed and the new candle opened the stochs both crossed the 80/20 levels back into neutral ground, thereby confirming the trade (if taken manually).
I have also seen many times, where price has retraced during the day, the stoch's have crossed, price has then turned back in the original direction, the stoch's subsequently uncross and the trade continues on in the desired direction. So if you did not monitor the trade during the day, you wouldn't even know there had been a cross by candle close, however on the other hand if you were monitoring the charts and did see the cross during the day, you may have been tempted to close the trade for a loss only to find that at candle close the stoch's are uncrossed and stochs have been reconfirmed in accordance with the trade.
That is why I never make any decision to open/close a trade until the open of the new candle each day.
It is just under 2 hrs until the close, if anyone is around at that time, please try to take a look (I attached my template in an earlier post if that helps)
I have taken a few screenshots of charts now to get a snap shot of the stoch positions and will take some screenshots later when I get home from work. Hopefully there is enough momentum in the market for me to get some good examples for you.
Sorry for the mammoth post, but hope it helps somewhat
- fxozgirl
- Trader
- Posts: 1176
- Joined: Wed Nov 16, 2011 9:16 am
- Location: Melbourne, Australia
Re: Gday: a D1 Stochastic OB/OS trading robot
In my experience of trading this method, everyday the stochs update on the close/open of the candle and move from ob/os into neutral in one tickgaryfritz wrote: Another issue is that if you only look at the Signal value at the Close of one candle and the Open of the next, you're going to MISS most signals. Very few Signal crosses of 80/20 are going to happen between the Close tick and the Open tick. (In fact if that's the way Steve's implemented it, I'm confused why it's getting any signals at all!)
(see my post above and I will try to post some screenshots later)
-
garyfritz
Re: Gday: a D1 Stochastic OB/OS trading robot
Hm. I haven't spent the time you have watching the charts right at the close, so I'm guessing a little. But based on my understanding of how Empty4 behaves -- which I think is very similar to other platforms I know much better -- I think this is happening:
* Only the last (right-most) candle changes. It updates with every tick.
* All older candles are static snapshots of how they looked at the CLOSE of that candle.
* Indicators update along with the bar. An indicator like Stoch only changes when the bar changes, so only the right-most Stoch value changes. I can see that happening on a daily chart now.
* When the first tick of a new candle arrives, Empty4 realizes it's a new candle. It shifts the old candles to the left, freezes the previously-rightmost candle (and its stoch value) at the state it was in when the "last tick in the candle" arrived, and starts displaying the new candle.
* The stoch indicator on first tick of the new candle reflects the value using the new tick's Close -- which, since it's the first tick, is also the new candle's Open. If that new tick is different than the last tick of the previous candle, the stoch value will be slightly different.
* The stoch value also changes slightly because when you add a new candle, you drop an old candle off the end of the stoch calculation. So that can cause it to change more than the equivalent tick-to-tick change inside a candle.
I just watched several M1 candles close, and they worked the way I expected. The same thing should happen at the close of a D1 candle.
So if you've done any visual backtesting, you were using the Close value of the stoch on that candle. That "frozen snapshot" of the Close value of the stoch indicator is all the chart displays. If you use any knowledge of the indicator values at any time other than the close, such as looking at the value right after a new candle starts, you can't replicate that with visual backtesting.
Using the value of the stoch at the CLOSE of yesterday's candle -- which should be very close to the open of the new day's candle -- would be visually backtestable. But I don't know how it will affect your results. You're acting when the new candle opens and the stoch Signal crosses the OB/OS level. If you don't act until the CLOSE of that new candle, you'll enter a day later. On the other hand you might avoid some false entries that way. We'd have to test it to see if it works as well as your method.
* Only the last (right-most) candle changes. It updates with every tick.
* All older candles are static snapshots of how they looked at the CLOSE of that candle.
* Indicators update along with the bar. An indicator like Stoch only changes when the bar changes, so only the right-most Stoch value changes. I can see that happening on a daily chart now.
* When the first tick of a new candle arrives, Empty4 realizes it's a new candle. It shifts the old candles to the left, freezes the previously-rightmost candle (and its stoch value) at the state it was in when the "last tick in the candle" arrived, and starts displaying the new candle.
* The stoch indicator on first tick of the new candle reflects the value using the new tick's Close -- which, since it's the first tick, is also the new candle's Open. If that new tick is different than the last tick of the previous candle, the stoch value will be slightly different.
* The stoch value also changes slightly because when you add a new candle, you drop an old candle off the end of the stoch calculation. So that can cause it to change more than the equivalent tick-to-tick change inside a candle.
I just watched several M1 candles close, and they worked the way I expected. The same thing should happen at the close of a D1 candle.
So if you've done any visual backtesting, you were using the Close value of the stoch on that candle. That "frozen snapshot" of the Close value of the stoch indicator is all the chart displays. If you use any knowledge of the indicator values at any time other than the close, such as looking at the value right after a new candle starts, you can't replicate that with visual backtesting.
Using the value of the stoch at the CLOSE of yesterday's candle -- which should be very close to the open of the new day's candle -- would be visually backtestable. But I don't know how it will affect your results. You're acting when the new candle opens and the stoch Signal crosses the OB/OS level. If you don't act until the CLOSE of that new candle, you'll enter a day later. On the other hand you might avoid some false entries that way. We'd have to test it to see if it works as well as your method.
- spyderman
- Trader
- Posts: 338
- Joined: Sun Dec 11, 2011 1:39 pm
Re: Gday: a D1 Stochastic OB/OS trading robot
Just watched closely at my new day candle and it was just as you described.garyfritz wrote: I just watched several M1 candles close, and they worked the way I expected. The same thing should happen at the close of a D1 candle.
Had several trades try and open but I didn't have my criminal set at true
I'll have to wait until tomorrow to play...
Snaggin' some pips
- 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
Just to confirm, at the close of yesterday's candle, both the main and signal lines are above OB line for a buy. Meaning the main line can't cross below until the day of the trade.fxozgirl wrote: 1. Are both the stoch line and the signal line in ob/os? Yes/No
if No, check again tomorrow
if Yes, go to 2.
Do they have to cross on the previous bar?fxozgirl wrote:2. Has there been a cross of the stoch & signal line in the ob/os zone? Yes/No
if No, check again tomorrow
if Yes, go to 3.
Again, do both have to cross the OB line at the beginning of the new day?3. Has both the stoch line and the signal line crossed back out into the neutral zone? Yes/No
if No, check again tomorrow
if Yes, take the trade
Coding what you are doing is not difficult, I think we are just concerned that you visual back-testing may be overstating the pip gain. If by "visual back-testing" you mean scrolling back in time and looking at the charts, then you are most likely overstating the gains and understating the losses. If your data comes from watching the trades each day and paper trading them, then your data should be completely valid.
That being said, if you did well enough trading live, our back-testing concerns may not matter.
George
-
ROBST3R
- Trader
- Posts: 86
- Joined: Fri Dec 16, 2011 7:33 pm
Re: Gday: a D1 Stochastic OB/OS trading robot
new day candle is in 1 hour?spyderman wrote:Just watched closely at my new day candle and it was just as you described.garyfritz wrote: I just watched several M1 candles close, and they worked the way I expected. The same thing should happen at the close of a D1 candle.
Had several trades try and open but I didn't have my criminal set at true![]()
I'll have to wait until tomorrow to play...