Q-Trend

Q-Trend

Q-Trend is an multipurpose indicatorm that can be used for swing- and trend-trading equally on any timeframe (non-volatile markets are better for this thing).

Settings:

  • Trend period – used to calculate trend line in the special moments(will explain below);
  • ATR Multiplier – changes sensitivity. The higher the multiplier = the more sensitive it is.
  • Also option to smooth source data (helps get cleaner signals, as always).

How to use?
Signals are given on the chart. Also ou can use trend line as S/R line.

The idea behind:

Terms:
SRС = Source
TL = trend line;
MP = ATR multiplier;
ATR = ATR 🙂
TL = (highest of source P-bars back + lowest of source P-bars back) / 2
Epsilon = MP * ATR
I was thinking for a week about combining volatility and relation between highest and lowest price point. That why I called indicator Q-Trend = Quantitative Trend, as I was trying to think about price in a mathematical way.

Okay, time to go philosophical:
1) TL is shows good price trend, but as it is slow enough and not enough informative, we need add additional conditions to produce signals.
2) Okay, so what can we add as conditions? We need to take volatility into account, as it is crucial in the moments of market uncertainty. So let’s use ATR (Average True Range) somehow. My idea is that if SRC breaks TL + ATR, then it means that there will be upmove and we update our TL. Analogically for SRC breaking TL – ATR (breaks are crosses of TL +- ATR lines).
Conclusion:
– if SRC breaks TL + ATR, it is a BUY signal and update of trend line;
– if SRC breaks TL – ATR, it is a SELL signal and update of trend line;

(description from original author: tarasenko_)

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Ozons • 07/17/2023 #

    Bonjour Nicolas, merci pour le code

  2. NEOMKEY • 07/17/2023 #

    Hello everyone. Great job Nicolás, and any input is appreciated. But isn’t there a way for the entry arrow to be drawn on the closed candle and not on the previous candle?. Thank you very much again.

    • Nicolas • 07/17/2023 #

      Change any reference to barindex[1],m[1] with barindex[0],m[0]

  3. NEOMKEY • 07/17/2023 #

    Thank you very much Nicolás.

  4. T-rader • 07/17/2023 #

    Thanks for great indicator. Translated it to a algo. How come I can´t get the strongbut and strongsell to work?

    // —settings
    p = 200 //Trend period
    atrp = 14 //ATR Period
    mult = 1.0 //ATR Multiplier
    mode = 1 //Signal mode options = [1=”Type A”, 2=”Type B”]
    useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
    srcemaperiod = 3 //EMA Smoother period
    colorbars = 0 //Color bars? 0=false ; 1=true
    signalsview = 1 //0 = trend inversion ; 1 = strong buy / strong sell only
    // — end of settings
    Ls=1

    source = customclose

    // Calculations
    if useemasmoother then
    src = average[srcemaperiod,1](source)
    else
    src=source
    endif

    hh = highest[p](src) // Highest of src p-bars back;
    ll = lowest[p](src) // Lowest of src p-bars back.
    d = hh – ll

    if barindex>p then
    once 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 B
    changeup = src crosses over m+epsilon or src crosses under m+epsilon
    changedown = src crosses over m-epsilon or src crosses under m-epsilon
    else
    changeup = src crosses over m+epsilon or src > m+epsilon
    changedown = src crosses under m-epsilon or src < m-epsilon
    endif

    sb = open < ll + d / 8 and open >= ll
    ss = open > hh – d / 8 and open <= hh
    strongbuy = 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]

    endif

    if (changeup or changedown) then
    if changeup then
    m=m + epsilon
    elsif changedown then
    m=m – epsilon
    endif
    else
    m=m[1]
    endif

    if changeup then
    r=0
    g=255
    elsif changedown then
    r=255
    g=0
    endif

    if signalsview=1 then
    if strongbuy and ls<>1 then
    buy at market
    endif

    if strongsell and ls<>-1 then
    sell at market
    endif

    //if r<>r[1]and r>0 then
    //sell at market
    //endif

    //if r<>r[1]and r=0 then
    //buy at market
    //endif

    endif

    • Nicolas • 07/17/2023 #

      thanks for opening a specific topic in the ProOrder forum.

    • doo23559 • 07/17/2023 #

      Brother , It`s not work .
      I want to be auto trade based on the signals

  5. JC_Bywan • 07/17/2023 #

    Link to automatic strategy topic in forum: https://www.prorealcode.com/topic/strategy-based-on-q-trend/

  6. Gigi • 07/17/2023 #

    Bonjour, cet indicateur repeint il? Par avance, merci pour la réponse.

    • Nicolas • 07/17/2023 #

      Non, il n’y a pas d’indicateur qui repeint avec PRT.

  7. JADINVEST • 07/17/2023 #

    Hello everyone,
    Great work, thank you Nicolas for this indicator that I really appreciate.
    Would it be possible to create a sreener with the possibility of displaying weak and/or strong signals?
    a topic is already open : https://www.prorealcode.com/topic/creer-un-screener-base-sur-q-trend
    Thanks //

    edit: the screener is in the topic, thanks
    What about the strategy please: https://www.prorealcode.com/topic/strategy-based-on-q-trend

  8. lkiklkik • 07/17/2023 #

    merci ! semble très sympa couplé avec une MM.

  9. yassinoumas33 • 07/17/2023 #

    how to add this indicator to mt4 please

    • Nicolas • 07/17/2023 #

      You can’t, all codes shared here are to be used with ProRealTime trading platform: https://trading.prorealtime.com/en/

  10. Anthony2A • 07/17/2023 #

    Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80.
    sur drawcandle drawtext et endif.
    si quelqu un pourrait m aider svp

  11. Lucas0000 • 07/17/2023 #

    Hello, Congratulations on this programming, it seems incredible to me, I am new to this but I would like to know if you have this automated Q-trend indicator, I think it is proorder, that it makes the entries and exits automatically in the color change, and if not Do you have it, how could I get it?…
    Thank you.

  12. plbourse • 07/17/2023 #

    Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving Bull/Bear phases, but I would like to have it more sensitive, i.e would accept a higher lagging time before the indicator changes from Bull to Bear (or changes from green to red in the original version) does anybody have a clue on which parameters I should act ?
    Thanks in advance

  13. manfeber • 264 days ago #

    Buenos dias,alguien me podria decir como se descargar el archivo o el indicador Q-Trend??,ya que solo se me ha descargado un archivo ue no puedo abrir con el nombre PRC_Q-Trend.itf???

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+4 more likes

Related users ' posts
Manu L. Bonjour Nicolas, j'ai créé un screener avec l'aide à la prog en TF weekly mais je voudrai...
wtangsiri C'est exactement le même signal que donne le croisement et le décroisement de deux EMA (7 et...
PHAN100 bonjour, j'ai un bug sur le programme recopié prorealtime me dit qu'il y a un problème à ...
Nicolas Please open a topic in ProScreener forum with your query, I'll reply you there. Thank you.
manafull Thanks Nicolas, I post my question, along with the codes I am trying to convert from your in...
Nicolas I replied to your post here: https://www.prorealcode.com/topic/screener-for-rsi-and-linear-r...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Nicolas le code est déjà sur cette page, inutile de fournir un autre format ?! Les fichiers itf sont...
Novice-Surfer Hello IV Mcm, You are my leader ! Your work is incredibly precise, thank you very much f...
Mikolajek Merci pour votre excellent travail !
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...
Alessandro Furlani Hi Ian, hope you still use PRT and so you can read this post. I have tested a lot your work ...
Nicolas Pour créer des alertes, vous pouvez suivre ce petit tutoriel : https://www.prorealtime.com/f...
thibault76 Bonjour Nicolas, cette stratégie est intéressante. Par contre, en 2022, le code ne fonction...
Nicolas Aucun message d'erreur pour ma part en version 11.1. Tu es certain de créer un code d'indica...
Stockastiss Can this code be simply transferred into Backtestingcode so one doesnt need to use call ? (i...
Vonasi Sorry for the late reply. Add the code to your strategy and remove line 5 and line 39. Chang...
viktorthunss Hi! How many averages are there? Can I see the somewhere?
leofi https://www.prorealcode.com/topic/simple-average-with-visual-color/
leofi Go visit www.prorealcode.com/topic/simple-average-with-visual-color/ and watch 2em post
Dritan Hi,I am new on Prorealtime and coding.I downloaded the indi but I have it on a separate wind...
Denis Hello Nicolas, Thank you and congratulations for your work. The entry signals seem interes...
mia Bonjour j'arrive pas a integrer l'indicateur sur mt4 comment faire svp mercii
Nicolas Il ne s'agit pas d'un indicateur MT4, je vous suggère d'utiliser ProRealTime qui est une mei...
dawn168 Nicolas, I cannot get this one to work on tradingview. Got the following error message. Can ...
Nicolas There is no code for Tradingview on this website.
Moitomkw Try as soon as: hh = highest[MagicFilterPeriod](low) ll = highest[MagicFilterPeriod](high)

Top