Specifiche
i want devloper to create indicator i have the script from https://usethinkscript.com/ i want to be create in mt4
# DESCRIPTION # This study plots H1, H2, etc. and L1, L2, etc. labels above or below # those signal bars based on Al Brooks' description of the setups. # DECLARATIONS declare upper; # USER INPUTS input resetCountOnDTorDB = yes; input barsBack = 10; # DEFINITIONS AND CALCULATIONS ## Variable List def isFlatTopSBEligible; def isBullSB; def lastBullSBLow; def isHBar; def lastHBarLow; def isPushUp; def lastPushUp; def resetHCount; def isHCountStillReset; def hCount; def isFlatBottomSBEligible; def isBearSB; def lastBearSBHigh; def isLBar; def lastLBarHigh; def isPushDown; def lastPushDown; def resetLCount; def isLCountStillReset; def lCount; ## Standard variable calculations ### H Counting isFlatTopSBEligible = fold hFold = 1 to barsBack with dt = Double.NaN while IsNaN(dt) do if GetValue(high, hFold) == high then Double.NaN else if GetValue(high, hFold) > high then yes else no; isBullSB = (high[1] > high and high[-1] > high) #Standard bull SB or (isFlatTopSBEligible and high[-1] > high); #DT to the left lastBullSBLow = if isBullSB then low else lastBullSBLow[1]; isHBar = (low < lastBullSBLow[1] and isBullSB) or (isBullSB and isHCountStillReset); lastHBarLow = CompoundValue(1, if isHBar then low else lastHBarLow[1], low); isPushUp = if isHBar then yes else if isPushUp[1] and high >= high[1] then yes else no; lastPushUp = if isPushUp[1] and !isPushUp then high[1] else if high > lastPushUp[1] then high else lastPushUp[1]; resetHCount = high > lastPushUp[1] or ( resetCountOnDTorDB and high == lastPushUp[1] ); isHCountStillReset = if !isBullSB and resetHCount then yes else isHCountStillReset[1]; hCount = CompoundValue(1, if isHBar and !resetHCount then hCount[1] + 1 else if resetHCount then 0 else hCount[1] , 0); ### L Counting isFlatBottomSBEligible = fold lFold = 1 to barsBack with db = Double.NaN while IsNaN(db) do if GetValue(low, lFold) == low then Double.NaN else if GetValue(low, lFold) < low then yes else no; isBearSB = (low[1] < low and low[-1] < low) #Standard bear SB or (isFlatBottomSBEligible and low[-1] < low); #Db to the left lastBearSBHigh = if isBearSB then high else lastBearSBHigh[1]; isLBar = (high > lastBearSBHigh[1] and isBearSB) or (isBearSB and isLCountStillReset); lastLBarHigh = CompoundValue(1, if isLBar then high else lastLBarHigh[1], high); isPushDown = if isLBar then yes else if isPushDown[1] and low <= low[1] then yes else no; lastPushDown = if isPushDown[1] and !isPushDown then low[1] else if low < lastPushDown[1] then low else lastPushDown[1]; resetLCount = low < lastPushDown[1] or ( resetCountOnDTorDB and low == lastPushDown[1] ); isLCountStillReset = if !isBearSB and resetLCount then yes else isLCountStillReset[1]; lCount = CompoundValue(1, if isLBar and !resetLCount then lCount[1] + 1 else if resetLCount then 0 else lCount[1] , 0); # Calculate the day's opening price def openPrice = if GetDay() != GetDay()[1] then open else openPrice[1]; # PLOTS plot hSetup = if hCount <> hCount[1] and hCount <> 0 and close > openPrice then hCount else Double.NaN; plot lSetup = if lCount <> lCount[1] and lCount <> 0 and close < openPrice then lCount else Double.NaN; # GLOBAL COLOR DEFINITIONS DefineGlobalColor("Blue" , CreateColor(33, 150, 243)); DefineGlobalColor("Green", CreateColor(0, 155, 0)); DefineGlobalColor("Red", CreateColor(225, 105, 105)); DefineGlobalColor("Gray", CreateColor(181, 181, 181)); DefineGlobalColor("White", CreateColor(255, 255, 255)); # FORMATTING hSetup.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); hSetup.SetDefaultColor(GlobalColor("Green")); hSetup.SetLineWeight(2); hSetup.HideBubble(); lSetup.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE); lSetup.SetDefaultColor(GlobalColor("Red")); lSetup.SetLineWeight(2); lSetup.HideBubble();