Domanda easylanguage

  • ANNUNCIO: 45° Edizione del settimanale "Le opportunità di Borsa" dedicato ai consulenti finanziari ed esperti di borsa.

    Prevale ancora un certo ottimismo sulle principali borse mondiali spinte dalle aspettative sui tassi di interesse, con gli operatori che scontano sempre di più una pausa nel rialzo dei tassi per quest’anno, dopo la pubblicazione dei verbali degli ultimi meeting di Fed e Bce. Come da attese, dalle minute Fed è emersa cautela su eventuali rialzi futuri dei tassi, anche se non c’è stata alcuna indicazione di eventuali tagli nel breve termine. Anche dai verbali Bce è emerso che i tassi siano già sufficientemente restrittivi da riportare l’inflazione verso l’obiettivo. Lato materie prime, forte volatilità sul petrolio in seguito al rinvio della riunione dell’Opec+ dal 26 al 30 novembre. Per continuare a leggere visita il link

  • ANNUNCIO: Segui le NewsLetter di Borse.it.

    Al via la Newsletter di Borse, con tutte le notizie quotidiane sui mercati finanziari. Iscriviti per rimanere aggiornato con le ultime News di settore, quotazioni e titoli del momento.
    Per iscriverti visita questo link.

travis

Nuovo Utente
Registrato
18/12/01
Messaggi
312
Punti reazioni
7
Sono riuscito a costruire finalmente un sistema che effettivamente funziona per testare i pivots. Non ho ancora capito esattamente in che periodi funzionano, ma funzionano.

Tuttavia ancora va perfezionato:

Inputs: ...S_PrTol(0.001), R_PrTol(0.001), Support_Length(24), Resistance_Length(12)...

Variables: ...support(0), resistance(0), RPivotAll(0), SPivotAll(0), R1(0), R2(0), R3(0), S1(0), S2(0), S3(0), PivPnt(0), Resistance1(0), Resistance2(0), Resistance3(0), Support1(0), Support2(0), Support3(0)...

support = Lowest(Low[1], Support_Length);
resistance = Highest(High[1], Resistance_Length);


If Date <> Date[1] then Begin
PivPnt = (HighD(1) + LowD(1) + CloseD(1)) / 3;
Resistance1 = (PivPnt * 2) - LowD(1);
Resistance2 = PivPnt + (HighD(1) - LowD(1));
Resistance3 = Resistance1 + (HighD(1) - LowD(1));
Support1 = (PivPnt * 2) - HighD(1);
Support2 = PivPnt - (HighD(1) - LowD(1));
Support3 = Support1 - (HighD(1) - LowD(1));
end;


S1 = IFF(( support > Support1 * (1 - S_PrTol) and support < Support1 * (1 + S_PrTol) ),1,0);
S2 = IFF(( support > Support2 * (1 - S_PrTol) and support < Support2 * (1 + S_PrTol) ),1,0);
S3 = IFF(( support > Support3 * (1 - S_PrTol) and support < Support3 * (1 + S_PrTol) ),1,0);
R1 = IFF(( resistance > Resistance1 * (1 - R_PrTol) and resistance < Resistance1 * (1 + R_PrTol) ),1,0);
R2 = IFF(( resistance > Resistance2 * (1 - R_PrTol) and resistance < Resistance2 * (1 + R_PrTol) ),1,0);
R3 = IFF(( resistance > Resistance3 * (1 - R_PrTol) and resistance < Resistance3 * (1 + R_PrTol) ),1,0);

SPivotAll = IFF((S1 = 1) or (S2 = 1),1,0);
RPivotAll = IFF((R1 = 1) or (R2 = 1),1,0);

If CurrentBar > 1 and Fast crosses above Slow and SPivotAll = 1
Then
Buy next Bar at Open;

If CurrentBar > 1 and Fast crosses below Slow and RPivotAll = 1
Then
Sell next Bar at Open;


----------

Il problema è in grassetto, perché va bene considerare Highest high e Lowest low, però non so come dirgli di considerare gli Highest High e Lowest Low avvenuti x barre prima, che però siano avvenuti OGGI. E' molto semplice ma non so la risposta.


support = Lowest(Low[1], Support_Length) purché oggi;
resistance = Highest(High[1], Resistance_Length) purché oggi;
 
Il valore del Top/Bottom di oggi potrai averlo solo dopo il dominio di Support/Resistance_Length
Pertanto io farei così:
var:BeginTop(-1),BeginBottom(999999),Startbar(0);

if date > date[1] then begin
BeginTop=High;
BeginBottom=Low;
StartBar=1;
end;
if StartBar < Resistance_Length then begin Resistance=MaxList(BeginTop,High);
end else begin
Resistance=Highest(H,Resistance_Length);
end;
if StartBar < Support_Length then begin Support=MinList(BeginBottom,Low);
end else begin
Support=Lowest(L,Support_Length);
end;
StartBar=StartBar+1;
end;



B.-
 
Grazie infinite. Ci metterò un po' a capire sino in fondo come funziona, ma sto incominciando a capire il principio.

---

Sono riuscito, anche se è un po' diverso:

Inputs: R_Length(24), S_Length(24);
Vars: FirstBar(0), BarsToday(0), S_Max_Length(0), R_Max_Length(0);

If Date <> Date[1] then FirstBar = BarNumber;
BarsToday = BarNumber - FirstBar;

If BarsToday < S_Length Then S_Max_Length = BarsToday else S_Max_Length = S_Length;
If BarsToday < R_Length Then R_Max_Length = BarsToday else R_Max_Length = R_Length;

support = Lowest(Low[1], S_Max_Length);
resistance = Highest(High[1], R_Max_Length);
 
Ultima modifica:
Indietro