Comment on Code your Technical Analysis strategy

Nithin Kamath commented on 16 Sep 2013, 07:05 AM

Abir, Find bellow:

Strategy1:
Buy : When 5ema (close) crosses over 13ema (close) from below and in stochastics (8,3,4) %K>%D>20
EMA (CLOSE, 5) > EMA (CLOSE, 13) AND SOPK (8, 3, 4, EXPONENTIAL) > SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) > 20
Buy Exit: When %K<%D< 80
SOPK (8, 3, 4, EXPONENTIAL) < SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) < 80
Sell: When 5ema (close) crosses below 13ema (close) from above and in stochastics (8,3,4) %K<%D<80
EMA (CLOSE, 5) < EMA (CLOSE, 13) AND SOPK (8, 3, 4, EXPONENTIAL) < SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) < 80
Sell Exit: When %K>%D>20

SOPK (8, 3, 4, EXPONENTIAL) > SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) > 20
Strategy 2:

Buy: When stochastics (8,3,4) %K>%D>20 and price crosses above the high of last candle
SOPK (8, 3, 4, EXPONENTIAL) > SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) > 20 AND CLOSE > REF (HIGH, 1)
Buy exit: When price pierces upper bollinger band (20,2) and price crosses below the low of last candle after touching the higher bollinger brand

REF (CLOSE, 1) > REF (BBT (CLOSE, 20, 2, EXPONENTIAL), 1) AND CLOSE < REF (LOW, 1) – Here, it will only check if the price goes below the low of the candle immediately after the candle in which price crosses upper Bollinger band. Won’t be able to code the second half of the condition unless we know exactly how many candles after the prices should breach the low of the candle in which upper Bollinger band was breached.

Sell: When stochastics (8,3,4) %K<%D<80 and price crosses below the low of last candle

SOPK (8, 3, 4, EXPONENTIAL) < SOPD (8, 3, 4, EXPONENTIAL) AND SOPD (8, 3, 4, EXPONENTIAL) < 80 AND CLOSE < REF (LOW, 1)
Sell Exit: When price pierces lower bollinger band (20,2) and price crosses above the high of last candle after touching lower bollinger band
REF (CLOSE, 1) < REF (BBB (CLOSE, 20, 2, EXPONENTIAL), 1) AND CLOSE > REF (HIGH, 1) – Here, it will only check if the price goes above the high of the candle immediately after the candle in which price crosses lower Bollinger band. Won’t be able to code the second half of the condition unless we know exactly how many candles after the price should breach the high of the candle in which lower Bollinger band was breached.

View the full comment thread »