Trading System su pivot point e brekaut et scusate l inglese

biagio1

Nuovo forumer
ADAPTIVE MOVING AVERAGE (Perry Kaufmann)

Descrizione: Crea una media mobile che si autoadatta al mercato.

Type: Function, Name: AMA

Inputs: Period(Numeric);
Vars: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(.6667), Slowest(.0645), AdaptMA(0);
Diff = AbsValue(Close - Close[1]);
IF CurrentBar <= Period Then AdaptMA = Close;
IF CurrentBar > Period Then Begin
Signal = AbsValue(Close - Close[Period]);
Noise = Summation(Diff, Period);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]);
End;
AMA = AdaptMA;

Type: Function, Name: AMAF

Inputs: Period(Numeric), Pcnt(Numeric);
Vars: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(.6667), Slowest(.0645), AdaptMA(0), AMAFltr(0);
Diff = AbsValue(Close - Close[1]);
IF CurrentBar <= Period Then AdaptMA = Close;
IF CurrentBar > Period Then Begin
Signal = AbsValue(Close - Close[Period]);
Noise = Summation(Diff, Period);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]);
AMAFltr = StdDev(AdaptMA-AdaptMA[1], Period) * Pcnt;
End;
AMAF = AMAFltr;

Type: Indicator, Name: Adaptive Moving Average

Inputs: Period(10), Smooth("Y");
IF UpperStr(Smooth) = "Y" Then
Plot1(LinearRegValue(AMA(Period), Period, 0), "Smooth AMA")
Else
Plot2(AMA(Period), "Adaptive MA");

Type: Indicator, Name: Adaptive Moving Average Fltr

Inputs: Period(10), Pcnt(.15);
Vars: AMAVal(0), AMAFVal(0), AMALs(0), AMAHs(0);
AMAVal = AMA(Period);
AMAFVAl = AMAF(Period, Pcnt);
IF CurrentBar = 1 Then Begin
AMALs = AMAVal;
AMAHs = AMAVal;
End Else Begin
IF AMAVal < AMAVal[1] Then
AMALs = AMAVal;
IF AMAVal > AMAVal[1] Then
AMAHs = AMAVal;
IF AMAVal - AMALs > AMAFVal Then Begin
Plot1(AMAFVal, "Buy");
IF Plot1[1] = 0 Then
Alert = True;
End Else
IF AMAHs - AMAVal > AMAFVal Then Begin
Plot2(AMAFVal, "Sell");
IF Plot2[1] = 0 Then
Alert = True;
End;
Plot3(AMAFVal, "AMAFilter");
End;

ADAPTIVE STOCHASTIC OSCILLATOR (Tushar Chande)

Descrizione: Crea uno stocastico che si autoadatta al mercato.

Type : Indicator, Name : Adaptive Stochastic Oscillator

vars: v1(0), v2(0), v3(0), v4(0) ;
vars: lenmax(28), lenmin(7), currlen(0) ;
vars: hh(0), ll(0), stoch(0), stochma(0) ;

{--- Calculate 20-day std. Dev. And its 20-day range ---}

v1 = stddev(c,20) ;
v2 = highest(v1, 20) ;
v3 = lowest(v1, 20) ;

{--- Create v4: stochastic oscillator for 20-day std. dev. ---}
{--- if v1=v2 (highest level) => v4 = 1; if v1=v3 (lowest level) => v4=0 ---}

if (v2-v3) > 0 then v4 = ((v1 - v3)/(v2-v3)) Else v4 = 0 ;

{--- Calculate current effective length; if v4 = 1, then length = mininum ---}

currlen = IntPortion(lenmin + (lenmax-lenmin)*(1-v4)) ;

{--- Calculate stochastic oscillator and its 3-day exponential average ---}

hh = highest(h, currlen) ;
ll = lowest(l, currlen) ;
if (hh-ll) > 0 then stoch = ((close - ll)/(hh - ll)) * 100 ;
if currentbar = 1 then stochma = 0 else
stochma = 0.5*stoch + 0.5*stochma[1] ;

{--- Plot data ---}

plot1(stoch, "adapt_stoch") ;
plot2(stochma, "stochma") ;
plot3(80, "hi_ref") ;
plot4(20, "lo_ref") ;

{ --- End of code -}


ADX MOVAVG COMBO (Daniel Chesler)

Descrizione: Unisce i vantaggi della media mobile utilizzandola in combinazione con un indicatore trend come ADX.

Type: Indicator, Name: ADX / MovAvg Combo

Inputs:
Price(Close),
AvgLen(50),
ADXLen(14),
Level(15);

Vars:
AvgVal(0);
AvgVal = Average(Price, AvgLen);

Plot1(AvgVal, "M_Average");

IF ADX(ADXLen) < Level Then Begin Plot2 (AvgVal, "ADX_Level");
IF CheckAlert Then Alert = True;

End;

ADX w/LEVEL (Daniel Chesler)

Descrizione: Analizza la forza dell'indicatore ADX.

Type: Indicator, Name: ADX w/Level

Inputs: ADXLen(14), Level(15);
Plot1(ADX(ADXLen), "ADX");
IF Plot1 > Level Then
Plot2(Level, "ADX_Level")
Else Begin Plot3(Level, "ADX_Level");
IF CheckAlert Then Alert = True;
End;

LONG TERM BOLLINGER

Descrizione: Sistema adatto per trading multimercato

Type : Signal, Name : LTBoll


Inputs: Length(35), StdDevUp(2.0), StdDevDn(-2.0);
Vars: UpBand(0), DnBand(0), Ave(0);

UpBand = BollingerBand(Close,Length,StdDevUp);
DnBand = BollingerBand(Close,Length,StdDevDn);

Ave = Average(Close,Length);

{ ---- Enter Long ---- }

if ( MarketPosition = 0 ) and ( Close > UpBand )
then Buy("BE") tomorrow at market;

{ ---- Enter Short ---- }

if ( MarketPosition = 0 ) and ( Close < DnBand )
then Sell("SE") tomorrow at market;

{ ---- Exit Short ---- }

if ( MarketPosition = 1 ) and ( Close < Ave )
then ExitLong("LX") today at close;

{ ---- Exit Long ---- }

if ( MarketPosition = -1 ) and ( Close > Ave )
then ExitShort("SX") today at close;



ADAPTIVE MOVING AVERAGE SYSTEM (Perry Kaufmann)

Descrizione: Sistema che utilizza medie mobili autoadattanti.

Type: System, Name: Adaptive Moving Average Fltr System


Inputs: Period(10), Pcnt(.15);
Vars: AMAVal(0), AMAFVal(0), AMALs(0), AMAHs(0);
AMAVal = AMA(Period);
AMAFVAl = AMAF(Period, Pcnt);
IF CurrentBar = 1 Then Begin
AMALs = AMAVal;
AMAHs = AMAVal;
End Else Begin
IF AMAVal < AMAVal[1] Then
AMALs = AMAVal;
IF AMAVal > AMAVal[1] Then
AMAHs = AMAVal;
IF AMAVal - AMALs Crosses Above AMAFVal Then
Buy This Bar on Close;
IF AMAHs - AMAVal Crosses Above AMAFVal Then
Sell This Bar on Close;
End;

BALANCE OF POWER (Igor Livshin)

Descrizione: Evidenzia se il mercato è sostenuto da compratori o venditori.

Type : Indicator, Name : Balance Of Power

inputs: Length(14);
variables: BOP(0);
BOP = ( Close - Open ) / ( High - Low );
Plot1( Average( BOP, Length ) ) ;

BAND WIDTH INDICATOR (John Bollinger)

Descrizione: Calcola la forza del trend elaborando la distanza tra le Bollinger Bands.

Type : Function, Name : BWI

Inputs:
Len (Numeric),
Stdev1(Numeric),
Stdev2(Numeric);

Vars:
Upper(0),
Lower(0),
Avg(0);

Upper=BollingerBand(Close,Len,Stdev1);
Lower=BollingerBand(Close,Len,Stdev2);
Avg=Xaverage(Close,Len);

Bwi=(Upper-Lower)/Avg;

Type : Indicator, Name : BWI

Inputs:
Len(21),
Stdev1(2),
Stdev2(-2);

Plot1(BWI(Len,Stdev1,Stdev2),"BWI");

RIELABORAZIONE BOLLINGER BANDS (Dennis McNicholl)

Descrizione: Rielabora il concetto alla base delle Bollinger Bands.

Type : Indicator, Name : Better Bollinger Bands

{Denvelope Indicator}

inputs:
lookback(20),
mult(2);

vars:
alpha(0),
mt(0),
ut(0),
dt(0),
mt2(0),
ut2(0),
dt2(0),
but(0),
blt(0);

alpha = 2 / (lookback + 1);
mt = alpha * close + (1 - alpha) * mt;
ut = alpha * mt + (1 - alpha) * ut;
dt = ((2 - alpha) * mt - ut) / (1 - alpha);
mt2 = alpha * absvalue(close - dt) + (1 - alpha) * mt2;
ut2 = alpha * mt2 + (1 - alpha) * ut2;
dt2 = ((2 - alpha) * mt2 - ut2) / (1 - alpha);
but = dt + mult * dt2;
blt = dt - mult * dt2;
plot1(dt,"CenterB");
plot2(but,"UpperB");
plot3(blt,"LowerB");


BOND FUTURES LR SURFING INDICATOR (Dennis Meyers)

Descrizione: Si basa sul concetto della regressione lineare.

Type : Indicator, Name : Bond Futures LR Surfing Indicator

inputs: ndays(30);

plot1(linearregvalue(close, ndays, 0),"BFSurf");


BUFF AVERAGES (Buff Dormeier)

Descrizione: Media mobile pesata con i volumi.

Type : Function, Name : BuffAverage

Inputs: Price(Numeric), Length(Numeric);
Variables: VolSum(0), Buff(0);

VolSum = Summation(Volume, Length);
Buff = 0;

If VolSum <> 0 Then Begin
For value1 = 0 To Length - 1 Begin
Buff = Buff + ((Price[value1] * Volume[value1]) / VolSum);
End;
End;

BuffAverage = Buff;

Type : Indicator, Name : Buff Averages

Inputs: Price(Close), FastAvg(5), SlowAvg(20);Plot1(BuffAverage(Price, FastAvg), "FastBuff");Plot2(BuffAverage(Price, SlowAvg), "SlowBuff");If Plot1 Crosses Above Plot2 Then Alert("Buff Averages Bullish Crossover.");If Plot1 Crosses Below Plot2 Then Alert("Buff Averages Bearish Crossover.");

BOND FUTURES LR SURFING SYSTEM (Dennis Meyers)

Descrizione: Si basa sul concetto della regressione lineare.

Type : Signal, Name : Bond Futures LR Surfing System

inputs: ndays(30),
pctup(.01425),
pctdn(.01425),
jmpup(.0035),
jmpdn(.0050);

vars: pf(0),
le(0),
se(0);

pf = linearregvalue(close, ndays, 0);

if currentbar > ndays then begin

if marketposition = 0 then begin
if pf / pf[2] > 1 + jmpup then begin
buy tomorrow open;
le = 1;
end;
if pf / pf[2] < 1 - jmpdn then begin
sell tomorrow open;
se = 1;
end;
end;

if marketposition = 1 then begin
if pf < highest(pf, le) * (1 - pctdn) then begin
sell tomorrow open;
le = 0;
end;
le = le + 1;
end;

if marketposition = -1 then begin
if pf > lowest(pf, se) * (1 + pctup) then begin
buy tomorrow open;
se = 0;
end;
se = se + 1;
end;

end;

BREAKOUT RANGE2 SYSTEM (Mark Vakkur)

Descrizione: Basato sul breakout di High/Low di x barre.

Type : Function, Name : Breakout_Range2

{********************1/26/2000 Mark Vakkur, M.D.
if this bar is the highest bar of the last look_bak bars
AND this has not occurred in look_bak bars, returns
the number of bars, otherwise returns 0. **************}

Inputs:
price( numericseries),
look_bak(numeric);

Vars: bar_count(0),
max_price(h); {number of bars since last high}

If CurrentBar = 1
then Begin bar_count = 1;
{bar_count counts the number of bars since
a new high was made}End
Else Begin
If price > Highest(high, look_bak)[1]
{if this bar is the highest high of
the look_bak period} then Begin
if bar_count >= look_bak then Begin
Breakout_Range2=bar_count;
bar_count = 0;
End
Else {highest high but NOT since look_bak bars}
Begin bar_count = 0;
Breakout_Range2 = 0;
End;
End { of highestbar check }

Else {this isn't the highest high }
Begin bar_count = bar_count + 1;

Breakout_Range2 = 0;
End;
End;


Type : Signal, Name : Breakout_Range2

Input:
look_bak(4),
n_bars(4);
If Breakout_Range2(h, look_bak) <> 0 then
{this would only occur if a new high price occured after n_bars of no such new high}
Buy ;
If BarsSinceEntry >= n_bars then ExitLong;

BREAKOUT SYSTEM (Leo Zamansky)

Descrizione: Basato sul breakout di High/Low di x barre.

Type : Signal, Name : Breakout System

Input:
BLen(20),
XLen(10);

IF CurrentBar > 1 and Close > Highest(High,BLen)[1]
Then Buy on Close;
IF CurrentBar > 1 and Close < Lowest(Low,XLen)[1]
Then ExitLong;

ACQUISTO DATA1 QUANDO SI INCROCIANO LE MEDIE SU DATA2

Descrizione: Risponde all'esigenza di lavorare su diversi time frames.

Type : Signal, Name : Buy Data1 when Data2 Crosses a Moving Average

Input: AvgLen(9);

Value1 = (Average(Close Data2, AvgLen));
Value2 = (Close Data2);

Condition1 = Value2 crosses above Value1;
Condition2 = Value2 crosses below Value1;

If Condition1 then Buy ("Buy") High + .0625 Stop;
If Condition2 then Sell ("Sell") Low - .0625 Stop;

CANDLE CODE (Victor Likhovidov)

Descrizione: Ottimo indicatore per codificare candlesticks.

Type : Function, Name : CandleCode

inputs: BBLength( numericsimple ),
{ recommended value of input: 55 }
BBNumDevs( numericsimple );
{ recommended value of input: .5 }
variables: BodyHi(0),
BodyLo(0),
Body(0),
UpperShadow(0),
LowerShadow(0),
ThBot_Body(0),
ThTop_Body(0),
ThBot_US(0),
ThTop_US(0),
ThBot_LS(0),
ThTop_LS(0),
ColorCode(0),
BodyCode(0),
USCode(0),
LSCode(0);
BodyHi = MaxList(Open, Close);
BodyLo = MinList(Open, Close);
Body = BodyHi - BodyLo;
UpperShadow = High - BodyHi;
LowerShadow = BodyLo - Low;
ThBot_Body = BollingerBand(Body, BBLength, -BBNumDevs);
ThTop_Body = BollingerBand(Body, BBLength, BBNumDevs);
ThBot_US = BollingerBand(UpperShadow, BBLength, -BBNumDevs);
ThTop_US = BollingerBand(UpperShadow, BBLength, BBNumDevs);
ThBot_LS = BollingerBand(LowerShadow, BBLength, -BBNumDevs);
ThTop_LS = BollingerBand(LowerShadow, BBLength, BBNumDevs);

if Close >= Open
then begin ColorCode = 64;
if Body = 0 then BodyCode = 0 else
if Body < ThBot_Body
then BodyCode = 16 else
if Body < ThTop_Body
then BodyCode = 32 else
BodyCode = 48; end else
begin ColorCode = 0;
if Body = 0 then BodyCode = 48 else
if Body < ThBot_Body then BodyCode = 32 else
if Body < ThTop_Body then BodyCode = 16 else
BodyCode = 0; end; if UpperShadow = 0 then
USCode = 0 else if UpperShadow < ThBot_US then
USCode = 4 else if UpperShadow < ThTop_US then
USCode = 8 else USCode = 12; if
LowerShadow = 0 then LSCode = 3 else if
LowerShadow < ThBot_LS then LSCode = 2 else if
LowerShadow < ThTop_LS then LSCode = 1 else
LSCode = 0;
CandleCode = ColorCode + BodyCode + USCode + LSCode;

Type : Indicator, Name : Candle Code

inputs: BBLength(55),

BBNumDevs(.5),
AvgLength(9);

variables:

CCode(0);
CCode = CandleCode(BBLength, BBNumDevs);

Plot1(CCode, "CCode");
Plot2(Average(CCode, AvgLength), "CCodeAvg");

CHANDE RAVI (Tushar Chande)

Descrizione: Indicatore per identificare la forza del trend.

Type : Indicator, Name : Chande's RAVI

{Chande's RAVI}
{Indicator}
Value1= average(close,7);
value2=average(close,65);
value3 = absvalue(100 * (value1 - value2) / value2);

plot1 (value3, "RIVA");
plot2( 3 , "3%");

RIPORTARE CHIUSURA DA UN GIORNO ALL'ALTRO

Type : Indicator, Name : Close From One Day To The Next


Plot1(close[1], "open") ;
Plot2(IFF(close > close[1] , close ,close[1] ) , "high " );
Plot3(IFF(close > close[1] , close[1] , close ) , " low " );
Plot4(close , "close " );

CONFLUENCE

Descrizione: Indicatore per identificare i cicli.

Type : Function, Name : DerivativeMA

{ Function: DerivativeMA -- used by Confluence function }

Inputs: Price(numeric), Length(Numeric);
VARS: DERIV(0),SUMD(0),LENG2(0),N1(0),DR(0);
DERIV= (AVERAGE(Price,Length)*2) - AVERAGE(Price,Length)[1];
SUMD=Length*DERIV;
LENG2=length - 1 ;
N1= (AVERAGE(Price,LENG2))*LENG2;
DR=SUMD-N1;
DerivativeMA = DR;

Type : Function, Name : Confluence

{Function: Confluence
Returns a value from -9 to +9.
-9 to -1: bearish
-0.9 to +0.9: "yellow"
1 to 9: bullish

Input: price(Numeric),Harmonic(Numeric);

vars: STL(0),ITL(0),LTL(0),HOFF(0),SOFF(0),IOFF(0),LTOFF(0),Phase(1);
vars: mtl(0),momsig(0),mom(0),HT(0),HTA(0);
vars: ST(0),STA(0),IT(0),ITA(0),SUM(0),ERR(0),ERRSUM(0),ERRSIG(0),TC(0),TCSIG(0);
vars: ERRNUM(0),MOMNUM(0),TCNUM(0);
Vars: Havg(0), Savg(0), Iavg(0), Lavg(0);

{Calculate Lengths}
if (BarNumber = 1) then begin
MTL=harmonic/2;
STL= IntPortion((harmonic*2)-1); {11}
ITL= IntPortion((STL*2)-1); {21}
LTL= IntPortion((ITL*2)-1); {41}

HOFF=intportion(harmonic/2); {3}
SOFF=intportion(STL/2); {5}
IOFF=intportion(ITL/2); {10}
LTOFF=intportion(LTL/2); {20}
end;

{ Averages }

Havg = average(price, Harmonic);
Savg = average(price, STL);
Iavg = average(price, ITL);
Lavg = average(price, LTL);

{Cycle Momentum}

value2 = Savg - Havg[HOFF];
value3 = Iavg - Savg[SOFF];
value12 = Lavg - Iavg[IOFF];

momsig = value2 + value3 + value12; {Momentum Signal Line}

value5= ((summation(price,harmonic-1) + derivativema(price,harmonic))/harmonic);
value6= ((summation(price,STL-1) + derivativema(price,STL))/STL);
value7= ((summation(price,ITL-1) + derivativema(price,ITL))/ITL);
value13=((summation(avgprice,LTL-1) + derivativema(price,LTL))/LTL);

value9 = value6 - value5[HOFF];
value10=value7 - value6[SOFF];
value14=value13 - value7[IOFF];
mom = value9 + value10 + value14;

{ harmonic =6 was 5 may use harmonic -1 }
{
HT= sine((summation(price,(harmonic-1))+derivativema(price,harmonic))/harmonic) +
cosine((summation(price,(harmonic-1))+derivativema(price,harmonic))/harmonic);
}
HT = sine(value5) + cosine(value5);
HTA= sine(Havg) + cosine(Havg);

{
ST= sine((summation(price,(STL-1))+derivativema(price,STL))/ STL) +
cosine((summation(Price,(STL-1))+derivativema(Price,STL))/STL);
}
ST = sine(value6) + cosine(value6);
STA = sine(Savg) + cosine(Savg);

{
IT= sine((summation(price,(ITL-1))+derivativema(c,ITL))/ITL) +
cosine((summation(price,(ITL-1))+derivativema(Price,ITL))/ITL);
}
IT = sine(value7) + cosine(value7);
ITA=sine(Iavg)+ cosine(Iavg);

Sum= HT+ST+IT; {Est in Cyc Estimator/ Cycle Est Err = Sum - Err }
Err =HTA + STA +ITA;

{phase detect}

Condition2= (Sum > Sum[SOFF]
and Havg < Havg[SOFF])
OR (Sum < Sum[SOFF]
and Havg > Havg[SOFF]) ;
Phase=1;
if Condition2 then Phase=-1;

ErrSum = (Sum - Err)*phase; { ERROR OF THE CYCLE}
ErrSig=average(ErrSum,SOFF); { ERROR SIGNAL LINE}

{Trend Catcher}

value68=value5;
{( (summation(price,(harmonic-1)) + derivativema(price,harmonic)) / harmonic );}
value69=value13;
{( (summation(avgprice,(LTL-1)) + derivativema(price,LTL)) / LTL );}

value70 = value68-value69; { EST W Der}
value71 = average(value70,Harmonic);

TC =value70;
TCSig=value71;

{Begin Counting Bars}

If ErrSum > 0 then begin
if Errsum < ErrSum[1] and ErrSum < ErrSig then ErrNum=1;
If ErrSum <ErrSum[1] and ErrSum >ErrSig then ErrNum=2;
If ErrSum>ErrSum[1] and ErrSum<ErrSig then ErrNum=2;
If ErrSum > ErrSum[1] and ErrSum> ErrSig then ErrNum=3;
End;
If ErrSum < 0 then begin
if Errsum > ErrSum[1] and ErrSum > ErrSig then ErrNum=-1;
If ErrSum <ErrSum[1] and ErrSum >ErrSig then ErrNum=-2;
If ErrSum>ErrSum[1] and ErrSum<ErrSig then ErrNum=-2;
If ErrSum < ErrSum[1] and ErrSum< ErrSig then ErrNum=-3;
End;

If Mom > 0 THEN begin
if mom < mom[1] and mom < momsig then momNum=1;
If mom <mom[1] and mom >momsig then momNum=2;
If mom>mom[1] and mom<momsig then momNum=2;
If mom > mom[1] and mom> momSig then momNum=3;
End;
If mom < 0 then begin
if mom > mom[1] and mom > momSig then momNum=-1;
If mom <mom[1] and mom >momSig then momNum=-2;
If mom>mom[1] and mom<momSig then momNum=-2;
If mom < mom[1] and mom< momSig then momNum=-3;
End;

If TC > 0 THEN begin
if TC < TC[1] and TC < TCsig then TCNum=1;
If TC <TC[1] and TC >TCsig then TCNum=2;
If TC>TC[1] and TC<TCsig then TCNum=2;
If TC > TC[1] and TC> TCSig then TCNum=3;
End;
If TC < 0 then begin
if TC > TC[1] and TC > TCSig then TCNum=-1;
If TC <TC[1] and TC >TCSig then TCNum=-2;
If TC>TC[1] and TC<TCSig then TCNum=-2;
If TC < TC[1] and TC< TCSig then TCNum=-3;
End;

value42= ErrNum + MomNum+TCNum;

Confluence = 0;
IF value42 >0 and TC >0 THEN Confluence = Value42; { Bullish }
IF value42<0 and TC < 0 THEN Confluence = Value42; { Bearish }
If (value42 > 0 and tc <0) or (value42 <0 and tc>0) then Confluence = Value42 / 10;

Type : Indicator, Name : Confluence

{ Indicator: Confluence }
Input: price(close),Harmonic(10);
Vars: Conf(0);
Conf = Confluence(price, Harmonic);
IF Conf >= 1 THEN Plot1(Conf, "Bull");
IF Conf <= -1 THEN Plot2(Conf,"Bear");
If (Conf = 0) then Plot4(0,"ZERO")
else If (Conf > -1) and (Conf < 1) then Plot3(10*Conf, "Yellow");


Type : Signal, Name : Confluence

{**** System: Confluence ****}

Inputs:

Price: Price to use in the Confluence calculations.

Harmonic: Seems to be an estimate of the dominant cycle length?

Trigger: System buys/sells Trigger points above/below the bar where Confluence goes bullish/bearish. When the Confluence drops out of bullish/bearish mode, the system sets an exit stop Trigger points below Low / above High.

AggStops: If true, the system tightens its stops if the market moves in your direction. E.g. if High is 1000 and Trigger is 2, initial long stop is set at 1002. If the next bar has a high of 999, stop is moved to 999. }

{ These default input values seem to work well on 30-min SPX }

inputs: Price(Close), Harmonic(4), Trigger(5), AggStops(False);

Vars: Conf(0), Signal(0), Lstop(99999), Lexit(0), Sstop(0), Sexit(99999);

{ Is the indicator in bull/bear mode? }

Conf = Confluence(Price, Harmonic);
Signal = 0;
if (Conf >= 1) then Signal = 1; {bull}
if (Conf <= -1) then Signal = -1; {bear}

{ Set entry stops when indicator first moves into bull/bear mode }

if (Signal = 1) and (Signal[1] <> 1) then begin
Lstop = High + Trigger;
Lexit = 0;
end;
if (Signal = -1) and (Signal[1] <> -1) then begin
Sstop = Low - Trigger;
Sexit = 99999;
end;

{ Set exit-position stops when indicator leaves bull/bear state }

if (Signal <> 1) and (Signal[1] = 1) then begin
Lexit = Low - Trigger;
Lstop = 99999;
end;
if (Signal <> -1) and (Signal[1] = -1) then begin
Sexit = High + Trigger;
Sstop = 0;
end;

{ Aggressive stops: move them if mkt moves in our direction }

if AggStops then begin
if (Lstop <> 99999) then Lstop = MinList(Lstop, High + Trigger);
if (Lexit <> 0) then Lexit = MaxList(Lexit, Low - Trigger);
if (Sstop <> 0) then Sstop = MaxList(Sstop, Low - Trigger);
if (Sexit <> 99999) then Sexit = MinList(Sexit, High + Trigger);
end;

{ Clear stops when our price is hit }

if (H > Lstop) then Lstop = 99999;
if (L < Lexit) then Lexit = 0;
if (L < Sstop) then Sstop = 0;
if (H > Sexit) then Sexit = 99999;

{ Issue the buy/sell order on each bar until price is hit }

if (Lstop <> 99999) then buy at Lstop stop;
if (Lexit <> 0) then exitlong at Lexit stop;
if (Sstop <> 0) then sell at Sstop stop;
if (Sexit <> 99999) then exitshort at Sexit stop;

COSINE (John Elhers)

Descrizione: Calcolo coseno, utile nella identificazione dei cicli.

Type : Indicator, Name : Cosine IFM

Inputs: Price((H+L)/2);

Vars: Imult(.635),
Qmult (.338),
S2(0),
S3(0),
count(0),
DeltaPhase(0),
InstPeriod(0),
Period(0);

If CurrentBar > 5 then begin
Value1 = Price - Price[7];
S2 = .2*(Value1[1] + Value1)*(Value1[1] + Value1) + .8*S2[1];
S3 = .2*(Value1[1] - Value1)*(Value1[1] - Value1) + .8*S3[1];
If S2 <> 0 then Value2 = (SquareRoot(S3 / S2));
If S3 <> 0 then DeltaPhase = 2* ArcTangent(Value2);

{Sum DeltaPhases to reach 360 degrees. The sum is the instantaneous period.}
InstPeriod = 0;
Value4 = 0;
For count = 0 to 50 begin
Value4 = Value4 + DeltaPhase[count];
If Value4 > 360 and InstPeriod = 0 then begin
InstPeriod = count -1;
end;
end;

{Resolve Instantaneous Period errors and smooth}
If InstPeriod = 0 then InstPeriod = InstPeriod[1];
Period = .25*InstPeriod + .75*Period[1];

Plot1(Period, "DC");

end;

CONSECUTIVE CLOSE SYSTEM

Descrizione: Sistema basato sulla consecutività delle chiusure.

Type : System, Name : ConsCloseSys

Input: LEConsec(4),SEConsec(4);
if MRO (close <= Close[1],LEConsec,1)= -1 then
buy ("LE1") tomorrow at lowest (h,4) stop;
if MRO (close >= Close[1],SEConsec,1)= -1 then
sell ("SE1") tomorrow at highest (l,4) stop;
{
if marketposition=1 then exitlong ("LX1")
from entry ("LE1") att highest(l,4)[1]limit;
if marketposition=-1 then exitshort ("sX1")
from entry ("SE1") att lowest(h,4)[1]limit;}


if BarsSinceEntry >0 then exitlong ("LX2") from entry ("LE1")
at$ low - 2 points stop;
if barsSinceEntry >0 then exitshort ("SX2") from entry ("SE1")
at$ high + 2 points stop;

DBS BREAK

Descrizione: Sistema basato su breakout e volatilità.

Type : Indicator, Name : DBS-Break

Inputs: Ceil(60), Flr(20);

Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0),
EntryL(0), EntryS(0), ExitL(0), ExitS(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar = 1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

EntryL = Highest(High, VarA);
EntryS = Lowest(Low, VarA);
ExitL = Lowest(Low, VarB);
ExitS = Highest(High, VarB);

Plot1(EntryL, "EntryL");
Plot2(EntryS, "EntryS");
Plot3(ExitL, "ExitL");
Plot4(ExitS, "ExitS");

Type : Signal, Name: DBS-Break

Inputs: Ceil(60), Flr(20);

Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar =1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB=VarA * 0.5;

Buy tomorrow at Highest(High, VarA) Stop;
Sell tomorrow at Lowest(Low, VarA) Stop;
ExitLong tomorrow at Lowest(Low, VarB) Stop;
ExitShort tomorrow at Highest(High, VarB) Stop;

DBS WHERE

Descrizione: Oscillatore.

Type : Indicator, Name: DBS-Where

Inputs: Ceil(60), Flr(20);

Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0),
TopB(0), LowB(0), Where(0), WhereH(0), WhereL(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar = 1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

TopB = Highest(High, VarA)[1];
LowB = Lowest(Low, VarA)[1];
WhereH = (High - LowB) * 100 / (TopB - LowB);
Where = (Close - LowB) * 100 / (TopB - LowB);
WhereL = (Low - LowB) * 100 / (TopB - LowB);

If WhereH > 67 Then Where = WhereH;
If WhereL < 33 Then Where = WhereL;

Plot1(Where, "%-Where");
Plot2(100, "Upper");
Plot3(0, "Lower");

DBS DAY

Descrizione: Indicatore di entrata.

Type : Indicator, Name : DBS-Day

Inputs: Ceil(60), Flr(20);

Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar = 1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

Plot1(VarA, "Entry");

DISTANCE COEFFICIENT EHLERS FILTER (John Elhers)

Descrizione: Calcola la differenza quadrata tra il prezzo di oggi contro x giorni fà.

Type : Indicator, Name : Distance Coefficient Ehlers Filter

Inputs: Price((H+L)/2),
Length(15);

Vars: count(0),
LookBack(0),
SumCoef(0),
Num(0),
Filt(0);

Array: Coef[25](0),
Distance2[25](0);

For count = 0 to Length - 1 begin
Distance2[count] = 0;
For LookBack = 1 to Length begin
Distance2[count] = Distance2[count] + (Price[count] - Price[count
+ LookBack])*(Price[count] - Price[count + LookBack]);
end;
Coef[count] = Distance2[count];
end;
Num = 0;
SumCoef =0;
For count = 0 to Length -1 begin
Num = Num + Coef[count]*Price[count];
SumCoef = SumCoef + Coef[count];
end;
If SumCoef <> 0 then Filt = Num / SumCoef;

Plot1(Filt, "Ehlers");

DOUBLE SMOOTHED EXPONENTIAL MOVING AVERAGE

Descrizione: Calcola la media mobile esponenziale filtrata.

Type : Indicator, Name : Double Smoothed Exponential Moving Average

Inputs:
Price(Close),
Length(30);

Vars:
X1(0),
X2(0),
Dema1(0);

X1= XAverage(Price,Length);
X2= XAverage(XAverage(Price,Length),Length);

DEMA1 = X1 * 2 - X2;

Plot1(Dema1, "DEMA1");

DBS MARCH SYSTEM

Type : Signal,DBS March

Inputs: Ceil(60), Flr(20),
{Additional inputs}
TStop1(0), StopB1(999), StopV1(0),
TStop2(0), StopB2(999), StopV2(0),
TAdd3(0), AddB3(999), TStop3(0), StopB3(999), Alpha3(0), Beta3(0),
TAdd4(0), AddV4(0), TStop4(0), StopV4(0), Alpha4(0), Beta4(0);

Var: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0), Pos(0), OpLoss(0), OpPro(0), BottDay(0), PeakDay(0),
{Additional variables}
Trigger(0), MaxReg(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar =1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

Buy ("Go Long") tomorrow at Highest(High, VarA) Stop;
Sell ("Go Short") tomorrow at Lowest(Low, VarA) Stop;
ExitLong ("Exit Long") tomorrow at Lowest(Low, VarB) Stop;
ExitShort ("Exit Short") tomorrow at Highest(High, VarB) Stop;

{Additional trading}

If BigPointValue <> 0 and EntryPrice <> 0 Then Begin
Trigger = (PositionProfit/BigPointValue) * 100 / EntryPrice;
MaxReg = (MaxPositionProfit/BigPointValue) * 100 / EntryPrice;
End;

If TStop1 = 1 Then Begin
If BarsSinceEntry >= StopB1 and Trigger < StopV1 Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 1") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 1") tomorrow at Open Stop;
End;
End;

If TStop2 = 1 Then Begin
If BarsSinceEntry >= StopB2 and Trigger < StopV2 Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 2") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 2") tomorrow at Open Stop;
End;
End;

If TAdd3 = 1 Then Begin
If BarsSinceEntry >= AddB3 and
Trigger Crosses Over (Alpha3 + Beta3 * BarsSinceEntry) Then Begin
If MarketPosition = 1 Then
Buy ("Add Long 3") tomorrow at Open Stop;
If MarketPosition = -1 Then
Sell ("Add Short 3") tomorrow at Open Stop;
End;
End;

If TStop3 = 1 Then Begin
If BarsSinceEntry >= StopB3 and
Trigger Crosses Under (Alpha3 + Beta3 * BarsSinceEntry) Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 3") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 3") tomorrow at Open Stop;
End;
End;

If TAdd4 = 1 Then Begin
If MaxReg >= AddV4 and
Trigger Crosses Over (Alpha4 + Beta4 * MaxReg) Then Begin
If MarketPosition = 1 Then
Buy ("Add Long 4") tomorrow at Open Stop;
If MarketPosition = -1 Then
Sell ("Add Short 4") tomorrow at Open Stop;
End;
End;

If TStop4 = 1 Then Begin
If MaxReg >= StopV4 and
Trigger Crosses Under (Alpha4 + Beta4 * MaxReg) Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 4") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 4") tomorrow at Open Stop;
End;
End;

{End additional trading}

Pos = MarketPosition;
OpLoss = MaxPositionLoss;
OpPro = MaxPositionProfit;

If OpLoss < OpLoss[1] And Pos <> 0 Then
BottDay = BarsSinceEntry;

If OpPro > OpPro[1] And Pos <> 0 Then
PeakDay = BarsSinceEntry;

{Percentage export}

If CurrentBar = 1 Then
Print(File("c:\Ua\Systems\Exam.txt"),"EntryDate",",","EntryPrice",",",
"MarketPosition",",","MaxPositionLoss",",","BottomDay",",",
"MaxPositionProfit",",","PeakDay",",","PositionProfit",",","LengthOfTrade");

If Pos <> Pos[1] And Pos[1] <> 0 Then
Print(File("c:\Ua\Systems\Exam.txt"),EntryDate(1),",",EntryPrice(1),",",
MarketPosition(1),",",(MaxPositionLoss(1)/BigPointValue)*100/EntryPrice(1),
",",BottDay,",",(MaxPositionProfit(1)/BigPointValue)*100/EntryPrice(1),
",",PeakDay,",",(PositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",
BarsSinceEntry(1));

{End percentage export}

DBS 9.2 SYSTEM

Type : Signal,DBS 9.2

Inputs: Ceil(60), Flr(20);

Var: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0), Pos(0),
OpLoss(0), OpPro(0), BottDay(0), PeakDay(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar =1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

Buy ("Go Long") tomorrow at Highest(High, VarA) Stop;
Sell ("Go Short") tomorrow at Lowest(Low, VarA) Stop;
ExitLong ("Exit Long") tomorrow at Lowest(Low, VarB) Stop;
ExitShort ("Exit Short") tomorrow at Highest(High, VarB) Stop;

Pos = MarketPosition;
OpLoss = MaxPositionLoss;
OpPro = MaxPositionProfit;

If OpLoss < OpLoss[1] And Pos <> 0 Then
BottDay = BarsSinceEntry(0);

If OpPro > OpPro[1] And Pos <> 0 Then
PeakDay = BarsSinceEntry(0);

If CurrentBar = 1 Then
Print(File("c:\Ua\Systems\Exam.txt"),"EntryDate",",","EntryPrice",",",
"MarketPosition",",","MaxPositionLoss",",","BottomDay",",",
"MaxPositionProfit",",","PeakDay",",","PositionProfit",",","LengthOfTrade");

If Pos <> Pos[1] And Pos[1] <> 0 Then
Print(File("c:\Ua\Systems\Exam.txt"),EntryDate(1),",",EntryPrice(1),","
,MarketPosition(1),",",
(MaxPositionLoss(1)/BigPointValue)*100/EntryPrice(1),",",BottDay,",",
(MaxPositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",PeakDay,",",
(PositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",BarsSinceEntry(1));

DELAYED CHANNEL BREAKOUT SYSTEM

Descrizione: Sistema breakout che posticipa l'entrata.

Type : Signal, Name : Delayed Channel Breakout

{--This Breakout system will only enter if we have waited "X_Bars" after a
Breakout and we are still above/below the BO price. ----}

Input:
Len(13),
X_Bar(6);
vars:
HighBO(false),
LowBO(false),
x(0),
HighBOPrice(0),
LowBOPrice(0);

HighBOPrice = Highest(high,Len)[1];
LowBOPrice = Lowest(low,Len)[1];

HighBO = high > HighBOPrice;
LowBO = low < LowBOPrice;

if HighBO[X_Bar] then Buy at HighBOPrice[X_Bar] + 1 point stop;
if LowBO[X_Bar] then Sell at LowBOPrice[X_Bar] - 1 point stop;

REVERSAL MOVAVG  SYSTEM 

Descrizione: Sistema reversal basato su medie mobili.

Type:Signal, RevMovAvg Sys

Input: Lenght1(3),Lenght2(7),Lenght3(25);

if (average (close,Lenght1) [3] < average (close,Lenght2) [5] or
average (close,Lenght2) [5] < average (close,Lenght3) [5] ) and
(average (close,Lenght1) > average (close,Lenght2) and
(average (close,Lenght2) > average (close,Lenght3)))
Then buy at (average (close,Lenght1) [3]) limit;

if (average (close,Lenght1) [3] > average (close,Lenght2) [5] or
average (close,Lenght2) [5] > average (close,Lenght3) [5] ) and
(average (close,Lenght1) < average (close,Lenght2) and
(average (close,Lenght2) < average (close,Lenght3)))
Then sell at (average (close,Lenght1) [3]) limit;

DIVERGENCE SYSTEM

Descrizione: Sistema basato su divergenze con oscillatori.

Type : Signal, Name : Divergence

Input: Osc(RSI(Close,14));

IF BullishDivergence(Close,Osc,2,30) = 1
Then Buy Highest(High,5) + 1 point Stop;

IF BearishDivergence(Close,Osc,2,30) = 1
Then Sell Lowest(Low,5) - 1 point Stop;

DOUBLE ADAPTIVE PROFIT TARGET SYSTEM (Chuck LeBeau)

Descrizione: Utilizza volatilità e trend per fissare i target.

Type : Signal, Name : Doubly Adaptive Profit Targets

Vars:
TrendIndicator(0),
RiskReward(0);

If ADX(14) > ADX(14)[1] Then TrendIndicator = 4;
If ADX(14) <= ADX(14)[1] Then TrendIndicator = 2;

Condition1 = MarketPosition = 0
and Close > Average(Close, 50)
and Open Tomorrow > High
and TrendIndicator = 4;

If Condition1 Then Begin
Buy Tomorrow at High Limit;
RiskReward = AvgTrueRange(20);
End;

If MarketPosition = 1 Then Begin
ExitLong ("Profit") Tomorrow at (EntryPrice + RiskReward * TrendIndicator)
Limit;
ExitLong ("Loss") Tomorrow at (EntryPrice - RiskReward * TrendIndicator)
Stop;
If Close < Average(Close, 50) Then ExitLong ("Trend") at Market;
End;

DOUBLE TOPBOTT SYSTEM (Murray Ruggiero)

Descrizione: Utilizza double top/bottom per i segnali di entrata.

Type : Function, Name : Choose3

inputs: val1(numeric),
val2(numeric),
val3(numeric),
ref(numeric);

if minlist(absvalue(ref - val1), absvalue(ref - val2),
absvalue(ref - val3)) = absvalue(ref - val1) then choose3 = 0;

if minlist(absvalue(ref - val1), absvalue(ref - val2),
absvalue(ref - val3)) = absvalue(ref - val2) then choose3 = 1;

if minlist(absvalue(ref - val1), absvalue(ref - val2),
absvalue(ref - val3)) = absvalue(ref - val3) then choose3 = 2;

Type : Function, Name : DoubleTopBot

inputs: strntype(numeric),
topbot(numeric),
near(numeric),
win(numeric);

vars: trend(0),
shttrend(0),
ltrend(0),
dntrend(false),
uptrend(false),
curlo(999999),
curhi(-99999),
ctlow(0),
cthi(0),
scale(0),
curhdt(0),
curldt(0);

arrays: lasth[3](0),
lastlo[3](0),
dateh[3](0),
datelo[3](0);

if strntype = 0 then begin
dntrend = high < high[1] and low < low[1];
uptrend = high > high[1] and low > low[1];
end;

if strntype = 1 then begin
dntrend = high < high[1] and low < low[1] and high[1] < high[2] and low[1] < low[2];
uptrend = high > high[1] and low > low[1] and high[1] > high[2] and low[1] > low[2];
end;

if dntrend = true and low <= ctlow then shttrend = -1;
if uptrend = true and high >= cthi then shttrend = 1;
if shttrend = 1 and high > curhi and high > high[1] then ctlow = low;
if shttrend = -1 and low < curlo and low < low[1] then cthi = high;

if shttrend = -1 and curlo > low then begin
curlo = low;
curldt = datetojulian(date);
end;

if shttrend = 1 and shttrend[1] <> 1 then begin
lastlo[2] = lastlo[1];
lastlo[1] = lastlo[0];
lastlo[0] = curlo;
curlo = low;
datelo[2] = datelo[1];
datelo[1] = datelo[0];
datelo[0] = curldt;
end;

if shttrend = -1 and shttrend[1] <> -1 then begin
lasth[2] = lasth[1];
lasth[1] = lasth[0];
lasth[0] = curhi;
curhi = high;
dateh[2] = dateh[1];
dateh[1] = dateh[0];
dateh[0] = CurHDt;
end;

doubletopbot = 0;
if topbot = 0 then value1 = choose3(lastlo[0], lastlo[1], lastlo[2], low);
if topbot = 1 then value1 = choose3(lasth[0], lasth[1], lasth[2], high);

if topbot = 0 then begin
if minlist(absvalue(low - lastlo[0]), absvalue(low - lastlo[1]),
absvalue(low - lastlo[2])) < near * average(truerange, 3) and
datetojulian(date) - datelo[value1] > win and low > low[1] then doubletopbot = 1;
end;

if topbot = 1 then begin
if minlist(absvalue(high - lasth[0]), absvalue(high - lasth[1]),
absvalue(high - lasth[2])) < near * average(truerange, 3) and
datetojulian(date) - dateh[value1] > win and high < high[1] then doubletopbot = 1;
end;

Type : Signal, Name : DoubleTopBot System

inputs: near(0.45),
dist(6);

if (doubletopbot(0, 0, near, dist) = 1 or
doubletopbot(0, 0, near, dist)[1] = 1) and
close < open then buy open;

if barssinceentry > 3 then exitlong open;

DUAL TIME FRAME MOVING AVERAGE SYSTEM

Descrizione: Utilizza due time frames e segnali con medie mobili.

Type : Signal, Name : Dual Time Frame Moving Average

Inputs:
Price(Close),
Length(13);

IF XAverage(Price,Length) > XAverage(Price,Length)[1] and
XAverage(Price,Length) of data2 > XAverage(Price,Length)[1] of data2
then Buy this bar on Close;

IF XAverage(Price,Length) < XAverage(Price,Length)[1]
then ExitLong this bar on Close;

IF XAverage(Price,Length) < XAverage(Price,Length)[1] and
XAverage(Price,Length) of data2 < XAverage(Price,Length)[1] of data2
then Sell this bar on Close;

ELHERS FILTER (John Elhers)

Descrizione: Filtro utilizzato nella costruzione dei cicli

Type : Indicator, Name : Ehlers Filter

inputs:
Coef( AbsValue( MedianPrice - MedianPrice[5] ) ),
Price( MedianPrice ),
Length( 15 ) ;

variables:
Num( 0 ),
SumCoef( 0 ),
Count( 0 ),
Filt( 0 ) ;

Num = 0 ;
SumCoef = 0 ;

for Count = 0 to Length - 1
begin
Num = Num + Coef[Count] * Price[Count] ;
SumCoef = SumCoef + Coef[Count] ;
end ;

if SumCoef <> 0 then
Filt = Num / SumCoef ;

Plot1( Filt, "Ehlers" ) ;

Type : Function, Name : DistanceSqrd

inputs:
Price( numericseries ),
Length( numericsimple ) ;

variables:
DSqrd( 0 ),
LookBack( 0 ) ;

DSqrd = 0 ;
for LookBack = 1 to Length
begin
DSqrd = DSqrd + Square( Price - Price[LookBack] ) ;
end ;
DistanceSqrd = DSqrd ;

EVWMA (Christian Fries)

Descrizione: Costruisce una media mobile elastica che incorpora il volume.

Type : Indicator, Name : eVwma

inputs:
Price( Close ),
VolumeDivisor( 1 ),
N( 100000 ) ;

variables:
eVWMA( 0 ),
ScaledVol( 0 ),
VolDiff( 0 ),
Violation( false ) ;

if CurrentBar = 1 then
eVWMA = Price

else
begin
ScaledVol = Volume / VolumeDivisor ;
VolDiff = N - ScaledVol ;
if VolDiff < 0 and Violation = false then
Violation = true ;
if Violation = true then
eVWMA = eVWMA[1]

else
eVWMA = ( VolDiff * eVWMA[1] + ScaledVol * Price ) / N ;
end ;

Plot1( eVWMA ) ;

PERCVOL BREAKOUT SYSTEM

Descrizione: Basato su range breakout.

Type : PctVol Bkout Sys


Inputs: Lenght1(1);
Inputs: Lenght2(1.8);

{----- Long Entry -----}

Buy Next Bar at C + Range * Lenght1 Stop;

{----- Long Exit ------}

if MarketPosition=1
Then ExitLong next bar at (C-range * Lenght2) Stop;

{----- Stops -----


Close all Trades at end of day session }

HILO BREAKOUT SYSTEM

Descrizione: Basato su breakout high/low.

Type : Signal, Name : HiLo Bkout Sys

If Low of Today < Lowest(Low,3)[3]
Then buy tomorrow at @Highest(high,3)[1] Stop;

If High of Today < Highest(High,3)[3]
Then sell tomorrow at @Lowest(low,3)[1] Stop;

FIRST 2 HOURS CHANNEL SYSTEM

Descrizione: Basato su breakout high/low delle prime due ore.

Type : Signal, Name : First 2 Hour Channel System

INPUT:
BEGINCH(SESS1STARTTIME),
ENDCH(1300);

{ 1300 IS AN EXAMPLE }

VARS:CH(H),CL(L);

IF TIME = BEGINCH + BARINTERVAL THEN BEGIN
CH = H;
CL = L;
END;

IF TIME >= BEGINCH AND TIME <= ENDCH THEN BEGIN
IF H > CH THEN CH = H;
IF L < CL THEN CL = L;
END;

IF TIME > ENDCH AND DATE = DATE TOMORROW THEN BUY AT CH STOP;
IF TIME > ENDCH AND DATE = DATE TOMORROW THEN SELL AT CH STOP;

HILO MT BREAKOUT SYSTEM

Descrizione: Basato su breakout di medio termine.

Type : Signal, Name : HiLo MT Bkout Sys

Input: Lenght(220);

if CurrentBar > 1 and Close > Highest(High,Lenght)[1]

Then Buy on Close;

if CurrentBar > 1 and Close < Lowest(Low,Lenght)[1]

Then Sell on Close

{Close all trades at end of day session}

GAP TRADING (Stephane Reverre)

Descrizione: Indicatore che evidenzia gaps.

Type : Indicator, Name: Gap-Trading

inputs:
gap_up(1),
gap_down(1);
variables: gap(0);

gap = 100*(open - close[1])/close[1];

if gap >= gap_up
then begin
if close <= open
then Plot1(high, "UpGap", blue)
else Plot1(high, "UpGap", red);

end;

if gap <= -gap_down then begin
if close >= open
then Plot2(low, "DnGap", blue)
else Plot2(low, "DnGap", red);
end;

LONGENTRY CLOSE VIEW SYSTEM

Descrizione: Basato sulla posizione delle chiusure.

Type : Signal,LEC System


Inputs: LEConsec(2);

{-------- Long Entry --------}

If MRO( Close >= Close[1],LEConsec,12) = -1 and O of tomorrow < c
then Buy at market;

{-------- Long Entry --------}

If MarketPosition=1 and O of tomorrow > EntryPrice
then ExitLong at market


{Close all trades at end of day session}

HAMN EGGS

Descrizione: Basato sulla rielaborazione dello stocastico.

Type : Function, Name : HamnEggs

Input:
Price(numericseries),
SlowKLen(numeric),
AvgLen(numeric);

HamnEggs=50-(Average(SlowK(SlowKLen),AvgLen) - SlowK(SlowKLen));

Type : Indicator, Name : HamnEggs

Input:
Price(TypicalPrice),
SlowKLen(10),
AvgLen(14),
SmooLen(14);

Plot1(XAverage(HamnEggs(Price,SlowKLen,AvgLen),SmooLen), "Ham 'n Eggs");

HILBERT CHANNEL BREAKOUT SYSTEM (John Elhers)

Descrizione: Basato sulla funzione dei cicli di Hilbert e breakout.

Type : Function, Name : HilbertPeriod

Inputs: Price(numeric);

Vars: Smoother(0), Detrender(0), I1(0), Q1(0), jI(0), jQ(0), I2(0),Q2(0), X1(0),
X2(0), Y1(0), Y2(0), Re(0), Im(0), Period(0);

If CurrentBar >5 then begin
Smoother = (4*Price + 3*Price[1] + 2*Price[2] + Price[3])/10;
Detrender = (.25*Smoother + .75*Smoother[2] - .75*Smoother[4] -
.25*Smoother[6])*(.046*Period[1] + .332);

{Compute InPhase and Quadrature components}
Q1 = (.25*Detrender + .75*Detrender[2] - .75*Detrender[4] -
.25*Detrender[6])*(.046*Period[1] + .332);
I1 = Detrender[3];

{advance the phase of I1 and Q1 by 90 degrees}
jI = .25*I1 + .75*I1[2] - .75*I1[4] - .25*I1[6];
jQ = .25*Q1 + .75*Q1[2] - .75*Q1[4] - .25*Q1[6];
{Phasor addition to equalize amplitude due to quadrature calculations
(and 3 bar averaging)}
I2 = I1 - jQ;
Q2 = Q1 + jI;

{Smooth the I and Q components before applying the discriminator}
I2 = .15*I2 + .85*I2[1];
Q2 = .15*Q2 + .85*Q2[1];

{Homodyne Discriminator}
{Complex Conjugate Multiply}
X1 = I2*I2[1];
X2 = I2*Q2[1];
Y1 = Q2*Q2[1];
Y2 = Q2*I2[1];
Re = X1 + Y1;
Im = X2 - Y2;

{Smooth to remove undesired cross products}
Re = .2*Re + .8*Re[1];
Im = .2*Im + .8*Im[1];

{Compute Cycle Period}
If Im <> 0 and Re <> 0 then Period = 360/ArcTangent(Im/Re);
If Period > 1.5*Period[1] then Period = 1.5*Period[1];
If Period < .67*Period[1] then Period = .67*Period[1];
If Period < 6 then Period = 6;
If Period > 50 then Period = 50;
Period = .2*Period + .8*Period[1];

{END CORE CODE}

HilbertPeriod = Period;

end;

Type : Signal, Name : Hilbert Channel

{************************************************************
Hilbert_Channel (Signal)

This is the signal for the Hilbert Channel Breakout System.

If "EntryVal" or "ExitVal" have values greater than 0, then
those values will be used for the entry / exit lookback
periods. If either input "EntryVal" or "ExitVal" is 0, then
the entry or exit lookback period will be the product of a
fractional constant times the cycle period, "EntryK*Period"
or "ExitK*Period."

Optimize for highest Total Net Profit / Return on Account:
1. Optimize EntryVal, and then ExitVal. (Optimum values are
often between 10 and 45.)
2. Change ExitVal to 0 and optimize ExitK. (Optimum value
is often between 1.5 and 4.5.)
3. Change EntryVal to 0 and optimize EntryK. (Optimum value
is often between .1 and 1.)
4. Repeat steps 2 and 3 until results of optimizing are
stable.
*********************************************************** }

inputs: Price((H + L)/2),
EntryVal(15),
EntryK(0),
ExitVal(15),
ExitK(0);

vars: Period(0),
count(0),
EntryLookBack(0),
ExitLookBack(0),
EntryChannel(0),
ExitChannel(0);

Period = HilbertPeriod(Price);

If EntryVal <> 0 then EntryLookBack = EntryVal else EntryLookBack = EntryK*Period;
if EntryLookBack < 1 then EntryLookBack = 1;

If ExitVal <> 0 then ExitLookBack = ExitVal else ExitLookBack = ExitK*Period;
if ExitLookBack < 1 then ExitLookBack = 1;

EntryChannel = 0;
for count = 1 to EntryLookBack begin
if EntryChannel < High[count] then EntryChannel = High[count];
end;

ExitChannel = 100000;
for count = 1 to ExitLookBack begin
if ExitChannel > Low[count] then ExitChannel = Low[count];
end;

If MarketPosition = 0 and High > EntryChannel then Buy;
If MarketPosition = 1 and Low < ExitChannel then ExitLong;

#BeginCmtry
var: textString(" flat.");
If CheckCommentary then BEGIN
if MarketPosition = 1 then textString = " long.";
if MarketPosition = 0 then textString = " flat.";
commentary("Market position is", textString, NewLine);
commentary("High is", high, ", channel", EntryChannel, ", lookback",
ceiling(EntryLookBack), " bars.", NewLine);
commentary("Low is", low, ", channel", ExitChannel, ", lookback",
ceiling(ExitLookBack), " bars.", NewLine);
End;
#End;

HILO ACTIVATOR SYSTEM (Robert Krausz)

Descrizione: Basato su una rielaborazione dei segnali di Gann.

Type : Signal, Name : HI LO Activator

Inputs: R(8);
Var: Swing(0);

Value1=Average(H,R);
Value2=Average(L,R);

If C<Value2[1] And C[1]>=Value2[2] then Swing=-1;
If C>Value1[1] And C[1]<=Value1[2] then Swing=1;

If Swing=1 Then Begin
Buy on close;
end;
If Swing=-1 Then Begin
sell on close;
end;


HIGH PERCENTAGE SYSTEM (Michael Bryant)

Descrizione: Basato su posizionamento con metodo Montecarlo.

Type : System, Name : High Percentage Trading System

Input: ASize (30000), { starting account size, $ } DDGoal (50), { max closed out trade drawdown, % } RiskPer (10), { percentage risk per trade } NRand (1000), { number of random sequences } EntFrac (0.75); { multiple of range for entry }

Var: EntPr (0), { Entry target price } XitPr (0), { mm stop exit price } TrRisk (0); { trade risk, $ }

TrRisk = 1000;
EntPr = H + EntFrac * (H - L);
If C > C[1] then Buy next bar at EntPr Stop;
Exitlong("MMStop") next bar at EntryPrice - TrRisk/BigPointValue stop;
If BarsSinceEntry >= 1 and open of next bar > EntryPrice then ExitLong("ProfOpen") next bar at market;
{Value1 = MonteCarlo (ASize, DDGoal, RiskPer, TrRisk, NRand);}{This last line calls the MonteCarlo function, which randomizes thetrades and summarizes the results. Delete it if you don't want theMonteCarlo results.}

HISVOL AND PATTERN SYSTEM (Rascke/Connors)

Descrizione: Popolare sistema tratto dal libro "Street Smarts.

Function: HisVol

INPUTS: LOOKBCK(NumericSimple), ANNUAL(NumericSimple);
Vars: HVol(0), Per(0);
If DataCompression<=2 then Per=1;
If DataCompression=3 then Per=7;

HVol=StdDev(LOG(Close/Close[1]),LOOKBCK)*SquareRoot(ANNUAL/Per);
HisVol= HVol*100;

System: His.Vol w/ Patterns

Vars: HVRatio(0), NR4(False), InBar(False);
HVRatio=(HisVol(6,365)/HisVol(100,365))*100;
NR4=Range=Lowest(Range,4);
InBar=H<H[1] and L>L[1];
If HVRatio <= 50 and (NR4 or InBar) then begin
Buy at High + (1*MinMove points) stop;
Sell at Low - (1*MinMove points) stop;
end;

HIBRYD SYSTEM N. 1

Descrizione: Basato su breakout.

Typ : Signal, Name : Hybrid system No. 1

Inputs: LookBack(9), WhereToBuy(0.5);
Variables: HighValue(0), LowValue(99999), BuyValue(0);

LowValue = Lowest(Low, LookBack);
HighValue = Highest(High, LookBack);

BuyValue = (HighValue - LowValue) * WhereToBuy ;

If MarketPosition = 0 Then Begin
Buy tomorrow at BuyValue + LowValue Stop;

If Close < LowValue[1] Then
ExitLong at Open;

If BarsSinceEntry = 9 and OpenPositionProfit < 0 Then
ExitLong on Open;

End;

KLINGER VOLUME OSCILLATOR (Stephen Klinger)

Type: Function, Name: VForce

Vars: TSum(0), Trend(0), DM(0), CM(0);

TSum = High + Low + Close;
IF TSum > TSum[1] Then

Trend = 1
Else
Trend = -1;
IF Trend = Trend[1] Then
CM = CM + Range
Else
CM = Range + Range[1];
IF CM <> 0 Then
VForce = Volume * AbsValue(2 * (DM/CM) -1) * Trend * 100;

Type: Function, Name: KVO

Inputs:
FastX(Numeric),
SlowX(Numeric);

Vars:
FXAvg(0),
SXAvg(0);

FXAvg = XAverage(VForce, FastX);
SXAvg = XAverage(VForce, SlowX);
KVO = FXAvg - SXAvg;

Type: Indicator, Name: Klinger Volume Oscillator

Inputs:
FastX(34),
SlowX(55),
TrigLen(13),
Smooth(1);

Vars:
Trigger(0);

Trigger = XAverage(KVO(FastX, SlowX), TrigLen);

IF Smooth <= 1 Then Begin
Plot1(KVO(FastX, SlowX), "KVO");
Plot2(Trigger, "KVO Trigger");
End Else Begin

Plot1(Summation(KVO(FastX, SlowX), Smooth), "KVO");
Plot2(Summation(Trigger, Smooth), "KVO Trigger");
End;

Plot3(0, "Zero");
IF Plot1 Crosses Above Plot2 OR Plot1 Crosses Below Plot2 OR
Plot2 Crosses Above Plot3 OR Plot2 Crosses Below Plot3 Then
Alert = True;

WEIGHTED CROSSING AVG SYSTEM

Descrizione: Basato su cross di medie mobili.

Typ : System Wtd CrossAvg Sys

Input: Lenght(2);

If CurrentBar > 1
and Average(C,Lenght*2) crosses over Average(C,Lenght*3)
then Buy Highest(High, Lenght) + 1 point Stop;

If CurrentBar > 1
and Average(C,Lenght*2) crosses below Average(C,Lenght*3)
then Sell Lowest(Low, Lenght) - 1 point Stop;

LONG TERM SYSTEM

Descrizione: Basato su cross di medie mobili.

Type : Signal, Name : Long Trends

inputs:NoDays(21), N(22),MULT1(2), MULT2(2);
vars:valuea(0),valueb(0),valuec(0), VAL1(0), VAL2(0);

valuea=highest(high,NoDays);
valueb=lowest(low,NoDays);
VAL1= Average(VALUEA,NODAYS);
VAL2= Average(VALUEB,NODAYS);

IF VALUEA CROSSES ABOVE VAL1 AND VALUEB > VAL2 THEN BUY ON CLOSE;
IF VALUEB CROSSES ABOVE VAL2 AND VALUEA > VAL1 THEN BUY ON CLOSE;
IF VALUEA CROSSES BELOW VAL1 AND VALUEB < VAL2 THEN SELL ON CLOSE;
IF VALUEB CROSSES BELOW VAL2 AND VALUEA < VAL1 THEN SELL ON CLOSE;

VALUE1 = ((HIGHEST (HIGH, N)) - ((LOWEST (LOW, N))));
VALUE2= VALUE1 * MULT1;
VALUE3= VALUE1 * MULT2;
{VALUE2=TARGET, VALUE3 = STOPLOSS}
IF MARKETPOSITION = 1 THEN BEGIN
EXITLONG TOMORROW AT ENTRYPRICE + VALUE2 LIMIT;
EXITLONG TOMORROW AT ENTRYPRICE - VALUE3 STOP;
END ;
IF MARKETPOSITION = -1 THEN BEGIN
EXITSHORT TOMORROW AT ENTRYPRICE + VALUE3 STOP;
EXITSHORT TOMORROW AT ENTRYPRICE - VALUE2 LIMIT;
END ;

MACD MOMENTUM SYSTEM

Descrizione: Basato su MACD Histogram.

Type : Function, Name : McdMo

Inputs:
R(Numeric),
S(Numeric),
Q(NUmeric),
Dsp(Numeric),
Smth(Numeric);

Vars:
Mo(0),
Avg(0),
Diff(0);

Mo=MACD(C,R,S);
Avg=XAverage(MACD(C,R,S),Q);
Diff=Mo-Avg;
McdMo=Average(Diff-Diff[Dsp],Smth);

Type : Function, Name : MacdDiff

Inputs:
R(Numeric),
S(NUmeric),
Q(Numeric);
Vars: Mac(0),
Avg(0);

Mac=MACD(C,R,S);
Avg=Xaverage(MACD(C,R,S),Q);
MACDDiff=Mac-Avg;

Type : Signal, Name : Macd Momentum

Input:
R(12),
S(26),
Q(9),
Dsp(10),
Smth(3);

Vars:
Mcdif(0),
McdCr(0);

Mcdif=MacdDiff(R,S,Q);{Trigger}
McdCr=McdMo(R,S,Q,Dsp,Smth);{Filter}

Condition1=McdCr<0 and Mcdif crosses below 0;
Condition2=McdCr>0 and Mcdif crosses above 0;
Condition3=McdCr crosses above 0;
Condition4=mcdCr crosses below 0;

If Condition1 then sell 1 contract on close;
If Condition3 then exitshort 1 contract on close;
If Condition2 then buy 1 contract on close;
If Condition4 then exitlong 1 contract on close;

MACD RS RATIO SYSTEM (Gilbert Raff)

Descrizione: Basato sulla Forza Relativa e MACD.

Type : Signal, Name : Macd RS Ratio

Inputs:
R(12),
S(26),
Q(9),
Price(close of data1/close of data2);

Vars:
Mo(0),
Avg(0);

Mo=MACD(Price,R,S);
Avg=Xaverage(MACD(Price,R,S),Q);
Condition1=Mo crosses above 0;
Condition2=Mo crosses below 0;
Condition3=Mo>0;
Condition4=Mo<0;

If Condition1 then buy 1 contract on close;
If Condition2 then sell 1 contract on close;

MOVING AVERAGES WITH RESISTANCE AND SUPPORT SYSTEM (Dennin Tilley)

Descrizione: Coniuga medie mobili e livelli di supporto e resistenza.

Type: Indicator, Name: Mov Avg--Supp/Res

Inputs: Price(Close), Length(10), F(8);
Vars: AvgVal(0), S(0), R(0), SC(0), RC(0);

AvgVal = Average(Price, Length);
RC = RC + 1;
SC = SC + 1;

IF Close Crosses Below AvgVal AND Close > S* (1+(F/100)) AND R <> 0 Then Begin
For value1 = RC-2 TO RC+2 Begin
Plot2[value1](R, "R");
End;
Alert = True;
S = L;
SC = 0;
End
Else Begin
IF Close Crosses Below S AND R <> 0 Then Begin
For value1 = RC-2 TO RC+2 Begin
Plot2[value1](R, "R");
End;
Alert = True;
S = L;
SC = 0;
End;
End;

IF Close Crosses Above AvgVal AND Close < R / (1+(F/100)) AND S <> 0 Then Begin
For value1 = SC-2 TO SC+2 Begin
Plot3[value1](S, "S");
End;
Alert = True;
R = H;
RC = 0;
End
Else Begin
IF Close Crosses Above R AND S <> 0 Then Begin
For value1 = SC-2 TO SC+2 Begin
Plot3[value1](S, "S");
End;
Alert = True;
R = H;
RC = 0;
End;
End;

IF Close > AvgVal Then Begin
IF High >= R Then Begin
R = High;
RC = 0;
End;
End;

IF Close < AvgVal Then Begin
IF Low <= S OR S = -1 Then Begin
S = Low;
SC = 0;
End;
End;

Plot1(AvgVal, "SMA");

Type: System, Name: Mov Avg--Supp/Res

Inputs: Price(Close), Length(10), F(8);
Vars: AvgVal(0), S(0), R(0), SC(0), RC(0);

AvgVal = Average(Price, Length);
RC = RC + 1;
SC = SC + 1;

IF CurrentBar > 1 Then Begin
IF Close Crosses Below AvgVal AND Close > S* (1+(F/100)) AND R <> 0 Then Begin
Sell Next Bar at Market;
S = Low;
SC = 0;
End
Else Begin
IF Close Crosses Below S AND R <> 0 Then Begin
Sell Next Bar at Market;
S = Low;
SC = 0;
End;
End;

IF Close Crosses Above AvgVal AND Close < R / (1+(F/100)) AND S <> 0 Then Begin
Buy Next Bar at Market;
R = High;
RC = 0;
End
Else Begin
IF Close Crosses Above R AND S <> 0 Then Begin
Buy Next Bar at Market;
R = High;
RC = 0;
End;
End;
IF Close > AvgVal Then Begin
IF High >= R Then Begin
R = High;
RC = 0;
End;
End;

IF Close < AvgVal Then Begin
IF Low <= S OR S = -1 Then Begin
S = Low;
SC = 0;
End;
End;
End;

INDICATOR BEYOND CLOSING PRICES (Thomas Stridsman)

Descrizione: Particolare indicatore che utilizza l'intera gamma di prezzi di una barra nel calcolo e non solo la chiusura.

Type : Indicator, Name : 20-day MA of Close-to-Close Price Changes, Added To Closing Price

Inputs:
LookBack(20);
Variable:
PercChange(0),
NewLevel(0),
AvgPercChange(0);

PercChange = (Close - Close[1])/Close[1];
AvgPercChange = Average(PercChange,20);
NewLevel = Close * (1 + AvgPercChange);
Plot1[1](NewLevel,"");

Type : Indicator, Name : Meander Indicator

Inputs:
StDevs(1);
Variable:
StdDevChange(0),
UpLevel(0),
DownLevel(0);
StdDevChange = StdDev(PercChange, 20);
UpLevel = Close * (1 + AvgPercChange + StDevs * StdDevChange);
DownLevel = Close * (1 + AvgPercChange - StDevs * StdDevChange);
Plot2[-1](UpLevel,"");
Plot3[-1](DownLevel,"");

Type : Indicator, Name : HighPercChange

{Percentage Change Between Yesterday's Closing Price and Today's High}

HighPercChange = (High - Close[1])/Close[1];

Type : Indicator, Name : 20-day Price Point MA

Input:
VSStd(1);
Vars:
SumVS(0),
AvgVS(0),
DiffVS(0),
StdVS(0),
SetArr(0),
SumArr(0),
DiffArr(0),
VSLow(0),
VSMid(0),
VSHigh(0);

{First we define the array}

Array: VS[20](0);

{Then we're using a loop function to fill it with the different price changes}

For SetArr = 0 To 4 Begin
VS[SetArr * 4 + 0] = (O[SetArr] - C[SetArr + 1]) / C[SetArr + 1];
VS[SetArr * 4 + 1] = (H[SetArr] - C[SetArr + 1]) / C[SetArr + 1];
VS[SetArr * 4 + 2] = (L[SetArr] - C[SetArr + 1]) / C[SetArr + 1];
VS[SetArr * 4 + 3] = (C[SetArr] - C[SetArr + 1]) / C[SetArr + 1];
End;

For SumArr = 0 To 19 Begin

If SumArr = 0 Then
SumVS = 0;
SumVS = SumVS + VS[SumArr];

If SumArr = 19 Then
{Here we calculate the average price change over the period}
AvgVS = SumVS / 20;

For DiffArr = 0 To 19 Begin

If DiffArr = 0 Then
DiffVS = 0;
{Then we calculate the standard deviation}
DiffVS = DiffVS + Square(VS[DiffArr] - AvgVS);
If DiffArr = 19 Then
StdVS = SquareRoot(DiffVS / 20);

End;

End;

{Finally, we add the moving average (and the standard deviations) to the latest close for an indication of tomorrow'âs trading range}

VSLow = C * (1 + (AvgVS - StdVS * VSStd));
VSMid = C * (1 + AvgVS);
VSHigh = C * (1 + (AvgVS + StdVS * VSStd));

Plot1[-1](VSLow, "VS Low");
Plot2[-1](VSMid, "VS Mid");
Plot3[-1](VSHigh, "VS High");

MOVING AVERAGE 2X20 SYSTEM (David Landry)

Descrizione: Un diverso utilizzo di prezzi e medie mobili.

Type: System, Name: Mov Avg X 2_20

Inputs: Price(Close), AvgLen(20), StpPnts(10);
Vars: AvgVal(0), Buyit(0), Sellit(0);
AvgVal = XAverage(Price, AvgLen);

{Buy/Sell Entry Setup}
IF Lowest(Low, 2) > AvgVal AND Low 1 Bar Ago Crosses Above AvgVal AND
MarketPosition <> 1 Then Begin
Buyit = Highest(High, 2) + StpPnts Points;
Condition1 = True;
End;
IF Highest(High, 2) < AvgVal AND High 1 Bar Ago Crosses Below AvgVal
AND
MarketPosition <> -1 Then Begin
Sellit = Lowest(Low, 2) - StpPnts Points;
Condition2 = True;
End;

{Buy/Sell Entry Orders}
IF Lowest(Low, 2) > AvgVal AND Condition1 Then
Buy Next Bar at Buyit Stop;
IF Highest(High, 2) < AvgVal AND Condition2 Then
Sell Next Bar at Sellit Stop;

{Long/Short Exits}
ExitLong Next Bar at AvgVal Stop;
ExitShort Next Bar at AvgVal Stop;

IF MarketPosition <> 0 Then Begin
Condition1 = False;
Condition2 = False;
End;

MEANDER SYSTEM

Descrizione: Interessante sistema che calcola livelli di entrata basati su OHLC.

Typ : Signal, Name : Meander system v. 1

Vars: SumVS(0),
AvgVS(0),
DiffVS(0),
StdVS(0),
SetArr(0),
SumArr(0),
DiffArr(0),
VSLow(0),
VSMid(0),
VSHigh(0),
RiskReward(0);
Array: VS[20](0);

For SetArr = 0 To 4 Begin
VS[SetArr * 4 + 0] = (Open[SetArr] - AvgPrice[SetArr + 1]) / AvgPrice[SetArr + 1];
VS[SetArr * 4 + 1] = (High[SetArr] - AvgPrice[SetArr + 1]) / AvgPrice[SetArr + 1];
VS[SetArr * 4 + 2] = (Low[SetArr] - AvgPrice[SetArr + 1]) / AvgPrice[SetArr + 1];
VS[SetArr * 4 + 3] = (Close[SetArr] - AvgPrice[SetArr + 1]) / AvgPrice[SetArr + 1];
End;

For SumArr = 0 To 19 Begin
If SumArr = 0 Then
SumVS = 0;
SumVS = SumVS + VS[SumArr];
If SumArr = 19 Then
AvgVS = SumVS / 20;
For DiffArr = 0 To 19 Begin
If DiffArr = 0 Then
DiffVS = 0;
DiffVS = DiffVS + Square(VS[DiffArr] - AvgVS);
If DiffArr = 19 Then
StdVS = SquareRoot(DiffVS / 20);
End;
End;

VSLow = AvgPrice * (1 + (AvgVS - StdVS * 2));
VSMid = AvgPrice * (1 + AvgVS);
VSHigh = AvgPrice * (1 + (AvgVS + StdVS * 2));
If MarketPosition = 0 Then Begin
Buy ("Buy") Tomorrow at VSLow Limit;
RiskReward = VSMid-VSLow;
End;

If MarketPosition = 1 Then
ExitLong ("PT") Tomorrow At VSHigh Limit;
If MarketPosition = 1 Then
ExitLong ("TS") Tomorrow At VSLow Stop;
If Open Tomorrow >= VSLow Then
ExitLong ("SLa") From Entry ("Buy") At (VSLow-(VSMid-VSLow)) Stop;
If Open Tomorrow < VSLow Then
ExitLong ("SLb") From Entry ("Buy") At (Open Tomorrow-(VSMid-VSLow)) Stop;

MEASURE CYCLE PERIOD (John Elhers)

Descrizione: Indicatore che misura l'ampiezza dei cicli. E' una delle basi del MESA System.

Type : Indicator, Name : Measure Cycle Period

Inputs: Price((H+L)/2);

Vars: Imult (.635),
Qmult (.338),
InPhase(0),
Quadrature(0),
Phase(0),
DeltaPhase(0),
count(0),
InstPeriod(0),
Period(0);

If CurrentBar > 5 then begin

{Detrend Price}
Value3 = Price - Price[7];

{Compute InPhase and Quadrature components}
Inphase = 1.25*(Value3[4] - Imult*Value3[2]) + Imult*InPhase[3];
Quadrature = Value3[2] - Qmult*Value3 + Qmult*Quadrature[2];

{Use ArcTangent to compute the current phase}
If AbsValue(InPhase +InPhase[1]) > 0 then Phase = ArcTangent(AbsValue((Quadrature+Quadrature[1]) / (InPhase+InPhase[1])));

{Resolve the ArcTangent ambiguity}
If InPhase < 0 and Quadrature > 0 then Phase = 180 - Phase;
If InPhase < 0 and Quadrature < 0 then Phase = 180 + Phase;
If InPhase > 0 and Quadrature < 0 then Phase = 360 - Phase;

{Compute a differential phase, resolve phase wraparound, and limit delta phase errors}
DeltaPhase = Phase[1] - Phase;
If Phase[1] < 90 and Phase > 270 then DeltaPhase = 360 + Phase[1] - Phase;
If DeltaPhase < 1 then DeltaPhase = 1;
If DeltaPhase > 60 then Deltaphase = 60;

{Sum DeltaPhases to reach 360 degrees. The sum is the instantaneous period.}
InstPeriod = 0;
Value4 = 0;
For count = 0 to 50 begin
Value4 = Value4 + DeltaPhase[count];
If Value4 > 360 and InstPeriod = 0 then begin
InstPeriod = count;
end;
end;

{Resolve Instantaneous Period errors and smooth}
If InstPeriod = 0 then InstPeriod = InstPeriod[1];
Period = .25*(InstPeriod) + .75*Period[1];

Plot1(Period, "DC");
end;

HL ROC BREAKOUT

Descrizione: Basato su ROC e breakout.

Typ : System, Name : HL Roc Breakout Sys

Inputs: Lenght(50);

{----- Long Entry -----}

if CurrentBar > 1 and RateOfChange(C,10) > 0
Then Buy Next Bar at H Stop;

{---- Short Entry -----}

if CurrentBar > 1 and RateOfChange(C,10) < 0
Then Sell Next Bar at L Stop;


{Close all trades at end of day session}

NEW MARKET PARADIGM SYSTEM (Walt Downs)

Descrizione: Sistema molto interessante basato sulla volatilità.

Function Name: NewMarketParadigm
Output: Numeric

Input: Price(NumericSeries),Length(NumericSimple),StdDevUp (NumericSimple),StdDevDn(NumericSimple);
value1 = BollingerBand(Price,Length,StdDevUp);
value2 = BollingerBand(Price,Length,StdDevDn);
Condition1 = value1 < value1[1] and value2 > value2[1]; {Contraction}{Built as conditions for later revision --WD}
Condition2 = value1 > value1[1] and value2 < value2[1]; {Expansion}
Condition3 = Condition1 = False and Condition2 = False; {Transition}
IF Condition1 then NewMarketParadigm = 1; {Contraction}
IF Condition2 then NewMarketParadigm = 2; {Expansion}
IF Condition3 then NewMarketParadigm = 3; {Transition}

Name: NMP SYSTEM
Stops: None
Properties: Check "Allow multiple entries...." and "Generate orders for next bar"

Input: Price(close),Length(28),StdDevUp(2),StdDevDn(-2);
Vars: NmpC(0),NmpE(0),NmpT(0),Trigger(0);
{*1.}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 1 then NmpC = NmpC + 1
Else NmpC = 0; {Contraction phase}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 2 then NmpE = NmpE + 1
Else NmpE = 0; {Expansion Phase}
If NewMarketParadigm(Price,Length,StdDevUp,StdDevDn) = 3 then NmpT = 1
Else NmpT = 0; {Transition Phase}{Reversal traders will be using this phase, so I left it in, although I donÕt use it. No Counter is implemented, but one could certainly do that Ñ WD}
{*2.}
Condition1 = NmpE > 1; {2 consecutive NmpE ranges qualify as an Expansion Phase. -- WD}
If Condition1 then begin
Trigger = 1;
End;
{*3.}
If Trigger = 1 then begin
Buy Highest(High,10) + 1 point Stop;
Sell Lowest(Low,10) - 1 point Stop;
End;

The original CIS bow-tie/parabolic
Setting Defaults for NMP system:
Name: NMP SYSTEM 2
Stops: None
Properties: Check "Do not allow multiple entries" and "generate orders for next bar"

Input: Price(close),Length(28),DevSet(2),Accfactr(.02);
value1 = StdDev(Price,Length)*DevSet - StdDev(Price,Length)*-DevSet;
If value1 = Lowest(value1,Length) and Adx(14) < 23 then begin
If SlowD(Length) > 75 OR SlowD(Length) < 25 then begin
IncludeSystem: "Parabolic",ACCFACTR;
End;
End;

OBVDI SYSTEM (Phillip Holt)

Descrizione: Basato su OBV e Volume.

Type: User-Function, Na
 
si sono verificati degli errori di debug per chi fosse interessato spedisco con email l originale
i TS sono formati in easy lenguace(scusate la pronuncia)
e otimizzati per trade station ne ho altri anche l ultimo di larry wiliams
molto bello sia come strategia che sistema
abbasso il fib wiva la f........... [email protected]
 
>>>abbasso il fib wiva la f....

il commento mi pare estremamente professionale :lol:

comunque, concordo sulla seconda parte della proposizione, anzi aggiungo: SEMPRE! :-D
 

Users who are viewing this thread

Back
Alto