Technet Trading’s TradingView Strategy

Source code for Technet Trading’s TradingView strategy below:

// This source code is subject to the terms of the Mozilla Public License 2.0 at
// ©TechnetTrading
// @version=4

study("Technet Caffeine Trading Strategy", overlay=true)

// exponential moving average conditions
ema15 = (high < ema(low, 15))

// directional movement conditions
len = input(15, minval=1, title="DI Length")
lensig = input(15, title="ADX Smoothing", minval=1, maxval=50)
[diplus, diminus, adx] = dmi(len, lensig)

// volume and MA conditions
smavwap = sma(vwap,15)
cons = smavwap/vwap

// and close<vwap for buy condition
bgcolor((ema15 and 2*diplus<diminus and adx>20 and cons>1.1 and (open>close or open[1]>close[1]))? #00FF00: #FF0000)