Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
# Arnold_PPS / 18062014
# 085.850.878.878 / 081.230.878.878
Call.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
call.setDefaultColor (color.GREEN);
Call.SetLineWeight(5);
Put.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
put.setDefaultColor (color.red);
Put.SetLineWeight(5);
script OpenRange {
input ORtime = 5;
def Rhigh = if FirstBar then high else if RangeTime and high > Rhigh[1] then high else Rhigh[1];
def Rlow = if FirstBar then low else if RangeTime and low < Rlow[1] then low else Rlow[1];
yHigh.SetDefaultColor(Color.CYAN);
yLow.SetDefaultColor(Color.PINK);
plot h5 = if !today then Double.NaN else if !first30 then Double.NaN else OpenRange(5).h;
h5.SetDefaultColor(Color.YELLOW);
plot l5 = if !today then Double.NaN else if !first30 then Double.NaN else OpenRange(5).l;
l5.SetDefaultColor(Color.YELLOW);
h30.SetDefaultColor(Color.YELLOW);
l30.SetDefaultColor(Color.YELLOW);
def lowConf = if first30 then Min(yLow, l5) - ATR else Min(yLow, l30) - ATR;
def highConf = if first30 then Max(yHigh, h5) + ATR else Max(yHigh, h30) + ATR;
lc1.SetDefaultColor(Color.ORANGE);
lc2.SetDefaultColor(Color.ORANGE);
hc1.SetDefaultColor(Color.ORANGE);
hc2.SetDefaultColor(Color.ORANGE);
def decisionL = if close > lowConf then Double.NaN else if close crosses below lowConf then low else
decisionL[1];
def decisionH = if close < highConf then Double.NaN else if close crosses above highConf then high else
decisionH[1];
dL.SetDefaultColor(Color.WHITE);
def TL = CompoundValue(1, if IsNaN(dL) then Double.NaN else if !IsNaN(TL[1]) then TL[1] else if close
crosses below dL then dL - 2 * ATR else Double.NaN, Double.NaN);
def SL = CompoundValue(1, if IsNaN(dL) then Double.NaN else if !IsNaN(SL[1]) then SL[1] else if close
crosses below dL then dL + 2 * ATR else Double.NaN, Double.NaN);
Target1Low.SetDefaultColor(Color.GREEN);
Target1Low.SetStyle(Curve.SHORT_DASH);
Stop1Low.SetDefaultColor(Color.RED);
Stop1Low.SetLineWeight(2);
AddChartBubble(IsNaN(TL[1]) and !IsNaN(TL), TL, "Target 1\n" + Round(TL, 2), Color.GREEN, no);
def TH = CompoundValue(1, if IsNaN(dH) then Double.NaN else if !IsNaN(TH[1]) then TH[1] else if close
crosses above dH then dH + 2 * ATR else Double.NaN, Double.NaN);
def SH = CompoundValue(1, if IsNaN(dH) then Double.NaN else if !IsNaN(SH[1]) then SH[1] else if close
crosses above dH then dH - 2 * ATR else Double.NaN, Double.NaN);
Target1High.SetDefaultColor(Color.GREEN);
Target1High.SetStyle(Curve.SHORT_DASH);
Stop1High.SetDefaultColor(Color.RED);
Stop1High.SetLineWeight(2);
# E-Charts v2
declare upper;
input short_average = 5;
def MA1;
def MA2;
def MA3;
switch (average_type) {
case "SMA":
case "EMA":
MA1 = ExpAverage(close, short_average);
then 1
then 1
then 1
else Double.NaN;
then 1
then 1
else Double.NaN;
ln1.SetLineWeight(2);
ln2.SetLineWeight(2);
ln3.SetLineWeight(2);
#start
#hint: <b>Ask SLM Ribbon</b>\nThe Ask SLM Ribbon is a momentum indicator that uses a combination
of three exponential moving averages. When the averages are in alinement, with the "superfast" moving
average above the "fast" moving average and the fast moving average above the "slow" moving
average, the momentum condition is positive. A "buy signal" is generated, with an up arrow, when
above conditions are met and a "clear bar" occurs; with the low of that bar is above all of the moving
averages. The positive momentum ends if the superfast moving average touches the fast moving
average; then condition is considered neutral and an oppostive arrow will appear. Negative momentum
and a "Sell signal" are the opposite of the bullish conditions. \n \n\n------------------------------------------------
--------------------------------\nVolume bars can be colored to match the Chart by clicking on
Style>Settings>Appearance>Common, and color symbol as ticks \n
input superfast_length = 8;
input displace = 0;
#moving averages
def buy = mov_avg8 > mov_avg13 and mov_avg13 > mov_avg21 and low > mov_avg8;
def buysignal = CompoundValue(1, if buynow and !stopbuy then 1 else if buysignal[1]==1 and stopbuy
then 0 else buysignal[1], 0);
Buy_signal.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Buy_signal.setdefaultColor(color.dark_GREEN);
Buy_signal.hidetitle();
Alert(condition = buysignal[1] == 0 and buysignal == 1, text = "Buy Signal", sound = Sound.Bell, "alert
type" = Alert.BAR);
Momentum_down.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Momentum_Down.setdefaultColor(color.plum);
Momentum_down.hidetitle();
def sell = mov_avg8 < mov_avg13 and mov_avg13 < mov_avg21 and high < mov_avg8;
Sell_signal.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
sell_signal.setDefaultColor(color.red);
Sell_signal.hidetitle();
Alert(condition = sellsignal[1] == 0 and sellsignal == 1, text = "Sell Signal", sound = Sound.Bell, "alert
type" = Alert.BAR);
Momentum_up.setpaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);
Momentum_up.setDefaultColor(color.plum);
Momentum_up.hidetitle();
plot Colorbars = if buysignal ==1 then 1 else if sellsignal ==1 then 2 else if buysignal ==0 or sellsignal==0
then 3 else 0;
colorbars.hide();
Colorbars.definecolor("Buy_Signal_Bars", color.dark_green);
Colorbars.definecolor("Sell_Signal_Bars", color.red);
Colorbars.definecolor("Neutral", color.plum);
AssignPriceColor(if Colorbars ==1 then colorbars.color("buy_signal_bars") else if colorbars ==2 then
colorbars.color("Sell_Signal_bars") else colorbars.color("neutral"));
#end
#Update by OS
#http://www.optionstrategi.com/
###########################################################
input displace = 0;
input MA1_length = 3;
DefineGlobalColor("RisingMA", color.BLUE);
DefineGlobalColor("FallingMA", color.RED);
def SMA1;
switch (SimpleMovingAvg) {
case Simple:
case Exponential:
case Hull:
case Variable:
plot Trend1;
switch (movingAverageType2) {
case Simple:
case Exponential:
case Weighted:
case Hull:
case Variable:
Trend1.SetLineWeight(4);
Trend1.HideBubble();
def sma_15=sma15;
Slooping.AssignValueColor(if sma3 > sma15[1] then color.GREEN else (if sma3 < sma15[1] then
color.MAGENTA else color.YELLOW));
Slooping.SetLineWeight(2);
#addLabel(yes,"", color.blue);
#########################
#########################
declare upper;
input n = 5;
input simpleMovingAvg = 0;
#SMA5.SetDefaultColor(color.BLACK);
Slooping.SetLineWeight(4);
#ADX
#MACD
input fastLength = 8;
input MACDLength = 9;
AssignPriceColor(if MACD1 > Avg then Color.BLUE else if MACD1 < Avg then color.RED else
color.current);
rec count=if MACD_UP==1 and count[1]==0 then 1 else if MACD_DN==0 and count[1]>=1 then
count[1]+1 else 0;
rec count1=if MACD_DN==1 and count1[1]==0 then 1 else if MACD_UP==0 and count1[1]>=1 then
count1[1]+1 else 0;
def MACD_SIGNALup = MACD_UP==1 and count<=3;
plot AS3_CALL = close crosses above sma5 and dotUp and up and Chigh and Ophigh;
AddLabel (AS3_CALL, " AS3 CALL ", if AS3_CALL then Color.BLUE else color.BLUE);
plot AS3_PUT = close crosses below sma5 and dotDn and up and Clow and OpLow ;
AddLabel (AS3_PUT, " AS3 PUT ", if AS3_PUT then Color.red else color.red);
AS3_CALL.SetDefaultColor(color.blue);
AS3_CALL.SetLineWeight(4);
AS3_PUT.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
AS3_PUT.SetDefaultColor(color.red);
AS3_PUT.SetLineWeight(4);
);