I uploaded the 2 images to my OneDrive, and it generated the links I sent you.
I have to call it a day today. Much pain and need rest. Have at this and see what you can do with my heartfelt thanks. Will check in tomorrow.
Here is my code for the base pattern Long and Short. It does NOT include the feature of determining the highest and lowest bars engulfed and going back only that far in measuring the strength of the pattern or Thrust Factor. Bars behind those that include only the highest and lowest prices engulfed should NOT be counted as inside the range of said high and low.
declare lower;
input BarsEngulfed = 3;
# Number of bars engulfed as a MINIMUM 3/1 ratio. To find more trades, simply take this pattern and apply it to numerous timeframes at once to find these pattern requirements and minimum ratio much more often than in looking on single timeframes. Ideally it would not depend upon bars but TIME proper in whatever frame it takes place, as long as the trade is big enough to be worthwhile.
# These patterns take place more on shorter timeframes where the players work their magic within the longer term charts and trends more indicative of supply and demand and news. That's why they're the SMART money. All we do is seek to find their indicative markers and harness these timeless patterns to ride their coattails to riches. I pay no mind to news or fundamentals or the Fed's latest sneeze, as the market knows them all before we do and has them already for the most part baked into the cake.
def CondVol = if volume >= volume[1] * 1.618034 then 1 else 0;
# Trigger bar must take place on a significant increase in volume vs the previous bar to ensure "smart money" participation
### BEGIN LONG PATTERN ###
def MinPatternPointsLong = ExpAverage(Max(Max(high - low, high - close[1]), close[1] - low), 987);
def ALong = Lowest(low, BarsEngulfed)[1];
def BLong = Highest(high, BarsEngulfed)[1];
def CLong = low;
def DLong = BLong;
def Cond1Long = if open < BLong then 1 else 0;
# Open must be lower than the highest price of the previous <BarsEngulfed> bars
def Cond2Long = if low < ALong then 1 else 0;
# Low must be lower than the lowest price of the previous <BarsEngulfed> bars
def Cond3Long = if high > BLong then 1 else 0;
# High must be greater than or equal to the highest price of the previous <BarsEngulfed> bars (this is the trigger point)
def Cond4Long = if close > open then 1 else 0;
# Close must be higher than the lowest price of the previous <BarsEngulfed> bars
def Cond5Long = if low >= ALong - (BLong - ALong) then 1 else 0;
# Low must be no lower than the first valley at ALong minus the difference between the highest price of the previous <BarsEngulfed> bars and the lowest price of the previous <BarsEngulfed> bars
def Cond6Long = if BLong - ALong >= MinPatternPointsLong then 1 else 0;
plot LongPattern = if Cond1Long + Cond2Long + Cond3Long + Cond4Long + Cond5Long + Cond6Long + CondVol == 7 then 1 else 0;
# If all conditions are satisfied at once, alert me to a possible trade.
LongPattern.SetDefaultColor(CreateColor(0, 255, 0));
### END OF LONG PATTERN ###
#***********************************************************
### BEGIN SHORT PATTERN ###
def MinPatternPointsShort = ExpAverage(Max(Max(high - low, high - close[1]), close[1] - low), 987);
def AShort = Highest(high, BarsEngulfed)[1];
def BShort = Lowest(low, BarsEngulfed)[1];
def CShort = high;
def DShort = BShort;
def Cond1Short = if open > BShort then 1 else 0;
# Open must be higher than the lowest price of the previous <BarsEngulfed> bars
def Cond2Short = if high > AShort then 1 else 0;
# High must be higher than the highest price of the previous <BarsEngulfed> bars
def Cond3Short = if low < BShort then 1 else 0;
# Low must be less than or equal to the lowest price of the previous <BarsEngulfed> bars (this is the trigger point)
def Cond4Short = if close < open then 1 else 0;
# Close must be lower than the highest prices of the previous <BarsEngulfed> bars
def Cond5Short = if high <= AShort + (AShort – BShort) then 1 else 0;
# High must be no higher than the first peak at AShort plus the difference between the highest price of the previous <BarsEngulfed> bars minus the lowest price of the previous <BarsEngulfed> bars
def Cond6Short = if AShort - BShort >= MinPatternPointsLong then 1 else 0;
plot ShortPattern = if Cond1Short + Cond2Short + Cond3Short + Cond4Short + Cond5Short + Cond6Short + CondVol == 7 then -1 else 0;
ShortPattern.SetDefaultColor(CreateColor(255, 0, 0));
# If all conditions are satisfied at once, plot a -1 and sound/email alert me to a possible trade.
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(CreateColor(0, 255, 0));