Building Winning Trading Systems with Trade Station
close of 30 days ago for a short position. This additional requirement is a trend
filter. We only want to go long in an uptrend and short in a downtrend.
The Bollinger Bandit requires four tools: (1) Bollinger Bands, (2) a moving
average of closing prices, (3) a rate of change calculation, and (4) a counter.
This system is longer term in nature, so we will use 50 days in our calculations.
Bollinger Bandit Pseudocode
LiqDay is initially set to 50
upBand = Average(Close,50) + StdDev(Close,50) *1.25
dnBand = Average(Close,50) - StdDev(Close,50) *1.25
rocCalc = Close of today - Close of thirty days ago
Set liqLength to 50
If rocCalc is positive, a long position will be initiated when
today's market action >= upBand
If rocCalc is negative, a short position will be initiated when
today's market action <= dnBand
liqPoint = Average(Close, 50)
If liqPoint is above the upBand, we will liquidate a long position if
today's market action <= liqPoint
If liqPoint is below the dnBand, we will liquidate a short position
if today's market action >= liqPoint
If we are not stopped out today, then liqLength = liqLength - 1
If we are stopped out today, then reset liqLength to fifty
Bollinger Bandit Program
{Bollinger Bandit by George Pruitt—program uses Bollinger Bands and Rate of
change to determine entry points. A trailing stop that is proportional with
the amount of time a trade is on is used as the exit technique.}
Inputs: bollingerLengths(50),liqLength(50),rocCalcLength(30);
Vars: upBand(0),dnBand(0),liqDays(50),rocCalc(0);
upBand = BollingerBand(Close,bollingerLengths,1.25);
dnBand = BollingerBand(Close,bollingerLengths,-1.25);
rocCalc = Close - Close[rocCalcLength-1]; {remember to subtract 1}
if(MarketPosition <> 1 and rocCalc > 0) then Buy("BanditBuy")tomorrow upBand
stop;
if(MarketPosition <>-1 and rocCalc < 0) then SellShort("BanditSell") tomorrow
dnBand stop;
if(MarketPosition = 0) then liqDays = liqLength;
if(MarketPosition <> 0) then
begin
liqDays = liqDays - 1;
liqDays = MaxList(liqDays,10);
116 Building Winning Trading Systems with TradeStation
end;
if(MarketPosition = 1 and Average(Close,liqDays) < upBand) then
Sell("Long Liq") tomorrow Average(Close,liqDays) stop;
if(MarketPosition = -1 and Average(Close,liqDays) > dnBand) then
BuyToCover("Short Liq") tomorrow Average(Close,liqDays) stop;
The Bollinger Bandit program demonstrates how to:
• Invoke the Bollinger Band function. This function call is less than intuitive
and must be passed three parameters: (1) price series, (2) number
of elements in the sample used in the calculation for the standard deviation,
and (3) number of deviations above/below moving average. You
must use a negative sign in the last parameter to get the band to fall
under the moving average.
• Invoke the MaxList function. This function returns the largest value in
a list.
• Do a simple rate of change calculation.
• Create and manage a counter variable, liqLength.
Bollinger Bandit trading performance is summarized in Table 6.2.
A visual example of how this system enters and exits trades is shown in
Figure 6.2.
Bollinger Bandit Summary..forex sato
Overall trading performance was positive. You can see the similarities between
the Bollinger and Keltner-based systems. The same markets that made good
money in one system made good money in the other. These systems would not
work well together due to their high level of correlation. This system did
exceptionally well in the Japanese Yen and Natural Gas. Through further
investigation, we discovered that our trailing stop mechanism only marginally
increased profit and decreased draw down. Nonetheless, the concept probably
adds a higher comfort level when a trade is initiated. We know that our risk
should diminish the farther we get into a trade. This is due to the fact that a
shorter-term moving average follows closer to the actual market than a longerterm
average.forex sato Building Winning Trading Systems with TradeStation
Figure 6.2 Bollinger Bandit Trades forex sato
0 التعليقات:
Post a Comment