Ninjatrader 8

Fermé Publié le il y a 3 ans Paiement à la livraison
Fermé Paiement à la livraison

Periodo (9);

Fonte (close);

Gain(200);

Loss(150);

var

k,pdm,mdm,pdmS, mdmS , s, mdiS,

pdi,mdi,pdiS,d,s1,iS,hhv,llv,d1,vI ,vmai: Float;

function

Maxy(a: Float; b: Float): Float;

begin

maxy:= close;

if (a >= b) then maxy:= a;

if (a <= b) then maxy:= b ;

end;

begin

if (Periodo<>0) then k := 1.0/Periodo;

pdm := maxy((Fonte - Fonte[1]), 0);

mdm := maxy((Fonte[1] - Fonte), 0);

pdmS := ((1 - k)*(pdmS[1]) + k*pdm);

mdmS := ((1 - k)*(mdmS[1]) + k*mdm);

s := pdmS + mdmS;

if (s<>0) then pdi := pdmS/s;

if (s<>0) then mdi := mdmS/s;

pdiS := ((1 - k)*(pdiS[1]) + k*pdi);

mdiS := ((1 - k)*(mdiS[1]) + k*mdi);

d := abs(pdiS - mdiS);

s1 := pdiS + mdiS ;

if (s1<>0) then iS := ((1 - k)*(iS[1]) + k*d/s1);

hhv := highest(is,Periodo);

llv := lowest(is,Periodo);

d1 := hhv - llv ;;

if (d1<>0) then vI := (iS - llv)/d1;

VMAi := (1 - k*vI)*(VMAi[1]) + k*vI*Fonte;

Plot (VMAi);

If (fonte > vmai) then PaintBar (cllime);

If (fonte < vmai) then PaintBar (clred);

If (fonte >= vmai) and (Close[1] <= Vmai[1]) then paintbar (clBranco);

If (fonte <= vmai) and (Close[1] >= vmai[1]) then paintbar (clBranco);

end;

Programmation C++ Programmation C Algorithme Architecture Logicielle

Nº du projet : #29062142

À propos du projet

1 proposition Projet à distance Actif il y a 3 ans

1 freelance fait une offre moyenne de $28 pour ce travail

buildorbust

hi......................................................................................................

$28 USD en 3 jours
(174 Commentaires)
6.5