Code schaff trend cycle,
Forums › ProRealTime forum Français › Support ProBuilder › Code schaff trend cycle,
- This topic has 3 replies, 3 voices, and was last updated 6 years ago by
Nicolas.
-
-
08/02/2017 at 6:05 PM #42348
Bonjour ma strategie repose sur l’indicateur Schaff trend cycle de prorealtime qui combine Macd et Stochastic lent. Le problème est que lorsque l’on veut faire un Back test sur Schaff trend cycle , prorealtime ne veut pas. Le plus simple serait de savoir si quelqu’un le connait le code?
merci d’avance
Oraclus
08/03/2017 at 9:03 AM #42382Je viens de faire une petite modif au code de @Francesco ici : https://www.prorealcode.com/topic/why-cant-use-or-call-some-indicator/#post-42380 code Schaff Trend Cycle
Il est désormais quasi identique à celui de la plateforme et donc être utilisé dans la programmation de stratégie de trading automatique ou de screener, etc.. Je vais m’assurer que ce code figure dans la bibliothèque, il est très souvent demandé 🙂
EDIT: ajouté à notre bibliothèque de codes prorealtime = Schaff Trend Cycle
08/03/2017 at 12:56 PM #42402Bonjour
Venant d’un site espagnol moi j’ai ça :
Schaff Indicador123456789101112131415161718192021222324// Schaff indicator - Prorealtime formula (presented in the site of Enrico Malverti)//Schaff indicator Formula// presented in the site www.enricomalverti.com, also with trading rulesEmas = average[b](close)Emal = average[l](close)Macds =Emas-Emal// from Wikipedia %K = 100* ((Price-L5)/(h5-l5)) where h = high of 5 period, l = lowperck = 100 * (macds - lowest[k](macds))/(highest[k](macds)-lowest[k](macds))// from Wikipedia, %D is the 3-day moving average of %K (the last 3 values of %K).percd=average[d](perck)// PF is %K del %DPF = 100 * (macds - lowest[k](percd))/(highest[k](percd)-lowest[k](percd))// %D del PF (PFF)PFF = average[d](pf)return pff as " pff "// Variables :// b, breve periodo - short period, default = 23// l, long period - default = 50// k is the period of %k , default = 10// d for %d is by default = 304/05/2019 at 9:22 AM #95504Pour future référence, le code open source et identique à celui de la plateforme est celui-ci :
1234567891011121314151617181920212223242526272829303132333435363738394041//input parametersTCLen = 10MA1 = 23MA2 = 50Once Factor = 0.5if barindex>MA2 then//{Calculate a MACD Line}XMAC = ExponentialAverage[MA1](Close) - ExponentialAverage[MA2](Close)//{1st Stochastic: Calculate Stochastic of a MACD}Value1 = Lowest[TCLen](XMAC)Value2 = Highest[TCLen](XMAC) - Value1//{%Fast K of MACD}if Value2 > 0 thenFrac1 = ((XMAC - Value1)/Value2) * 100elseFrac1 = Frac1[1]endif//{Smoothed Calculation for % Fast D of MACD}PF = PF[1] + (Factor * (Frac1 - PF[1]))//{2nd Stochastic: DCalculate Stochastic of smoothed Percent Fast D, 'PF', above}Value3 = Lowest[TCLen](PF)Value4 = Highest[TCLen](PF) - Value3//{% of Fast K of PF}if Value4 > 0 thenFrac2 = ((PF - Value3)/Value4) * 100elseFrac2 = Frac2[1]endif//{Smoothed Calculation for %Fast D of PF}PFF = PFF[1] + (Factor * (Frac2 - PFF[1]))endifRETURN PFF, 75 coloured(0,0,255) as "level 75", 25 coloured(0,0,255) as "level 25"1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on 