Script
Script
#####################
//@version=3
strategy(title="Moving Average Convergence/Divergence Histogram/Area",
shorttitle="TEMA Strat", overlay=true)
intv = 7
tema = (3 * ema(close, intv)) - (3 * ema(ema(close, intv), intv)) +
(ema(ema(ema(close, intv), intv), intv))
tema2 = tema[1]
tema3 = tema[2]
tema4 = tema[3]
slope = (tema2-tema3)/(tema3-tema4)
plot(tema)
//plot(tema2)
buy() => crossover(close[1], tema2) and crossunder(close[2], tema3) and (close[1] >
open[1])
sell() => crossunder(close[1], tema2) and crossover(close[2], tema3) and (close[1]
< open[1])
//stop_level = strategy.position_avg_price * 0.998
//buy = close[1] > tema2 and close[2] < tema3
//sell = close[1] < tema2 and close[2] > tema3 and slope <= 1
strategy.entry(id = "long_tema", long = true, when = buy())
strategy.close(id = "long_tema", when = sell())
//strategy.order("Stop Loss", false, stop=stop_level, oca_name='L',
oca_type=strategy.oca.cancel, when=buy() and strategy.position_size > 0)
//plot(stop_level, color=red, style=linebr, linewidth=2)
//plotshape(buy, color=lime, style=shape.arrowup, text="Buy",
location=location.belowbar)
//plotshape(sell, color=red, style=shape.arrowdown, text="Sell",
location=location.abovebar)
#########################
// Simple, non-intrusive price action indicator by Zeenobit
// Based on "CM_Price-Action-Bars-Price Patterns That Work!" indicator by
ChrisMoody (Chris Capre from 2nd Skies Forex)
// The main difference is that this script uses shapes instead of bar colors.
//@version=3
study("Price Action", overlay=true)
cp = pinBarTolerance * 0.01
cpo = 1 - cp
cs = shavedBarTolerance * 0.01
isPinBarUp() => enablePinBars and open > high - (range * cpo) and close >
high - (range * cpo) and low <= lowest (pinBarLength)
isPinBarDown() => enablePinBars and open < high - (range * cp ) and close <
high - (range * cp ) and high >= highest(pinBarLength)
isShavedBarUp() => enableShavedBars and close >= (high - (range * cs))
isShavedBarDown() => enableShavedBars and close <= (low + (range * cs))