Mais lol….
Je sais bien que ça fonctionne…
par contre ce que je trouve pas correct, c’est que tu apprécies la partie du code que je poste sans arrières pensées… et que tu ne partage pas les améliorations que tu y apporte.
Merci
Zigo,
1
P=21
N=26
EMA = EndPointAverage[P](Close)
If EMA >= EMA[N] Then
Slope = (EMA - EMA[N])/EMA[N]
elsif EMA < EMA[N] Then
Slope = (EMA - EMA[N])/EMA
Endif
if slope>0 then
slope=+1
elsif slope <0 then
slope =-1
endif
res = sin(atan(slope+slope[1]+slope[2]))
Fin = res-res[1]
return res, fin
Peux tu me donner un peu plus d’info sur RES et FIN???
Ok,
dans ce cas tu les utilises comment:
Comme condition?
donne moi un peu plus d’infos stp….
c’est à prendre comme condition?
Zigo crée des conditions booléennes basés sur l’état de la slope ascendante ou descendante, puis il utilise sa fameuse formule trigonométrique 😉 pour organiser un signal autour de ces conditions sur les 3 dernière périodes (sorte de filtre) = Res
enfin il crée une différence entre les 2 dernières “res” pour afficher un signal de changement = Fin
Sinon, je dois intervenir dans quel code au final ? 🙂
Slt Nicolas,
En effet, ça m’intéresse de comprendre comment il fait exactement, que j’arrive à intégrer ça dans mon code….
Il me manque des éléments pour y arriver par moi même…
Les idées ne m’anque pas, mais…. Manque de connaissance pour y parvenir seul…
Merci pour ton aide….
ZigoParticipant
Master
// Definitie van code parameters
DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
DEFPARAM flatbefore = 093000
DEFPARAM Flatafter = 210000
P=21
N=26
EMA = EndPointAverage[P](Close)
If EMA >= EMA[N] Then
Slope = (EMA - EMA[N])/EMA[N]
elsif EMA < EMA[N] Then
Slope = (EMA - EMA[N])/EMA
Endif
if slope>0 then
slope=+1
elsif slope <0 then
slope =-1
endif
res= sin(atan(slope+slope[1]+slope[2]))
Fin=res-res[1]
if fin >1.4 then
buy 1 contract at market
elsif fin <-1.4 then
sellshort 1 contract at market
endif
if onmarket then
// set stops and targets
endif
Ok Zigo…
Doucement je commence à saisir, mais pourquoi utiliser les constantes (1.4 et -1.4)
je ne comprends pas bien de quelle manière sont interprétés les résultats:
a)+1 +1 +1 = 3 sin(atan(3)) = 0.94868
b) +1 +1 -1 = 1 sin(atan(1) = 0.70710
c)+1-1-1 = -1 sin(atan(-1) = -0.70710
d) -1-1-1 = -3 sin(atan(-3) = -0.94868
Slts
Je n’obtient aucun résultats
//Position acheteuse
BuyConditionA = (Close > Pivot and Close > WMMA89 and Close > WMMA144 and Close > WMMA233 and Close > WMMA377)
BuyConditionB = MyRSI < 38.2
if buyconditionA and BuyConditionB and not daysForbiddenEntry then
if fin > 1.4 then
buy n share at market
endif
endif
//Position Vendeuse
SellConditionA = (Close < Pivot and Close < WMMA89 and Close < WMMA144 and Close < WMMA233 and Close < WMMA377)
SellConditionB = MyRSI > 61.8
if SellConditionA and SellconditionB and not daysForbiddenEntry then
if fin < -1.4 then
sellshort n share at market
endif
endif
ZigoParticipant
Master
Votre backtest ce n’est pas le même.
Tu peux m’aider à corriger mon code?
C’est difficile pour moi d’écrire le juste code qui fonctionne.
Thanks
ZigoParticipant
Master
15 min
Dans le marché entre 9u30 et 21u00
Spread of 2 pips
Merci Zigo,
mes résultats ne sont pas mauvais en intra-scalp 1 min….voir ci dessous avec spread de 2.4 pips.
Mais je voudrais arrivé à obtenir un meilleur ratio Gain/Perte et je voudrais arriver à intégrer ta formule trigonométrique afin de pouvoir prendre position au bon moment sur la pente ascendante ou descendante…..
Le problème que j’ai, c’est que je n’arrive pas à trouver une formule pour prendre position sur le pente à l’aide d’une variable ….et non sur d’une constante.
J’ai déjà essayé plusieurs approches sans parvenir à dépasser le 60% Gain/Perte…
Slts
Ci-joint la ixième version…
//Indicateur de pente
P=21
Np=34
EMA = TriangularAverage[P](Close)
If EMA >= EMA[Np] Then
Slope = (EMA - EMA[Np])/EMA[Np]
elsif EMA < EMA[Np] Then
Slope = (EMA - EMA[Np])/EMA
Endif
if slope > 0 then
slope = 1
elsif slope < 0 then
slope = -1
endif
If (Slope + Slope[1] + Slope[2]) = 3 then
HighBull = Sin(Atan(3))
elsif (Slope + Slope[1] + Slope[2]) = 1 then
Bull = Sin(Atan(1))
Elsif (Slope + Slope[1] + Slope[2]) = -1 then
Bear = Sin(Atan(-1))
Elsif (Slope + Slope[1] + Slope[2]) = -3 then
HighBear = Sin(Atan(-3))
Endif
//************************************************************************
//Gestion des Profits
levier = 2
capital = 500 + strategyprofit*0.5
n = (capital / 1000) * levier
//************************************************************************
//Position acheteuse
BuyConditionA2 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)
BuyConditionB2 = Bull
BuyConditionC2 = MyRSI < 38.2
if buyconditionA2 and BuyConditionB2 and BuyConditionC2 and not daysForbiddenEntry then
buy n/2 share at market
endif
BuyConditionA1 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)
BuyConditionB1 = HighBull
BuyConditionC1 = MyRSI < 38.2
if buyconditionA1 and BuyConditionB1 and BuyConditionC1 and not daysForbiddenEntry then
buy n share at market
endif
If Slope crosses under MMA100 then
Sell at Market
Endif
//Position Vendeuse
SellConditionA2 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)
SellConditionB2 = Bear
SellConditionC2 = MyRSI > 61.8
if SellConditionA2 and SellconditionB2 and SellConditionC2 and not daysForbiddenEntry then
sellshort n/2 share at market
endif
SellConditionA1 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)
SellConditionB1 = HighBear
SellConditionC1 = MyRSI > 61.8
if SellConditionA1 and SellconditionB1 and SellConditionC1 and not daysForbiddenEntry then
sellshort n share at market
endif
If Slope Crosses over MMA100 then
Exitshort at Market
Endif
J’essaie de définir la taille des contrats en fonction de la ligne 20, 22, 24 et 26….
mais je n’arrive pas à lui faire prendre la taille recherchée…
Quelqu’un peut m’aider?
Merci d’avance