Signal to noise ratio

Signal to noise ratio
This technical indicator is an attempt to find the good momentum of trend : is it actually trending or in a range market?

Interestingly, it follows that π is not only the ratio between the length of a circle to its diameter, it is also a constant rather appears in statistics and, oddly enough, in the relationship between the distance between a price oscillation and a straight line.

  • If the signal / noise ratio is less than or equal to 1/2 π, we will be in a trading range or range.
  • If the signal / noise ratio is greater than 1/2 π, we are in a trending market.

Code converted from the Metatrader4 version, by request on Spanish forums.

Description from x-trader.net website.

//PRC_SignalToNoiseRatio | indicator
//21.12.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//Converted from MT4 version

// --- parameter
MyLookBackShift = 14
// ---------------

MyClose = Close

LookBackShift = MyClose[MyLookBackShift]

AbsCh = Abs(MyClose - MyClose[1])
MyDistance = Abs(MyClose-LookBackShift)

MyB = 0
for y = 0 to MyLookBackShift + 1 do
 MyB = MyB + AbsCh[y]
next
MyWalk = MyB

MyDTWRatio = MyDistance/MyWalk

MyPiRatio = 1/3.14159265358979/2

Buf0 = MyDTWRatio
Buf1 = MyPiRatio

return Buf0 as "signal to noise ratio",Buf1 as "signal to noise level"
   
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?

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

  1. bolsatrilera • 27 days ago #

    Sin duda,esta es la conversión correcta.Le quedo eternamente agradecido Nicolas.

  2. bolsatrilera • 27 days ago #

    ¿Hay algún problema para hacerlo público también en un blog que tengo?Entiendo que es un código de libre acceso.Gracias por todo Nicolas.

    • Nicolas • 27 days ago #

      Mientras el código y los comentarios permanezcan intactos por supuesto. Un enlace a este post también será muy apreciado 🙂

  3. verdi55 • 26 days ago #

    Thanks a lot, this is something I had been looking for for quite a while. Are there any other indicators on this site that can be used to decide whether the market is in a sideward range or trending ? I know the ADX and the RAVI for example. Anything else ? 

    • Nicolas • 26 days ago #

      You can also use the choppiness index,  which is also an oscillator made to detect ranging market : http://www.prorealcode.com/prorealtime-indicators/choppiness-index/

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
tatankayotanka
1 day ago
T3 Velocity mix
T3 Velocity mix
1
Indicators
Nicolas At least, here it is :) Thanks for your contribution to the prorealtime code library. Every ...
Nicolas Very interesting and clever. Well done. I'm looking further for your next contribution :)
Rohan Thanks Nicolas :-)
Nicolas
1 week ago
Haos Visual
Haos Visual
2
Indicators
Dimi.A Nic, you're a blessing mate thank you so much. This is great.
Matriciel Merci pour ton travail Nicolas ! Ca m'a l'air d'être un très bon indicateur de tendance.
Souk Diaby Thanks a lot, will check this indicator asap :) have a nice trading day
Rohan Pleasure Souk, please let me know if you have ideas to improve it. I am trying to incorporat...
bolsatrilera
2 weeks ago
Twiggs Money Flow
Twiggs Money Flow
5
Indicators
century any explanation about the different moving average type ? please
Nicolas https://www.prorealcode.com/documentation/average/ 0 = SMA 1 = EMA 2 = WMA 3 = Wilder 4 = Tr...
century thanks alot . it's all i need ;)
Nicolas
2 weeks ago
Jurik MACD
Jurik MACD
0
Indicators
Nicolas
2 weeks ago
Gann HiLo activator
Gann HiLo activator
3
Indicators
maxxb salve,  vorrei sapere perchè nel suo grafico compare sul prezzo mentre a me compare a parte...
AleX Sul grafico principale accanto alla voce Prezzo (vedi in alto a sinistra proprio sotto l'are...
maxxb perfetto non lo sapevo ....  ciao grazie..     
Nicolas
3 weeks ago
Holt EMA
Holt EMA
0
Indicators
bolsatrilera
3 weeks ago
MACD MIRROR
MACD MIRROR
0
Indicators
Petrus
3 weeks ago
Nicolas
3 weeks ago
StepRSI
StepRSI
4
Indicators
rfsteve Nicolas what do you think of these modifications for 233 tick charts ?         cheers Steve....
Nicolas Thanks for this modification, I still do not have tested it, where did you get this idea to ...
rfsteve Trial and error from study of indicators call it coding mad science was trying to find an in...
bolsatrilera
3 weeks ago
Volume climate
Volume climate
0
Indicators
verdi55 Looks almost like a conventional moving average (just take lines instead of dots) . The buil...
Nicolas Just another indicator in the Library asked by a member of the community. You are right abou...
ML Thanks a lot Nicolas! I found it on the Internet and I was curious to evaluate it... Thanks ...
Nicolas Thanks a lot, a lot of people will find it useful! About customclose of the daily OHLC, you...
Nicolas Nope, because this one is made for version 10.3 and no variables is needed in RETURN instruc...
Ernesto1 Nicolas, thanks for the code. I can use it in a trading system, as a set-up for entry  and e...
supertiti Hola Nicolas, Can you make us the screener for the Sadukey V2 with the change of color ? t...
supertiti Voici un code de VIDYA construit par Sohocool : // MOYENNE EXPONENTIELLE ADAPTIVE VIDYA by ...
Matriciel Merci Supertiti. Je trouve que ce code est difficile à règler et n'est pas d'une grande pré...
Ernesto1 J'ai essayé avec deux différents I ,  a =  3 périodes et un 3 x 5 = 15 périodes.Ie comme si ...
SoloContado Hello Nicolas,   thanks a lot for your many contributions in this post. I have a prob...
Nicolas Because of no data available at the start of calculations. Add this at line 15 : if barindex...
Nicolas
1 month ago
supertiti bonjour à tous J'utilise cet indicateur depuis plusieurs mois, une fois règlé "K" à sa conv...

Top