InvestorsHub Logo
Followers 43
Posts 22771
Boards Moderated 2
Alias Born 10/16/2008

Re: alexed post# 1206

Sunday, 04/08/2012 1:38:26 PM

Sunday, April 08, 2012 1:38:26 PM

Post# of 3631
A > start with this
It is probably the one you lost and I have passed
it to a few people, It is the Left Charts "Banding"
Visual alert ON, Sound alert Off

=================================================================

### THIS SYSTEM USES THE MA OF THE HIGH AND THE MA OF THE LOW, TO TRIGGER SIGNALS UP OR DOWN ONCE ACTUAL PRICE HAS CROSSED ABOVE THE MA OF THE HIGH OR BELOW THE MA OF THE LOW. ###
###############################################################
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);
###############################################################
AddChartLabel(if price > AvgHigh then yes else no, "BUY BUY BUY ! ! !", color.green);
#########################
AddChartLabel(if price < AvgLow then yes else no, "SHORT SHORT SHORT ! ! !", color.red);
#########################
AddChartLabel(if price > AvgLow and price < AvgHigh then yes else no, "CAUTION CAUTION CAUTION ! ! !", color.YELLOW);
###############################################################

Disaster is Only a Keystroke Away!

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.