PureBytes Links
Trading Reference Links
|
> If C[1] > C[2] then
> buy {today} at H[1] {yesterday} + (C[1]/100) stop;
Careful. You can't buy "today" (on the current bar) with a stop.
Not with TS, anyway, I don't know how WLD2 handles it. :-)
If you're using daily bars, then that comment in your code should
read "buy {tomorrow} at H[1] {yesterday} ... "
System code in TS executes at the **CLOSE** of the bar. At the close
it is TOO LATE to buy on a stop in the current bar. All you can do
is issue an order to buy or sell at the CLOSING PRICE of the current
bar, or the OPEN of the next bar, or at a stop price in the next bar.
> Of course it will not execute on the H[0] bar, because H[0] +
> (C[1]/100) is always equal to H[0], if it ever gets there.
H[0] + (C[1]/100) = H[0] ?? You lost me there. If I remember my 3rd
grade math correctly, X + Y = X only if Y = 0, and C[1]/100 should
not be 0 for almost any tradeable commodity.
Gary
|