Sunday, October 16, 2016

Below is a set of scripts that incorporates a STOP using average true range once a High Close Doji (HCD) and Low Close Doji (LCD) has been identified.

HCD and LCD are used by John Person and it can be useful for identifying a high probability success trade. By incorporating a stop (e.g., Risk Management) using the average true range one can objectively identify a stop by incorporating some elements of dynamics (e.g. volatility).




HCD with Avg True Range Stop

Direct sharing link: http://tos.mx/K7Phbf
Code:

def isdoji =Doji() from 1 bars ago;
def highclose= high from 1 bars ago is less than close;
plot HCD= isdoji and highclose;

HCD.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
     HCD.SetDefaultColor(Color.CYAN);
#alert(HCD,"HCD", alert.bar, sound = Sound.Ring);
HCD.SetLineWeight(5);

AddChartBubble(isdoji and highclose,high,"HCD", color = Color.GREEN);

input length = 10;
input displace = 0;

def Range = TrueRange(High, Close, Low);


def RangeAvg = Average(Range[-displace], length);

def Rangestop = Low - RangeAvg;

plot avgtruerangestop = if HCD then Rangestop else 0;

Avgtruerangestop.SetPaintingStrategy(PaintingStrategy.SQUARES);
     avgtruerangestop.SetDefaultColor(Color.CYAN);
avgtruerangestop.SetLineWeight(5);



LCD with Avg True Range Stop


Direct share link: http://tos.mx/5DrZG3
Code:
#Doji() from 1 bars ago and low from 1 bars ago is greater than close 
def isdoji = Doji() from 1 bars ago;
def Lowclose = low from 1 bars ago is greater than close ;
plot LCD = isdoji and Lowclose;

LCD.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
LCD.SetDefaultColor(Color.YELLOW);
#alert(LCD,"LCD", alert.bar, sound = Sound.Ring);
AddChartBubble(isdoji and lowclose,low,"LCD");
LCD.SetLineWeight(5);


input length = 10;
input displace = 0;

def Range = TrueRange(High, Close, Low);


def RangeAvg = Average(Range[-displace], length);

def Rangestop = High + RangeAvg;

plot avgtruerangestop = if LCD then Rangestop else 0;

Avgtruerangestop.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
     avgtruerangestop.SetDefaultColor(Color.GREEN);
 avgtruerangestop.SetLineWeight(5);


0 comments: