3 day pull back and a user defined candle


Category:
0
0

I am trying to scan for strongly trending stock (probably use ADX for this) with a 3 day pull back with lower highs and lower lows. 
If the last candle is my user defined Hammer I would like to plot an arrow under the candle.

 My definition of this candle is more classic than TOS and is defined as:  Body of candle is 1/3 or less of full candle range. 
 Body is in the top 1/3 of candle range.  

I would like for full candle range to be a long candle( maybe use ATR?) 

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on May 19, 2020 10:18 pm
165 views
0
Private answer

In the time permitted for free solutions in the Q&A forum I was able to reconfigure you code so that it can be used to display an arrow on the candles where this pattern is present. Nothing more.

def signal1 = close is less than close from 1 bars ago ;
def signal2 = close is less than open from 1 bars ago;
def signal3 = close [1] is less than close [2];
def signal4 = close [1] is less than open [2];
def signal5 = low is less than low [1];
def signal6 = low[1] is less than low [2];
def signal7 = high < high[1] and high[1] < high[2]; def signal8 = open >= 0.90 * high; # true for every bar
def signal9 = close <= 1.10 * low ; # true for every bar def signal10 = open[1] >= 0.90 * high[1]; # true for every bar
def signal11 = close[1] <= 1.10 * low[1]; # true for every bar def signal12 = open[2] >= 0.90 * high[2]; # true for every bar
def signal13 = close [2] <= 1.10* low[2]; # true for every bar
def signal14 = BodyHeight()<= (high-low)*0.333; def signal15 = (high-low) >= 3 * absValue (open-close);
plot pattern = signal1 and signal2 and signal3 and signal4 and signal5 and signal6 and signal7 and signal8 and signal9 and signal10 and signal11 and signal12 and signal13 and signal14 and signal15;
pattern.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
pattern.SetDefaultColor(Color.CYAN);

Until you learn how to code I suggest you avoid anything more complex than a couple of lines of code, or pay a developer to build these for you.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 20, 2020 7:29 am