Sklerato
Nuovo forumer
come promesso...
Iniziamo dagli indicatori (quelli con denominazione <signal> includeteli in un riquadro a se' in quanto sono per avere un'informazione visiva immediata di cio' che indicano, gli altri nella finestra dove ci sono i dati del fib):
Indicatori:
RegoloB - IDC (Congestione)
MAperiods:=Input("Durata Media> ",1,120,35);
CHperiods:=Input("Durate Canale> ",1,120,10);
CHampli:=Input("Ampiezza Canale> ",0,3,2.35);
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
IDCma;IDCh;IDCl
RegoloB - IDC Signal (Congestione)
MAperiods:=Input("Durata Media> ",1,120,35);
CHperiods:=Input("Durate Canale> ",1,120,10);
CHampli:=Input("Ampiezza Canale> ",0,3,1.5);
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
If(IDCma>IDCh OR IDCma<IDCl,0,100) {+100congestione};
RegoloB - Keltner Channel Signal
Kperiods:=Input("Periodi> ",1,120,10);
Kampli:=Input("Ampiezza> ",0,10,0.95);
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
Signal:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
Signal;
RegoloB - Keltner Channel
Kperiods:=Input("Periodi> ",1,120,10);
Kampli:=Input("Ampiezza> ",0,10,0.95);
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
RegoloB - MACD Signal
Veloce:=Input("Smoothing Veloce> ",1,100,13);
Lento:=Input("Smoothing Lento> ",1,100,23);
Differenza:=Input("Smoothing Differenza> ",1,100,9);
EMAVeloce:=Mov(C,Veloce,E);
EMALento:=Mov(C,Lento,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,Differenza,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDline;
RegoloB - MACD
Veloce:=Input("Smoothing Veloce> ",1,100,13);
Lento:=Input("Smoothing Lento> ",1,100,23);
Differenza:=Input("Smoothing Differenza> ",1,100,9);
EMAVeloce:=Mov(C,Veloce,E);
EMALento:=Mov(C,Lento,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,Differenza,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
Signal:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
Signal;
Expert Advisor:
Se volete anche l'highligh (la colorazione) delle barre del fib, secondo che siamo long o short, mettete lo stesso codice qui sotto nella sezione corrispondente nell'ExpertAdvisor. Create due highligh, uno con il primo pezzo di codice, l'altro con il secondo spezzone.
Trends - Bullish
{REGOLO B INTRADAY TS}
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{+100LONG,-100SHORT,0FLAT}
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{+100LONG,-100SHORT}
{SEGNALI TS}
Segnale:=Congestione=0 AND MACDsign=Ksign AND MACDsign=100;
If(Segnale=TRUE,TRUE,Ref(Segnale,-1));
Trends - Bearish
{REGOLO B INTRADAY TS}
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{+100LONG,-100SHORT,0FLAT}
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{+100LONG,-100SHORT}
{SEGNALI TS}
{LONG}
Congestione=0 AND MACDsign=Ksign AND MACDsign=-100;
System Tester:
Enter Long
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Long=TRUE;
Close Long
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Short=TRUE;
Enter Short
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
SHORT=TRUE;
Close Short
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Long=TRUE;
Ovviamente l'ho appena fatto, e non ancora avuto il tempo di controllarlo, pertanto ci possono benissimo essere degli errori: a vostro rischio e pericolo !
Ah!... quanto riportato non consiste in un invito all'investimento, bla bla bla bla
Ciao, Buon Natale e felice 2003 (speriamo)
Iniziamo dagli indicatori (quelli con denominazione <signal> includeteli in un riquadro a se' in quanto sono per avere un'informazione visiva immediata di cio' che indicano, gli altri nella finestra dove ci sono i dati del fib):
Indicatori:
RegoloB - IDC (Congestione)
MAperiods:=Input("Durata Media> ",1,120,35);
CHperiods:=Input("Durate Canale> ",1,120,10);
CHampli:=Input("Ampiezza Canale> ",0,3,2.35);
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
IDCma;IDCh;IDCl
RegoloB - IDC Signal (Congestione)
MAperiods:=Input("Durata Media> ",1,120,35);
CHperiods:=Input("Durate Canale> ",1,120,10);
CHampli:=Input("Ampiezza Canale> ",0,3,1.5);
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
If(IDCma>IDCh OR IDCma<IDCl,0,100) {+100congestione};
RegoloB - Keltner Channel Signal
Kperiods:=Input("Periodi> ",1,120,10);
Kampli:=Input("Ampiezza> ",0,10,0.95);
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
Signal:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
Signal;
RegoloB - Keltner Channel
Kperiods:=Input("Periodi> ",1,120,10);
Kampli:=Input("Ampiezza> ",0,10,0.95);
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
RegoloB - MACD Signal
Veloce:=Input("Smoothing Veloce> ",1,100,13);
Lento:=Input("Smoothing Lento> ",1,100,23);
Differenza:=Input("Smoothing Differenza> ",1,100,9);
EMAVeloce:=Mov(C,Veloce,E);
EMALento:=Mov(C,Lento,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,Differenza,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDline;
RegoloB - MACD
Veloce:=Input("Smoothing Veloce> ",1,100,13);
Lento:=Input("Smoothing Lento> ",1,100,23);
Differenza:=Input("Smoothing Differenza> ",1,100,9);
EMAVeloce:=Mov(C,Veloce,E);
EMALento:=Mov(C,Lento,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,Differenza,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
Signal:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
Signal;
Expert Advisor:
Se volete anche l'highligh (la colorazione) delle barre del fib, secondo che siamo long o short, mettete lo stesso codice qui sotto nella sezione corrispondente nell'ExpertAdvisor. Create due highligh, uno con il primo pezzo di codice, l'altro con il secondo spezzone.
Trends - Bullish
{REGOLO B INTRADAY TS}
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{+100LONG,-100SHORT,0FLAT}
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{+100LONG,-100SHORT}
{SEGNALI TS}
Segnale:=Congestione=0 AND MACDsign=Ksign AND MACDsign=100;
If(Segnale=TRUE,TRUE,Ref(Segnale,-1));
Trends - Bearish
{REGOLO B INTRADAY TS}
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{+100LONG,-100SHORT,0FLAT}
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{+100LONG,-100SHORT}
{SEGNALI TS}
{LONG}
Congestione=0 AND MACDsign=Ksign AND MACDsign=-100;
System Tester:
Enter Long
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Long=TRUE;
Close Long
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Short=TRUE;
Enter Short
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
SHORT=TRUE;
Close Short
{IDC}
MAperiods:=35;
CHperiods:=10;
CHampli:=1.35;
IDCma:=Mov(C,MAperiods,S);
IDCh:=(0.5+CHampli/2)*Mov(H,CHperiods,S)+(0.5-CHampli/2)*Mov(L,CHperiods,S);
IDCl:=(0.5-CHampli/2)*Mov(H,CHperiods,S)+(0.5+CHampli/2)*Mov(L,CHperiods,S);
Congestione:=If(IDCma>IDCh OR IDCma<IDCl,0,100)
{+100congestione};
{KELTNER CHANNEL}
Kperiods:=10;
Kampli:=0.95;
UpperChannel:=(0.5+Kampli/2)*Mov(H,Kperiods,S)+(0.5-Kampli/2)*Mov(L,Kperiods,S);
LowerChannel:=(0.5-Kampli/2)*Mov(H,Kperiods,S)+(0.5+Kampli/2)*Mov(L,Kperiods,S);
UpperChannel;LowerChannel;
Ksign:=If(C<UpperChannel AND C>LowerChannel,PREV,If(C>UpperChannel,100,-100));
{MACD}
EMAVeloce:=Mov(C,13,E);
EMALento:=Mov(C,23,E);
EMADifferenza:=Mov(EMAVeloce-EMALento,9,E);
MACDline:=EMAVeloce-EMALento-EMADifferenza;
MACDsign:=If(MACDline=0,PREV,If(MACDline>0,100,-100));
{SEGNALI TS}
Long:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=100,TRUE,FALSE);
Short:=If(Congestione=0 AND MACDsign=Ksign AND MACDsign=-100,TRUE,FALSE);
Long=TRUE;
Ovviamente l'ho appena fatto, e non ancora avuto il tempo di controllarlo, pertanto ci possono benissimo essere degli errori: a vostro rischio e pericolo !
Ah!... quanto riportato non consiste in un invito all'investimento, bla bla bla bla
Ciao, Buon Natale e felice 2003 (speriamo)