|
|
| Sujet : Points Pivots dans Prostation WHS | |
Bonjour,
est-ce que quelqu'un à le code pour mettre dans Chart Studio et intégrer ensuite les points pivots dans WHS Prostation ?
Ca serait sympa de me le communiquer :)
A moi que quelqu'un connaisse le langage de Chart Studio pour le programmer...
Merci.
indicator Pivot_Points;
input
StartHour = 0; /* hour of start of day.*/
draw R2("R2"), M4("M4"), R1("R1"), M3("M3"), PP("PP"), M2("M2"),
S1("S1"), M1("M1"), S2("S2");
vars i(number), /* index */
lst(number), fst(number), /* index of first and last items in the data set*/
Whigh(number), Wlow(number), /* Working H&L */
Lhigh(number), Llow(number), Lclose(number), /* Last HLC used for calc PP */
i1ststart(number), /*index of start of first whole day*/
i2ndstart(number), /*index of start of second whole day*/
daycount(number), /* used to find first 2 days */
L_PP(number), /*last calculated PP, only changes at start of new day */
L_R2(number), L_M4(number), L_R1(number), L_M3(number), L_M2(number),
L_S1(number), L_M1(number), L_S2(number);
begin
/* init Variables*/
lst := back(close);
fst := front(close);
daycount := 0;
if lst < fst then
return; /* exit on erroneous data */
/* Scan array, find 1st and 2nd days. Ignore first partial day*/
for i:= fst to lst do begin
if hour(timestamp ) = starthour and minute(timestamp) = 0 then begin /* look for start of day based on input starting hour */
daycount := daycount + 1; /* start counting at begin of first day */
if daycount = 1 then begin /* do only at begin of first day after we have skipped partial day's data */
i1ststart := i; /*found index of first day */
Whigh := high; /*Change working HL to current HL at start of first day */
Wlow := low;
end;
if daycount = 2 then i2ndstart := i; /*found index of start of second day */
end;
if daycount = 1 then begin /* find HL of first whole day */
if high > Whigh then Whigh := high;
if low < Wlow then Wlow := low;
end;
end;
if daycount < 2 then return; /* if not at least 2 days of data started then exit */
/*Main routine*/
for i := i2ndstart to lst do begin /*starts plotting only at start of second whole day */
if hour(timestamp) = starthour and minute(timestamp) = 0 then begin
Lhigh := Whigh; /* if we are at the begin of a new day then change HLC and recalculate Pivots */
Llow := Wlow;
Lclose := close[i-1];
Whigh := high; /*Change working HL to current HL at start of day */
Wlow := low;
L_PP := (Lhigh + Llow + Lclose)/3; /* Calculate PP based on yesterday's HLC*/
L_R1 := (2 * L_PP)- Llow;
L_S1 := (2 * L_PP)- Lhigh;
L_R2 := L_PP - L_S1 + L_R1;
L_S2 := L_PP + L_S1 - L_R1;
L_M1 := (L_S1 + L_S2) / 2;
L_M2 := (L_S1 + L_PP) / 2;
L_M3 := (L_R1 + L_PP) / 2;
L_M4 := (L_R1 + L_R2) / 2;
end;
PP := L_PP;
R1 := L_R1;
R2 := L_R2;
S1 := L_S1;
S2 := L_S2;
M1 := L_M1;
M2 := L_M2;
M3 := L_M3;
M4 := L_M4;
if high > Whigh then Whigh := high; /* check for HL on current day, used for tomorrow's Pivot calculations */
if low < Wlow then Wlow := low;
end;
end.
correze for ever !
| |  |
Bonjour boursicoton,
J'ai copier la formule que tu as mis au dessus et je l'ai coller dans chart studio.
Seulement je ne peux pas l'installer car il marque une série d'érreur dans le programme.
Pourrai tu me dire comment faire pour programmer les poins=ts pivots suivant ce calcul:
P=(H+B+C)/3
S1=2*P-H
S2=P-(H-B)
R1=2*P-B
R2=P+(H-B)
Merci pour ton aide
L'avenir commence aujourd'hui...
pour elliot
indicator Elliot_Wave_Oscillator;
input price = close, period = 5, period2 = 35;
draw line("EWO", histogram);
vars i(number), j(number), h(number), sort(series),
serie(series), serie2(series), serie3(series);
begin
for i := front(price)+period to back(price) do
begin
h := period;
for j := 1 to period do
begin
serie[j] := price[i - h];
h := period - j ;
end;
sort := bubble_sort(serie,period);
serie2 := median(sort,period);
end;
for i := front(price)+period2 to back(price) do
begin
h := period2;
for j := 1 to period2 do
begin
serie[j] := price[i - h];
h := period2 - j ;
end;
sort := bubble_sort(serie,period2);
serie3 := median(sort,period2);
end;
line := serie2 - serie3;
end.
puis à compiler
function bubble_sort;
input serie(series), length(number);
result res(series);
vars i(number), j(number), temp(number);
begin
for j := 1 to length do
begin
for i := 1 to length - j do
if (serie > serie[i+1]) then
begin
temp := serie[i+1];
serie[i+1] := serie;
serie := temp;
end;
end;
res := serie;
end.
édité le : 21-07-2007 19:00:46correze for ever !
| |  |
à complier aussi chacun dans un nomn difrent !
function median;
input price(series), period(number);
result res(number);
vars i(number), num (number), check(number), pointer(number);
begin
num := (period + 1) / 2 ;
check := int(num);
pointer := back(price) - period;
if num - check = 0
then res := price[num]
else
begin
num := check + 1;
res := (price[num] + price[check]) / 2;
end;
end.
correze for ever !
indicator Pivot_Points;
input
StartHour = 0; /* hour of start of day.*/
draw R2("R2"), M4("M4"), R1("R1"), M3("M3"), PP("PP"), M2("M2"),
S1("S1"), M1("M1"), S2("S2");
vars i(number), /* index */
lst(number), fst(number), /* index of first and last items in the data set*/
Whigh(number), Wlow(number), /* Working H&L */
Lhigh(number), Llow(number), Lclose(number), /* Last HLC used for calc PP */
i1ststart(number), /*index of start of first whole day*/
i2ndstart(number), /*index of start of second whole day*/
daycount(number), /* used to find first 2 days */
L_PP(number), /*last calculated PP, only changes at start of new day */
L_R2(number), L_M4(number), L_R1(number), L_M3(number), L_M2(number),
L_S1(number), L_M1(number), L_S2(number);
begin
/* init Variables*/
lst := back(close);
fst := front(close);
daycount := 0;
if lst < fst then
return; /* exit on erroneous data */
/* Scan array, find 1st and 2nd days. Ignore first partial day*/
for i:= fst to lst do begin
if hour(timestamp ) = starthour and minute(timestamp) = 0 then begin /* look for start of day based on input starting hour */
daycount := daycount + 1; /* start counting at begin of first day */
if daycount = 1 then begin /* do only at begin of first day after we have skipped partial day's data */
i1ststart := i; /*found index of first day */
Whigh := high; /*Change working HL to current HL at start of first day */
Wlow := low;
end;
if daycount = 2 then i2ndstart := i; /*found index of start of second day */
end;
if daycount = 1 then begin /* find HL of first whole day */
if high > Whigh then Whigh := high;
if low < Wlow then Wlow := low;
end;
end;
if daycount < 2 then return; /* if not at least 2 days of data started then exit */
/*Main routine*/
for i := i2ndstart to lst do begin /*starts plotting only at start of second whole day */
if hour(timestamp) = starthour and minute(timestamp) = 0 then begin
Lhigh := Whigh; /* if we are at the begin of a new day then change HLC and recalculate Pivots */
Llow := Wlow;
Lclose := close[i-1];
Whigh := high; /*Change working HL to current HL at start of day */
Wlow := low;
L_PP := (Lhigh + Llow + Lclose)/3; /* Calculate PP based on yesterday's HLC*/
L_R1 := (2 * L_PP)- Llow;
L_S1 := (2 * L_PP)- Lhigh;
L_R2 := L_PP - L_S1 + L_R1;
L_S2 := L_PP + L_S1 - L_R1;
L_M1 := (L_S1 + L_S2) / 2;
L_M2 := (L_S1 + L_PP) / 2;
L_M3 := (L_R1 + L_PP) / 2;
L_M4 := (L_R1 + L_R2) / 2;
end;
PP := L_PP;
R1 := L_R1;
R2 := L_R2;
S1 := L_S1;
S2 := L_S2;
M1 := L_M1;
M2 := L_M2;
M3 := L_M3;
M4 := L_M4;
if high > Whigh then Whigh := high; /* check for HL on current day, used for tomorrow's Pivot calculations */
if low < Wlow then Wlow := low;
end;
end.
je t'ai refait un copier coller
moi cela marche sans erreur
quand tu utilises chart studio dans l'oupout va bien à la derniere lign pour voir les erreurs et si la complilation est reussie ou pas
fais "verifier module" et tu verras que c'est bon
édité le : 21-07-2007 19:06:55correze for ever !
| |  |
Bonjour,
Le sujet a déjà un an mais aurait été très utile malheureusement pour moi aussi, le code ne fonctionne pas et je n'arrive pas à copier le rapport d'erreur.
si quelqu'un a trouvé le bug j'aimerai bien avoir la nouvelle version.
merci
hypatia
édité le : 07-09-2008 10:08:47
re, voici un code trouvé sur le forum anglais. Je l'ai intégré sans souci dans Chartstudio :
///////BEGIN CTL CODE////////
indicator DailyPivots;
input
StartHour = 21;
draw R3("R3", invisible, black), M5("M5"), R2("R2"), M4("M4"), R1("R1"), M3("M3"), PP("PP", dash_dot_line, blue, 1), M2("M2"),
S1("S1"), M1("M1"), S2("S2"), M0("M0"), S3("S3"), line("EMA");
vars i(number),
lst(number), fst(number),
Whigh(number), Wlow(number),
Lhigh(number), Llow(number), Lclose(number),
i1ststart(number),
i2ndstart(number),
daycount(number),
L_PP(number),
L_R3(number), L_M5(number), L_R2(number), L_M4(number), L_R1(number), L_M3(number), L_M2(number),
L_S1(number), L_M1(number), L_S2(number), L_M0(number), L_S3(number);
begin
lst := back(close);
fst := front(close);
daycount := 0;
if lst < fst then
return;
for i:= fst to lst do begin
if hour(timestamp ) = starthour and minute(timestamp) = 0 then begin
daycount := daycount + 1;
if daycount = 1 then begin
i1ststart := i;
Whigh := high;
Wlow := low;
end;
if daycount = 2 then i2ndstart := i;
end;
if daycount = 1 then begin
if high > Whigh then Whigh := high;
if low < Wlow then Wlow := low;
end;
end;
if daycount < 2 then return;
for i := i2ndstart to lst do begin
if hour(timestamp) = starthour and minute(timestamp) = 0 then begin
Lhigh := Whigh;
Llow := Wlow;
Lclose := close[i-1];
Whigh := high;
Wlow := low;
L_PP := (Lhigh + Llow + Lclose)/3;
L_R1 := (2 * L_PP)- Llow;
L_S1 := (2 * L_PP)- Lhigh;
L_R2 := L_PP - L_S1 + L_R1;
L_S2 := L_PP + L_S1 - L_R1;
L_R3 := 2*L_PP + (Lhigh - 2*Llow);
L_S3 := 2*L_PP - (2*Lhigh - Llow);
L_M0 := (L_S2 + L_S3) / 2;
L_M1 := (L_S1 + L_S2) / 2;
L_M2 := (L_S1 + L_PP) / 2;
L_M3 := (L_R1 + L_PP) / 2;
L_M4 := (L_R1 + L_R2) / 2;
L_M5 := (L_R2 + L_R3) / 2;
end;
PP := L_PP;
R1 := L_R1;
R2 := L_R2;
R3 := L_R3;
S1 := L_S1;
S2 := L_S2;
S3 := L_S3;
M0 := L_M0;
M1 := L_M1;
M2 := L_M2;
M3 := L_M3;
M4 := L_M4;
M5 := L_M5;
if high > Whigh then Whigh := high;
if low < Wlow then Wlow := low;
end;
a plus
hypatia
lien : http://www.gftforex.com/forum/displaytopic.asp?T=9
édité le : 07-09-2008 10:11:45
| |  |
bonjour,
ça ralentit la machine de les intégrer avec une vingtaine de fenêtres ouvertes?
Féconder le passé en engendrant l'avenir, tel est le sens du présent
| Sujet : Points Pivots dans Prostation WHS | |
|