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
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//Converted from MT4 version
// --- parameter
MyLookBackShift = 14
MyClose = Close
LookBackShift = MyClose[MyLookBackShift]
AbsCh = Abs(MyClose - MyClose)
MyDistance = Abs(MyClose-LookBackShift)
MyB = 0
for y = 0 to MyLookBackShift + 1 do
MyB = MyB + AbsCh[y]
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"
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 :