Professional Documents
Culture Documents
Ilja 2
Ilja 2
0
at https://mozilla.org/MPL/2.0/
// © IljaZ
//@version=5
indicator("SA2 Setup", overlay = true)
BigBarfactor = input.float(1)
CXfactor = input.float(1.8)
veryBigBarfactor = input.float(2)
hugeBigBarfactor = input.float(3)
//---Intrabar Strength
BarRange = high - low
IBS = (close - low) / BarRange * 100
isBL = close > open and IBS >= 50 or close == open and IBS > 50 or close < open and
IBS > 50
isBR = close < open and IBS <= 50 or close == open and IBS < 50 or close > open and
IBS < 50
//---Inside Bar
isInsidebar = high <= high[1] and low >= low[1]
//---Breakouts
// Use minimum number of rules to define a breakout:
// 1. A BO is when H (BL case) of a bar goes 1 tick above the
// H of the prior bar
// 2. The bar cannot be an outside bar
isBLBO = high > high[1] and low >= low[1]
isBRBO = low < low[1] and high <= high [1]
//CX bar
isBLCX = BLHHdist > (BLLLdist * CXfactor) and isBL and isBL[1] and isBLBO and not
isInsidebar[1] and not isOB
isBRCX = BRLLdist > (BRHHdist * CXfactor) and isBR and isBR[1] and isBRBO and not
isInsidebar[1] and not isOB
//BLsetup = isBigBar and isBL and isBLBO and BLIBS and not isInsidebar
//BRsetup = isBigBar and isBR and isBRBO and BRIBS and not isInsidebar
BOBLsetup = isBLBO and isBL and BLIBS and isBigBar and not isInsidebar
BOBRsetup = isBRBO and isBR and BRIBS and isBigBar and not isInsidebar
BLsetup = BOBLsetup and not BOBLsetup[1]
BRsetup = BOBRsetup and not BOBRsetup[1]
//MA line for profit taking x0.5 and x1 ABR from close
// FTBLsetup? color.green : na
// FTBLsetup? -> is checking if FTBLsetup is true
// if it is true, then do color.green
// if it is NOT true, then do na (nothing)