News Focus
News Focus
icon url

desertcynlite

04/08/12 12:45 PM

#1208 RE: alexed #1206

FYI - We have both shared code on this board and Duma's board that are not standard in TOS. I have put references to them in the iBox for this board. You will find some of the code he is using there. He is also using TTM_LRC which you can customize in length to your chart and is standard in TOS. There is a lot going on in Spd's charts. I would recommend starting there to build them.


icon url

spdpro

04/08/12 1:38 PM

#1211 RE: alexed #1206

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