## Pairs: Pair Arrows Double

04/24/2011 1:41 pm Leave a comment

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);