SignalReversalHeikinAshi
Posted: 21 Jan 2014 11:53
Bonjour,
J'utilise la stratégie SignalReversalHeikinAshi avec des paramètre assez rapide.
Beaucoup de faux signaux apparaissent mais cela n'est pas gênant pour le moment.
Néanmoins, Lorsque le faux signal disparait, il coupe automatiquement la position et ce jusqu’à ce que le signal soit validé.
Pouvez vous m'indiquer la modification à apporter dans le code pour empêcher le faux signal de clôturer la position?
Express SignalReversalHeikinAshi_Aggregator
Vars
series
haO, haC, haH, haL,signal(50),xk,xq,idBarbig,nbig;
input
$nBarsOldTrend(1,10,3),$nBarsNewTrend(1,10,2),$nMinBarEarlySignal(1,100,1);
numeric
i,k,q;
Calculation
CalculateAtEveryTick(false);
SetYscaleFormat (GetPriceFormat());
idBarbig = CurrentBarIndex();
nbig = $nMinBarEarlySignal;
if IsFirstBar() then
begin
haO = o;
haC = c;
haH = h;
haL = l;
end
else
begin
haO = (haO[1] + haC[1]) / 2;
haC = (o + h + l + c) / 4;
haH = max(h, max(haO, haC));
haL = min(l, min(haO, haC));
if CurrentBarIndex() > ($nBarsNewTrend + $nBarsOldTrend) then
begin
for i = 0 to ($nBarsNewTrend - 1)
begin
if (haO < haC) then k = k + 1;
end
for i = $nBarsNewTrend to ($nBarsNewTrend + $nBarsOldTrend - 1)
begin
if (haO > haC) then k = k + 1;
end
if (k = ($nBarsNewTrend + $nBarsOldTrend)) then signal = 100;
xk = k;
k = 0;
for i = 0 to ($nBarsNewTrend - 1)
begin
if (haO > haC) then q = q + 1;
end
for i = $nBarsNewTrend to ($nBarsNewTrend + $nBarsOldTrend - 1)
begin
if (haO < haC) then q = q + 1;
end
if (q = ($nBarsNewTrend + $nBarsOldTrend)) then signal = 0;
xq = q;
q = 0;
end
end
interpretation
begin
end
plotcandles (haO, haC, haH, haL);
D'avance merci
Cordialement,
J'utilise la stratégie SignalReversalHeikinAshi avec des paramètre assez rapide.
Beaucoup de faux signaux apparaissent mais cela n'est pas gênant pour le moment.
Néanmoins, Lorsque le faux signal disparait, il coupe automatiquement la position et ce jusqu’à ce que le signal soit validé.
Pouvez vous m'indiquer la modification à apporter dans le code pour empêcher le faux signal de clôturer la position?
Express SignalReversalHeikinAshi_Aggregator
Vars
series
haO, haC, haH, haL,signal(50),xk,xq,idBarbig,nbig;
input
$nBarsOldTrend(1,10,3),$nBarsNewTrend(1,10,2),$nMinBarEarlySignal(1,100,1);
numeric
i,k,q;
Calculation
CalculateAtEveryTick(false);
SetYscaleFormat (GetPriceFormat());
idBarbig = CurrentBarIndex();
nbig = $nMinBarEarlySignal;
if IsFirstBar() then
begin
haO = o;
haC = c;
haH = h;
haL = l;
end
else
begin
haO = (haO[1] + haC[1]) / 2;
haC = (o + h + l + c) / 4;
haH = max(h, max(haO, haC));
haL = min(l, min(haO, haC));
if CurrentBarIndex() > ($nBarsNewTrend + $nBarsOldTrend) then
begin
for i = 0 to ($nBarsNewTrend - 1)
begin
if (haO < haC) then k = k + 1;
end
for i = $nBarsNewTrend to ($nBarsNewTrend + $nBarsOldTrend - 1)
begin
if (haO > haC) then k = k + 1;
end
if (k = ($nBarsNewTrend + $nBarsOldTrend)) then signal = 100;
xk = k;
k = 0;
for i = 0 to ($nBarsNewTrend - 1)
begin
if (haO > haC) then q = q + 1;
end
for i = $nBarsNewTrend to ($nBarsNewTrend + $nBarsOldTrend - 1)
begin
if (haO < haC) then q = q + 1;
end
if (q = ($nBarsNewTrend + $nBarsOldTrend)) then signal = 0;
xq = q;
q = 0;
end
end
interpretation
begin
end
plotcandles (haO, haC, haH, haL);
D'avance merci
Cordialement,