@chris/shock/deco

FTMO Trader Scouting
here's the single line ADX and modified zlag:

adx
Code:
declare lower;
declare once_per_bar;

input n = 14;

def gd_88 = high - high[1];
def gd_96 = low[1] - low;

def gda_104;
def gda_108;

# If price differences are equal or 0, set 104/108 to 0
if ((gd_88 < 0 and gd_96 < 0) or gd_88 == gd_96) then {
    gda_104 = 0;
    gda_108 = 0;
}

# Otherwise set 104 to the highs differentiation, 
# and 108 to the lows differentiation
else {
    gda_104 = if gd_88 > gd_96 then gd_88 else 0;
    gda_108 = if gd_88 < gd_96 then gd_96 else 0;
}

# Calculations

# High differentation modification
def gda_112;
gda_112 = gda_112[1] * (n - 1.0) / n + gda_104 / n;

# Low differentation modification
def gda_116;
gda_116 = gda_116[1] * (n - 1.0) / n + gda_108 / n;

# Do some crazy calculations.
def gda_120;
gda_120 = Max(
    Max(AbsValue(high - low), AbsValue(high - close[1])), 
    AbsValue(close[1] - low)
);

# No idea what this does.
def gda_124 = gda_124[1] * (n - 1.0) / n + gda_120 / n;

# Conditional work of some sort..?
def gda_128; 
def gda_132;
def gda_136;

if (gda_124 > 0) then {
    # Low and high %?
    gda_128 = 100.0 * (gda_112 / gda_124);
    gda_132 = 100.0 * (gda_116 / gda_124);
    
    # Crazy calculations again...
    gda_136 = if (gda_128 + gda_132) > 0 then 100.0 * (AbsValue(gda_128 - gda_132) / (gda_128 + gda_132)) else double.nan;
}

# Set to null if not applicable.
else {
    gda_128 = double.nan;
    gda_132 = double.nan;
    gda_136 = double.nan;
}

def res = res[1] * (n - 1.0) / n + gda_136 / n;
def last = res[1];

# Plot it all
input high_point = 30;
input low_point = 15;

plot dx = res;

dx.setDefaultColor(color.green);
dx.assignValueColor(if dx <= 15 then color.dark_green else color.green);

addLabel(yes, "ADX="+dx);

def uhook = !(uhook[1] within n bars) and dx[1] >= high_point and dx < dx[1];
def dhook = !(dhook[1] within n bars) and dx[1] crosses above low_point and dx > low_point;

plot u_hook = if uhook then dx else double.nan;
#u_hook.setStyle(curve.points);
u_hook.setPaintingStrategy(paintingStrategy.HISTOGRAM);
u_hook.setDefaultColor(color.WHITE);

plot d_hook = if dhook then dx else double.nan;
#d_hook.setStyle(curve.points);
d_hook.setPaintingStrategy(paintingStrategy.HISTOGRAM);
d_hook.setDefaultColor(color.WHITE);

zlag
Code:
#TFP Zero Lag Moving Average Convergence Divergence (MACD)
input price = close;
input fastLength = 12;
input slowLength = 24;
input MACDLength = 9;
input BarsBack = 30;
input PlotLines = {default "NO", "YES"};

def EMAf = ExpAverage(price, fastLength);
def EMAs = ExpAverage(price, slowLength);
def EMAEMAf = ExpAverage(EMAf, fastLength);
def EMAEMAs = ExpAverage(EMAs, slowLength);
def ZLEMAf = EMAf + EMAf - EMAEMAf;
def ZLEMAs = EMAs + EMAs - EMAEMAs;
def TR = TRIX(9, 14, close, 3);

plot MACDValue = if PlotLines then (EMAf - EMAs) else Double.NaN;
plot SignalAvg = if PlotLines then ExpAverage(MACDValue, MACDLength) else Double.NaN;

plot Diff = ZLEMAf - ZLEMAs;
def ChartPeriod = GetAggregationPeriod() / 1000 / 60;
plot ZeroLine = 0;
ZeroLine.AssignValueColor(Color.GRAY);

plot DivergeTop = if
Diff > 0
and Diff < Diff[1]
and Diff[1] > Diff[2]
#and Diff[2]>Diff[3]
and Diff < Highest(Diff, BarsBack)
and Highest(price, 5)  > Highest(price[6], BarsBack)
then Highest(Diff, BarsBack) else Double.NaN;

plot DivergeBottom = if
Diff < 0
and Diff > Diff[1]
and Diff[1] < Diff[2]
#and Diff[2]<Diff[3]
and Diff > Lowest(Diff, BarsBack)
and Lowest(price, 5) < Lowest(price[6], BarsBack)
then Lowest(Diff, BarsBack) else Double.NaN;

Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);

Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.GREEN);
Diff.DefineColor("Negative and Up", Color.DARK_GREEN);

Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));

DivergeTop.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DivergeTop.SetLineWeight(5);
DivergeTop.SetDefaultColor(Color.red);

DivergeBottom.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DivergeBottom.SetLineWeight(5);
DivergeBottom.SetDefaultColor(Color.red);

# Visual signals
AddLabel(yes, "MACD="+Diff);

def isSignal = !(isSignal[1] within MACDLength bars) and Diff crosses 0;
AddVerticalLine(isSignal, "", color.dark_green);

AssignPriceColor(if isSignal then color.red else color.current);
 
here's rads t3 ssto built for ToS:

Code:
declare lower;
declare once_per_bar;

input kperiod = 13;
input dperiod = 3;
input slowing = 3;
input price_field = 1;
input ma_method = AverageType.SIMPLE;
input t3_period = 9;
input b = 0.81;

def e1;
def e2;
def e3;
def e4;
def e5;
def e6;
def c1;
def c2;
def c3;
def c4;
def c1a;
def c2a;
def c3a;
def c4a;
def n;
def w1;
def w2;
def b2;
def b3;
def na;
def w1a;
def w2a;
def b2a;
def b3a;

# Variable reset (apparently)
b2 = b * b;
b3 = b2 * b;
c1 = -b3;
c2 = (3 * (b2 + b3));
c3 = -3 * (2 * b2 + b + b3);
c4 = (1 + 3 * b + b3 + 3 * b2);

b2a = b * b;
b3a = b2a * b;
c1a = -b3a;
c2a = (3 * (b2a + b3a));
c3a = -3 * (2 * b2a + b + b3a);
c4a = (1 + 3 * b + b3a + 3 * b2a);

n = t3_period + 0.5 * (t3_period - 1);
w1 = 2 / (n + 1);
w2 = 1 - w1;

na = 1 + 0.5 * (t3_period - 1);
w1a = 2 / (na + 1);
w2a = 1 - w1a;

# Indicator build
def stochastic = StochasticFull(80, 20, kperiod, dperiod, high, low, close, slowing, ma_method).FullK;

e1 = w1 * stochastic + w2*e1[1];
e2 = w1*e1 + w2*e2[1];
e3 = w1*e2 + w2*e3[1];
e4 = w1*e3 + w2*e4[1];
e5 = w1*e4 + w2*e5[1];
e6 = w1*e5 + w2*e6[1];    

plot t3 = c1*e6 + c2*e5 + c3*e4 + c4*e3;
t3.setStyle(curve.firm);
t3.setDefaultColor(color.yellow);

AddLabel(yes, "T3="+t3);
 
outthislife said:
here's rads t3 ssto built for ToS:

implemented the signal line as well,

Code:
declare lower;
declare once_per_bar;

input kperiod = 13;
input dperiod = 3;
input slowing = 3;
input price_field = 1;
input ma_method = AverageType.WEIGHTED;
input t3_period = 9;
input b = 0.81;

def c1;
def c2;
def c3;
def c4;
def c1a;
def c2a;
def c3a;
def c4a;
def n;
def w1;
def w2;
def b2;
def b3;
def na;
def w1a;
def w2a;
def b2a;
def b3a;

# Variable reset (apparently)
b2 = b * b;
b3 = b2 * b;
c1 = -b3;
c2 = (3 * (b2 + b3));
c3 = -3 * (2 * b2 + b + b3);
c4 = (1 + 3 * b + b3 + 3 * b2);

b2a = b * b;
b3a = b2a * b;
c1a = -b3a;
c2a = (3 * (b2a + b3a));
c3a = -3 * (2 * b2a + b + b3a);
c4a = (1 + 3 * b + b3a + 3 * b2a);

n = t3_period + 0.5 * (t3_period - 1);
w1 = 2 / (n + 1);
w2 = 1 - w1;

na = 1 + 0.5 * (t3_period - 1);
w1a = 2 / (na + 1);
w2a = 1 - w1a;

# Indicator build
input over_bought = 85;
input over_sold = 15;

def s_k = StochasticFull(over_bought, over_sold, kperiod, dperiod, high, low, close, slowing, ma_method).FullK;
def s_d = StochasticFull(over_bought, over_sold, kperiod, dperiod, high, low, close, slowing, ma_method).FullD;

def e1;
def e2;
def e3;
def e4;
def e5;
def e6;

e1 = w1 * s_k + w2*e1[1];
e2 = w1*e1 + w2*e2[1];
e3 = w1*e2 + w2*e3[1];
e4 = w1*e3 + w2*e4[1];
e5 = w1*e4 + w2*e5[1];
e6 = w1*e5 + w2*e6[1];    

plot t3 = c1*e6 + c2*e5 + c3*e4 + c4*e3;
t3.setStyle(curve.firm);
t3.setDefaultColor(color.yellow);

def e1a;
def e2a;
def e3a;
def e4a;
def e5a;
def e6a;

e1a = w1 * s_d + w2*e1a[1];
e2a = w1*e1a + w2*e2a[1];
e3a = w1*e2a + w2*e3a[1];
e4a = w1*e3a + w2*e4a[1];
e5a = w1*e4a + w2*e5a[1];
e6a = w1*e5a + w2*e6a[1];    

plot t3a = c1*e6a + c2*e5a + c3*e4a + c4*e3a;
t3a.setStyle(curve.firm);
t3a.setDefaultColor(color.dark_orange);

# Visual guidelines
plot h = over_bought;
h.setStyle(curve.firm);
h.setDefaultColor(color.dark_gray);
h.hide();

plot m = 50;
m.setStyle(curve.firm);
m.setDefaultColor(color.dark_gray);
m.hide();

plot l = over_sold;
l.setStyle(curve.firm);
l.setDefaultColor(color.dark_gray);
l.hide();

AddLabel(yes, "T3="+t3);

pre-NFP = zzzzzzzzzzzzzzzz
 
Yeah it seems pretty choppy overall, and I'm too lazy to even look at when the news releases are, so I just sit there staring at no liquidity for a couple hours. :D
 
Chrisrocs said:
Yeah it seems pretty choppy overall, and I'm too lazy to even look at when the news releases are, so I just sit there staring at no liquidity for a couple hours. :D

I'm liking the hook a lot:

[quote author="evernote"]
Trend end & beginning:
DT/DB/H&S/iH&S w/ div on an h1, h4, or d1 KSR

The previous trend ADX will hook over, SSTO will be diverged from the MACD and a new trend will begin once the pattern signal is complete. It could end at the 729, but most likely will just go to the next KSR.

Mid-trend retracements:
Price will go in the direction of the trend while the MACD shrinks and eventually the ADX will hook. There will be retracements with the MACD showing divergence to either the 174 or the 89, depending on the scale of the trend. A new pattern will form to measure the rest of the trend from.

These counter-trend trades are not worth taking. They are scale-in or entry, re-entry opportunities. Sometimes it'll be a deep retracement to the 729, but just sit on your hands and wait for a clear pattern before entering w/ the existing trend.
[/quote]
 
btw, I'd like to bring attention to the DB on the H1 in Fiber, diverged... It had me confused earlier cus you had that big up-down move earlier in the AM, so I figured maybe that move had come and gone, but there it is.... also on the range chart you get the bullish wedge just before the breakout combined with the diverged DB :O
 
Chrisrocs said:
btw, I'd like to bring attention to the DB on the H1 in Fiber, diverged... It had me confused earlier cus you had that big up-down move earlier in the AM, so I figured maybe that move had come and gone, but there it is.... also on the range chart you get the bullish wedge just before the breakout combined with the diverged DB :O

yep i traded that DB ;D

it was literally perfect.
 
didn't take this cause it's late Friday, but another interesting ADX happening happened, right on divergence.
 

Attachments

  • Screenshot on 9.4.2015 at 3.11.00 PM.png
    Screenshot on 9.4.2015 at 3.11.00 PM.png
    39.5 KB · Views: 34
A little off topic, but I did have a question for [member=524]outthislife[/member] and [member=543]Chrisrocs[/member] about ToS/TDAmeritrade: how are they as a Forex Broker? (Feel free to toss a response in a PM, so I don't derail your thread.)
 
sqa said:
A little off topic, but I did have a question for [member=524]outthislife[/member] and [member=543]Chrisrocs[/member] about ToS/TDAmeritrade: how are they as a Forex Broker? (Feel free to toss a response in a PM, so I don't derail your thread.)

No clue yet to be honest, haven't used them for live funds. I have a live account with them, which was setup very smoothly. Their support seems very polite and quick. OTL will have a better sense of them as a broker I imagine ;D
 
Support is A+, spreads seem to be the US standard (2-3). News spreads are the same afaik but liquidity gaps still happen. No crazy issues ever though.
 
Ah, so the spreads have improved. I was curious and there was a lot of complaints about slippage and spreads. Their internal book must be better.
 
sqa said:
Ah, so the spreads have improved. I was curious and there was a lot of complaints about slippage and spreads. Their internal book must be better.

yeah, guess so :thumbsup:

how are you doing lately? never in chat anymore ???
 
FTMO Trader Scouting
Back
Top