Scan for flatbase breakout to the short side


Category:
0
0

Hi Pete, I would like to use your flatbase breakout scanner code to have the breakout be to the short side…

The link to the original flatbase breakout scan is here: https://www.hahn-tech.com/ans/flat-base-breakout-scans/

I would like it to have a line of code that allows me to input a percentage for a gap…And code that has the breakout candle be a wide range bar on the 3rd bar

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 11)
Asked on January 27, 2020 1:07 pm
495 views
0
Private answer

I can provide a solution which adds the short side breakout to the original code. However the rest of your request is beyond the scope of what I can provide for no charge in the Q&A forum.

Here is a version of the code which includes both the breakout long as well as the breakout short:

input spanOfBase = 25;
input maxPrctCorrection = 10;
input spanOfBreakoutHigh = 42;
input spanOfBreakoutLow = 42;
def flatBaseHigh = highest(high[1], spanOfBase);
def flatBaseLow = lowest(low[1], spanOfBase);
def percentMaxCorrection = AbsValue(100 * (flatBaseLow / flatBaseHigh - 1));
def withinPrctCorrectionLimits = percentMaxCorrection <= maxPrctCorrection;
def highShade = if withinPrctCorrectionLimits then flatBaseHigh else flatBaseLow;
def lowShade = if withinPrctCorrectionLimits then flatBaseLow else flatBaseHigh;
def flatBase = highShade > lowShade;
def highestHighForBreakout = Highest(high[1], spanOfBreakoutHigh);
def lowestLowForBreakout = Lowest(low[1], spanOfBreakoutLow);
def currentBreakoutHigh = high > highestHighForBreakout;
def currentBreakoutLow = low < lowestLowForBreakout;
# only one of these can be scanned for at one time. Use "#" comment marks to turn off
# the one you don't need
#plot flatBaseFormation = flatBase and currentBreakoutHigh == 0;
#plot breakoutSignal = currentBreakoutHigh and currentBreakoutHigh[1] == 0 and flatBase;
plot breakoutSignalShort = currentBreakoutLow and currentBreakoutLow[1] == 0 and flatBase;

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on January 27, 2020 2:47 pm
0
thank you Pete
( at January 28, 2020 5:34 am)