Coloration WMA
Posted: 11 Jan 2017 19:36
Bonjour.
Vous serait-il possible de me donner le code permettant de colorer selon 3 critères (ascendant, descendant, flat ) le code express de WMA ci-dessous (ou une version ultérieure s'il en existe une).
Pouvoir paramétrer le critère quantifiant l'état "flat" serait également très intéressant.
En vous en remerciant par avance.
Bien cordialement.
---
// Copyright Fipertec
// Version 1.5
Express Mov_Avg_Weighted
Vars
numeric i;
series
line,
price,
senti(50);
input
$period (1,100,25),
$Price("Open;Close;High;Low",1),
$MessageBox("No;Yes",0),
$PlaySound("No;Yes",0),
$SendEmail("No;Yes",0);
Calculation
if IsFirstBar() then
begin
CalculateAtEveryTick(false);
SetYscaleFormat(GetPriceFormat());
for i = 0 to FinalBarIndex()
begin
if $Price = 3 then price[-i] = l[-i];
else
if $Price = 2 then price[-i] = h[-i];
else
if $Price = 1 then price[-i] = c[-i];
else
if $Price = 0 then price[-i] = o[-i];
end
WeightedMovingAverage(price, line, $period);
end
if (price > line) then senti = 65;
if (price < line) then senti = 35;
if (price[1] < line[1]) and (price > line) then
begin
senti = 100;
if ($SendEmail = 1) then SendEmail("Buy signal","Buy signal Mov_Avg_Weighted: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Buy signal Mov_Avg_Weighted: " + SymbolName());
end
if (price[1] > line[1]) and (price < line) then
begin
senti = 0;
if ($SendEmail = 1) then SendEmail("Sell signal","Sell signal Mov_Avg_Weighted: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Sell signal Mov_Avg_Weighted: " + SymbolName());
end
interpretation
begin
sentiment = senti;
end
plot (line, lightblue, 1);//@@@cs:609384-3599997-461720_cs@@@
Vous serait-il possible de me donner le code permettant de colorer selon 3 critères (ascendant, descendant, flat ) le code express de WMA ci-dessous (ou une version ultérieure s'il en existe une).
Pouvoir paramétrer le critère quantifiant l'état "flat" serait également très intéressant.
En vous en remerciant par avance.
Bien cordialement.
---
// Copyright Fipertec
// Version 1.5
Express Mov_Avg_Weighted
Vars
numeric i;
series
line,
price,
senti(50);
input
$period (1,100,25),
$Price("Open;Close;High;Low",1),
$MessageBox("No;Yes",0),
$PlaySound("No;Yes",0),
$SendEmail("No;Yes",0);
Calculation
if IsFirstBar() then
begin
CalculateAtEveryTick(false);
SetYscaleFormat(GetPriceFormat());
for i = 0 to FinalBarIndex()
begin
if $Price = 3 then price[-i] = l[-i];
else
if $Price = 2 then price[-i] = h[-i];
else
if $Price = 1 then price[-i] = c[-i];
else
if $Price = 0 then price[-i] = o[-i];
end
WeightedMovingAverage(price, line, $period);
end
if (price > line) then senti = 65;
if (price < line) then senti = 35;
if (price[1] < line[1]) and (price > line) then
begin
senti = 100;
if ($SendEmail = 1) then SendEmail("Buy signal","Buy signal Mov_Avg_Weighted: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Buy signal Mov_Avg_Weighted: " + SymbolName());
end
if (price[1] > line[1]) and (price < line) then
begin
senti = 0;
if ($SendEmail = 1) then SendEmail("Sell signal","Sell signal Mov_Avg_Weighted: " + SymbolName());
if ($PlaySound = 1) then Playsound("ring");
if ($MessageBox = 1) then MessageBox("Sell signal Mov_Avg_Weighted: " + SymbolName());
end
interpretation
begin
sentiment = senti;
end
plot (line, lightblue, 1);//@@@cs:609384-3599997-461720_cs@@@