Shelley, MiTija has pointed out that I may have misunderstood the way Gday is supposed to work.
Tradestation systems run on the close of the bar. I've been using the stoch of the **CLOSE** of the daily bar, and looking to see if that's crossed 80 or 20. So e.g. I look to see if the stoch at yesterday's close was > 80 and the stoch at today's close is < 80. I figured looking at the close-to-close change in stoch was going to be nearly identical to the open-to-open change in stoch.
MiTija says no, you're looking and the stoch of the OPEN of a daily bar, and comparing to the stoch at the CLOSE of yesterday's bar. So if stoch-at-yesterday's-CLOSE is > 80 and stoch-at-today's-OPEN is < 80, THEN you enter. When he explain this to me, I vaguely remembered you mentioning it waaayy back when you first presented Gday.
Is that right? Or do you look at the OPEN of yesterday vs. the OPEN of today?
If I understand Steve's code right, he acts on the first tick of a new D1 bar. On that first tick he calls:
Code: Select all
StochMain = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,0);
StochSignal = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_SIGNAL,0);
PrevStochMain = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_MAIN,shift);
PrevStochSignal = iStochastic(NULL, StochTimeFrame,K_Period,D_Period,Slowing,MODE_SMA,0,MODE_SIGNAL,shift);
So presumably StochSignal gets the stoch of the OPEN of the current bar, and PrevStochSignal gets the stoch as of the CLOSE of the PREVIOUS bar. Then if PrevStochSignal >= 80 and StochSignal < 80, he enters a trade.
I'm not even quite sure what it
means to calculate the stoch at the open. For clarity let's pretend we're actually using a 3-day stoch. If I calculate the stoch at the close, then that means I look at today's close compared to the High of (today, yesterday, & the day before) and the Low of (today, yesterday, & the day before). Stochastic = 100 * (Close - H(t,y,&tdb)) / (H(t,y,&tdb) - L(t,y,&tdb)).
So what does "stoch of the open" mean? At the open, the High of today and the Low of today are the same -- it's the open price. So is the "High of t,y,&tdb" actually "the max of this bar's open and the Highs of the two previous bars" ?
You may not know the internal workings of Empty4's Stochastic function -- you may just use it.

But I need to figure out what it's doing if I'm going to test it in TS. If anybody can clarify, I'd appreciate -- else I'll have to delve into Empty4's internal workings and I'd
really rather not...