Pairs: Pair Arrows Double

input Mean_Dist_Pos = .7;
input Mean_Dist_Neg = -.7;
input SMA_len = 10;
input R = 40;

def price = ((open(getSymbolPart(1)) + close(getSymbolPart(1))) / 2) - ((open(getSymbolPart(2)) + close(getSymbolPart(2))) / 2);
def SMAOC = Average(price, SMA_len);
def DistFromSMAOCave = price - SMAOC;

plot ArrowDn = Mean_Dist_Pos < DistFromSMAOCave and correlation(close(getSymbolPart(1)), close(getSymbolPart(2)),R) > Mean_Dist_Pos;

plot ArrowUp = Mean_Dist_Neg > DistFromSMAOCave and correlation(close(getSymbolPart(1)), close(getSymbolPart(2)),R) > Mean_Dist_Pos;

#  and correlation(((open(getSymbolPart(1)) + close(getSymbolPart(1))) / 2) , ((open(getSymbolPart(2)) + close(getSymbolPart(2))) / 2)) > Mean_Dist_Pos;

ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: