[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another Idea



PureBytes Links

Trading Reference Links

In going through past issues of TASC, I saw an idea by Jon Andersen that
made a lot of sense ("Standard Error Bands", Sept. 1996, "Techincal
Analysis of Stocks and Commodities"). I've adapted it to my own trading
style and thought I'd post it.
------------------------------------------------------
{User Fucntion: Setup}
Inputs: R(Numeric);
Vars: AvgRng(0),Diff(0),Upper(0),Lower(0);

AvgRng=XAverage(TrueRange,R);
Upper=BollingerBand(Close,R,2);
Lower=BollingerBand(Close,R,-2);
Diff=Upper-Lower;
If Diff<>0 then Setup=AvgRng/Diff else Setup=Setup[1];

--------------------------------------------------------
{System: Setup MACD}
Inputs: Price(C),R(12),S(26),Q(9),StupLn(21),Lvl(.3);
Vars: Mo(0),Sig(0);

Mo=MACD(Price,R,S);
Sig=XAverage(MACD(Price,R,S),Q);
Condition1=Mo crosses above Sig;
Condition2=Mo crosses below Sig;
Condition3=Setup>Lvl;

If Condition1 and Condition3 then buy on close;
If Condition2 then exitlong on close;
If Condition2 and Condition3 then sell on close;
If Condition1 then exitshort on close;