PureBytes Links
Trading Reference Links
|
At 1:52 PM -0800 12/7/01, Tom wrote:
>If gold closes<3 days ago and open of tomorrow < prior
>close, then buy bonds if month is January and Trading
>Day of the Month is 7,12,18,and 22. I want to exit my
>position on the first profitable opening.
Assuming you are using daily bars, something like the following
should be close (not tested):
Vars: Mo(0), TradeDay(0);
Mo = Month(Date);
TradeDay = iff(Mo <> Mo[1], 1, TradeDay + 1);
if Close < Close[3] and Open of tomorrow < Close and Mo = 1 and
(TradeDay = 7 or TradeDay = 12 or TradeDay = 18 or TradeDay = 22)
then Buy next bar at market;
if MarketPosition = 1 and Open tomorrow > EntryPrice
then ExitLong next bar at market;
Bob Fulks
|