PRC Q trend
Forums › ProRealTime English forum › ProBuilder support › PRC Q trend
- This topic has 5 replies, 3 voices, and was last updated 1 year ago by Jean FX.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
11/24/2023 at 11:00 AM #22423511/24/2023 at 11:02 AM #224237
You can, what are the conditions for that system?
11/24/2023 at 12:26 PM #22424011/24/2023 at 12:34 PM #224243Do you need an indicator or a strategy?
11/24/2023 at 12:43 PM #22424412/20/2023 at 3:09 PM #225526Here you have an exemple.
However, as the symbols are drawn in the past, there is a time lag between the signal and the backtest position (position taken 2 candlesticks after the one on which the signal is drawn).12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485//PRC_Q-Trend | indicator//17.07.23//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// ---settingsp = 200 //Trend periodatrp = 14 //ATR Periodmult = 1.0 //ATR Multipliermode = 1 //Signal mode options = [1="Type A", 2="Type B"]useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=truesrcemaperiod = 3 //EMA Smoother periodcolorbars = 0 //Color bars? 0=false ; 1=truesignalsview = 0 //0 = trend inversion ; 1 = strong buy / strong sell only// --- end of settingssource = customclose// Calculationsif useemasmoother thensrc = average[srcemaperiod,1](source)elsesrc=sourceendifhh = highest[p](src) // Highest of src p-bars back;ll = lowest[p](src) // Lowest of src p-bars back.d = hh - llif barindex>p thenonce m = (hh + ll) / 2 // Initial trend line;atr = AverageTrueRange[atrp][1] // ATR;epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.if mode=2 then //type Bchangeup = src crosses over m+epsilon or src crosses under m+epsilonchangedown = src crosses over m-epsilon or src crosses under m-epsilonelsechangeup = src crosses over m+epsilon or src > m+epsilonchangedown = src crosses under m-epsilon or src < m-epsilonendifsb = open < ll + d / 8 and open >= llss = open > hh - d / 8 and open <= hhstrongbuy = sb or sb[1] or sb[2] or sb[3] or sb[4]strongsell = ss or ss[1] or ss[2] or ss[3] or ss[4]if (changeup or changedown) thenif changeup thenm=m + epsilonelsif changedown thenm=m - epsilonendifelsem=m[1]endifif changeup thenr=0g=255elsif changedown thenr=255g=0endifif signalsview=1 thenif strongbuy and ls<>1 thenbuy 1 share at marketls=1endifif strongsell and ls<>-1 thensellshort 1 share at marketls=-1endifelseif r<>r[1]and r>0 thensellshort 1 share at marketendifif r<>r[1]and r=0 thenbuy 1 share at marketendifendifendifset stop ploss 5set target pprofit 3 -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on
Similar topics: