Code schaff trend cycle,
- This topic has 3 replies, 3 voices, and was last updated 5 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Similar topics:
Forums › ProRealTime forum Français › Support ProBuilder › Code schaff trend cycle,
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
Je 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
Bonjour
Venant d’un site espagnol moi j’ai ça :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// Schaff indicator - Prorealtime formula (presented in the site of Enrico Malverti) //Schaff indicator Formula // presented in the site www.enricomalverti.com, also with trading rules Emas = 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 = low perck = 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 %D PF = 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 = 3 |
Pour future référence, le code open source et identique à celui de la plateforme est celui-ci :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
//input parameters TCLen = 10 MA1 = 23 MA2 = 50 Once Factor = 0.5 if 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 then Frac1 = ((XMAC - Value1)/Value2) * 100 else Frac1 = 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 then Frac2 = ((PF - Value3)/Value4) * 100 else Frac2 = Frac2[1] endif //{Smoothed Calculation for %Fast D of PF} PFF = PFF[1] + (Factor * (Frac2 - PFF[1])) endif RETURN PFF, 75 coloured(0,0,255) as "level 75", 25 coloured(0,0,255) as "level 25" |
Find exclusive trading pro-tools on