Strategy based on Q-Trend
Forums › ProRealTime English forum › ProOrder support › Strategy based on Q-Trend
- This topic has 5 replies, 3 voices, and was last updated 1 year ago by JADINVEST.
-
-
08/01/2023 at 4:19 PM #218453
Hey guys,
I saw Nicolas indicator tried it on my charts. I relly liked the strongbuy/strongsell signals and tried to make it into a strategy but I can´t make it buy/sell att the strong indicators, only at the normal signals that are behind // in the attached strategy. What am I missing?
Q-trend base12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879atrp = 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 = 1 //0 = trend inversion ; 1 = strong buy / strong sell only// — end of settingsLs=1source = 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]endifif (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 at marketendifif strongsell and ls<>-1 thensell at marketendif//if r<>r[1]and r>0 then//sell at market//endif//if r<>r[1]and r=0 then//buy at market//endifendifhttps://www.prorealcode.com/prorealtime-indicators/q-trend/
1 user thanked author for this post.
08/02/2023 at 7:50 AM #218473Here is the modified version to trade only the “strong” signals:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485defparam cumulateorders=falsedefparam preloadbars=0p=200atrp = 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 = 1 //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]endifif (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 at marketls=1endifif strongsell and ls<>-1 thensellshort at marketls=-1endif//if r<>r[1]and r>0 then//sell at market//endif//if r<>r[1]and r=0 then//buy at market//endifendif5 users thanked author for this post.
08/31/2023 at 3:42 PM #22013609/01/2023 at 10:39 AM #22017309/01/2023 at 1:05 PM #220179J’ai essayé en 1s, M1 et M15 sur l’EURUSD mini. Ce que j’essaie de faire avec cet indicateur et cette stratégie est d’aller et venir en fonction du « signalview = 0 » Flèche verte = acheter au marché, flèche rouge = sortir puis vendre au marché, flèche verte = sortie puis acheter… J’ai essayé d’éliminer certains signaux en jouant sur les réglages pour ne garder que les mouvements intéressants, en vain. Aussi avec la programmation assistée PRT = erreur.
Merci d’avance Nicolas
09/01/2023 at 1:59 PM #220185I tried in 1s, M1 and M15 on the EURUSD mini. What I am trying to do with this indicator and this strategy is to go back and forth based on the “signalview=0” Green arrow= buy at the market, red arrow= exit then sell at the market, green arrow= exit then buy… I tried to eliminate some signals by playing on the settings to keep only the interesting movements, in vain. Also with PRT assisted programming = error.
Thank you in advance Nicolas
-
AuthorPosts
Find exclusive trading pro-tools on