InvestorsHub Logo
Followers 11
Posts 2531
Boards Moderated 1
Alias Born 04/03/2009

Re: None

Wednesday, 10/15/2014 8:56:10 PM

Wednesday, October 15, 2014 8:56:10 PM

Post# of 3640
Last one ...

No date on this. It's the last one I still have from you. Other's may be here on the board.

input MainPrice = close;
input TriggerLineSmoothing = 1;
def price = Average(MainPrice, TriggerLineSmoothing);
input MaLengthOfHighAndLow = 50;
def Length = MaLengthOfHighAndLow;
# DON'T USE NEGATIVE NUMBERS FOR BACK PERIODS, IT PRODUCES UNREAL RESULTS.
input BackPeriodsOfHighAndLow = 0;
def BackPeriods = BackPeriodsOfHighAndLow;
input AverageTypeOfHighAndLow = {default Simple, Exponential, Hull, Weighted, Variable, Wilders};
###############################################################
plot AvgHigh;
AvgHigh.SetDefaultColor(GetColor(3));
AvgHigh.HideBubble();
plot AvgLow;
AvgLow.SetDefaultColor(GetColor(3));
AvgLow.HideBubble();
###############################################################
switch (AverageTypeOfHighAndLow) {

case Simple:
AvgHigh = Average(high, Length)[BackPeriods];
AvgLow = Average(low, Length)[BackPeriods];

case Exponential:
AvgHigh = ExpAverage(high, Length)[BackPeriods];
AvgLow = ExpAverage(low, Length)[BackPeriods];

case Hull:
AvgHigh = HullMovingAvg(high, Length)[BackPeriods];
AvgLow = HullMovingAvg(low, Length)[BackPeriods];

case Weighted:
AvgHigh = WMA(high, Length)[BackPeriods];
AvgLow = WMA(low, Length)[BackPeriods];

case Variable:
AvgHigh = VariableMA(high, Length)[BackPeriods];
AvgLow = VariableMA(low, Length)[BackPeriods];

case Wilders:
AvgHigh = WildersAverage(high, Length)[BackPeriods];
AvgLow = WildersAverage(low, Length)[BackPeriods];
}
###############################################################
AddCloud(AvgHigh, AvgLow, Color.BLUE, Color.BLUE);
###############################################################
# THIS CODE CHANGES THE CANDLE COLORS, IF YOU WISH TO RETAIN THE ACTUAL CANDLE COLORS, THEN TYPE THE # SYMBOL IN FRONT OF assignPriceColor.
AssignPriceColor( if price > AvgHigh then Color.GREEN else if price < AvgLow then Color.RED else Color.BLUE);
###############################################################
# THIS CODE CHANGES THE BACKGROUND OF THE CHART FOR A BETTER VISUAL CLUE.
# ASSIGnBackgroundColor( if price > AvgHigh then color.dark_green else if price < AvgLow then color.dark_red else color.gray);
###############################################################
plot UpSignal;
UpSignal = if price > AvgHigh and price[1] <= AvgHigh[1] then low else Double.NaN;
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
UpSignal.SetDefaultColor(GetColor(1));
UpSignal.SetLineWeight(3);
UpSignal.HideBubble();
######################
plot DownSignal;
DownSignal = if price < AvgLow and price[1] >= AvgLow[1] then high else Double.NaN;
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
DownSignal.SetDefaultColor(GetColor(0));
DownSignal.SetLineWeight(3);
DownSignal.HideBubble();
######################
def Neutral = price > AvgLow and price < AvgHigh;
###############################################################
# THIS CODE ALLOWS THE SYSTEM TO ALERT YOU WITH SOUNDS, IF YOU WISH TO TURN IT OFF, THEN TYPE THE # SYMBOL IN FRONT OF ALERT.
Alert(UpSignal, "BUY", Alert.TICK, Sound.NoSound);
Alert(UpSignal, "BUY", Alert.BAR, Sound.NoSound);
###############################################
Alert(DownSignal, "SHORT", Alert.TICK, Sound.NoSound);
Alert(DownSignal, "SHORT", Alert.BAR, Sound.NoSound);
###############################################
Alert(Neutral, "Neutral", Alert.TICK, Sound.NoSound);
Alert(Neutral, "Neutral", Alert.BAR, Sound.NoSound);
###############################################################
AddLabel(if price > AvgHigh then yes else no, "BUY BUY BUY ! ! !", Color.GREEN);
#########################
AddLabel(if price < AvgLow then yes else no, "SHORT SHORT SHORT ! ! !", Color.RED);
#########################
AddLabel(if price > AvgLow and price < AvgHigh then yes else no, "CAUTION CAUTION CAUTION ! ! !", Color.YELLOW);

Join InvestorsHub

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.