Valeur de Slope pour la prise de position
Forums › ProRealTime forum Français › Support ProOrder › Valeur de Slope pour la prise de position
- This topic has 54 replies, 3 voices, and was last updated 4 years ago by Fantasio2020.
-
-
06/02/2020 at 10:59 AM #134186
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
06/02/2020 at 11:58 AM #134190Zigo,
123456789101112131415161718192021221P=21N=26EMA = EndPointAverage[P](Close)If EMA >= EMA[N] ThenSlope = (EMA - EMA[N])/EMA[N]elsif EMA < EMA[N] ThenSlope = (EMA - EMA[N])/EMAEndifif slope>0 thenslope=+1elsif slope <0 thenslope =-1endifres = sin(atan(slope+slope[1]+slope[2]))Fin = res-res[1]return res, finPeux tu me donner un peu plus d’info sur RES et FIN???
06/02/2020 at 12:32 PM #13420206/02/2020 at 12:35 PM #134203Ok,
dans ce cas tu les utilises comment:
Comme condition?
donne moi un peu plus d’infos stp….
c’est à prendre comme condition?
06/02/2020 at 2:03 PM #134215Zigo 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 ? 🙂
1 user thanked author for this post.
06/02/2020 at 2:35 PM #134221Slt 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….
06/02/2020 at 4:22 PM #134235Backtest slope123456789101112131415161718192021222324252627282930// Definitie van code parametersDEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerdDEFPARAM flatbefore = 093000DEFPARAM Flatafter = 210000P=21N=26EMA = EndPointAverage[P](Close)If EMA >= EMA[N] ThenSlope = (EMA - EMA[N])/EMA[N]elsif EMA < EMA[N] ThenSlope = (EMA - EMA[N])/EMAEndifif slope>0 thenslope=+1elsif slope <0 thenslope =-1endifres= sin(atan(slope+slope[1]+slope[2]))Fin=res-res[1]if fin >1.4 thenbuy 1 contract at marketelsif fin <-1.4 thensellshort 1 contract at marketendifif onmarket then// set stops and targetsendif2 users thanked author for this post.
06/02/2020 at 4:41 PM #13424206/02/2020 at 5:03 PM #134251Ok 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
06/02/2020 at 5:20 PM #134256Je n’obtient aucun résultats
12345678910111213141516//Position acheteuseBuyConditionA = (Close > Pivot and Close > WMMA89 and Close > WMMA144 and Close > WMMA233 and Close > WMMA377)BuyConditionB = MyRSI < 38.2if buyconditionA and BuyConditionB and not daysForbiddenEntry thenif fin > 1.4 thenbuy n share at marketendifendif//Position VendeuseSellConditionA = (Close < Pivot and Close < WMMA89 and Close < WMMA144 and Close < WMMA233 and Close < WMMA377)SellConditionB = MyRSI > 61.8if SellConditionA and SellconditionB and not daysForbiddenEntry thenif fin < -1.4 thensellshort n share at marketendifendif06/02/2020 at 8:18 PM #134289Votre backtest ce n’est pas le même.
1 user thanked author for this post.
06/02/2020 at 8:27 PM #134293Tu peux m’aider à corriger mon code?
C’est difficile pour moi d’écrire le juste code qui fonctionne.
Thanks
06/02/2020 at 8:34 PM #13429406/02/2020 at 9:16 PM #134298Merci 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
06/03/2020 at 3:46 PM #134420Ci-joint la ixième version…
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172//Indicateur de penteP=21Np=34EMA = TriangularAverage[P](Close)If EMA >= EMA[Np] ThenSlope = (EMA - EMA[Np])/EMA[Np]elsif EMA < EMA[Np] ThenSlope = (EMA - EMA[Np])/EMAEndifif slope > 0 thenslope = 1elsif slope < 0 thenslope = -1endifIf (Slope + Slope[1] + Slope[2]) = 3 thenHighBull = Sin(Atan(3))elsif (Slope + Slope[1] + Slope[2]) = 1 thenBull = Sin(Atan(1))Elsif (Slope + Slope[1] + Slope[2]) = -1 thenBear = Sin(Atan(-1))Elsif (Slope + Slope[1] + Slope[2]) = -3 thenHighBear = Sin(Atan(-3))Endif//************************************************************************//Gestion des Profitslevier = 2capital = 500 + strategyprofit*0.5n = (capital / 1000) * levier//************************************************************************//Position acheteuseBuyConditionA2 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)BuyConditionB2 = BullBuyConditionC2 = MyRSI < 38.2if buyconditionA2 and BuyConditionB2 and BuyConditionC2 and not daysForbiddenEntry thenbuy n/2 share at marketendifBuyConditionA1 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)BuyConditionB1 = HighBullBuyConditionC1 = MyRSI < 38.2if buyconditionA1 and BuyConditionB1 and BuyConditionC1 and not daysForbiddenEntry thenbuy n share at marketendifIf Slope crosses under MMA100 thenSell at MarketEndif//Position VendeuseSellConditionA2 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)SellConditionB2 = BearSellConditionC2 = MyRSI > 61.8if SellConditionA2 and SellconditionB2 and SellConditionC2 and not daysForbiddenEntry thensellshort n/2 share at marketendifSellConditionA1 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)SellConditionB1 = HighBearSellConditionC1 = MyRSI > 61.8if SellConditionA1 and SellconditionB1 and SellConditionC1 and not daysForbiddenEntry thensellshort n share at marketendifIf Slope Crosses over MMA100 thenExitshort at MarketEndifJ’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
-
AuthorPosts
Find exclusive trading pro-tools on