Hi,
Can you supply the code for a multi timeframe ProScreener, combining month and week?
I saw Nicolas already addressed a similar query about monthly reference, but the coding does not apply in this query, and my own coding does not work (https://www.prorealcode.com/topic/monthly-pin-bar-proscreener/)
Many thanks
// The following code is related to this timescale:weekly
TIMEFRAME(weekly)
indicator1 = TriangularAverage[15](close)
c1 = (low > indicator1)
// The following code is related to this timescale:monthly
TIMEFRAME(monthly)
indicator2 = TriangularAverage[15](close)
c2 = (low > indicator2)
// The following code is related to this timescale:DEFAULT
TIMEFRAME(DEFAULT)
SCREENER[c1 AND c2] ((close/DClose(1)-1)*100 AS "%Chg yest.")
ovschalk – Welcome to the forums.
Please always use the ‘Insert PRT Code’ button when posting code in the forums as it makes it far easier for everyone to read. I have tidied up your post for you. 🙂
Nicolas’ code dealt with Pinbars, which are simply like a house, you start from the ground, then fill them as data flow in, so it’s (apparently) easy to make a monthly pin bar our of intraday or weekly bars. I happend to display a 4-hour heikin-ashi bar on a 1-hour TF, but that’s just as simple. No special calculations are needed, just sumations.
But when you need to calculate data from a lower TF in a higher one, well… it’s almost impossible to do. You can do that with simple moving averages because they are just a sum of n values divided by n, it has also been done for Bollinger Bands. But when it comes to more complex calculations, like a Triangular (or Exponential) MA, or Stochastic and many more… you just have to give up because results will NEVER be the same!
You could simply multiply n (periods of your average) by 4, because there are 4 (or 4.5, or 4.3 or whatever else?) to convert a weekly Triangular average into a monthly one. No, a weekly Triangular average of 15 periods cannot be changed to 60 periods to make it a 15-period monthly Triangular average, becuse it will still be a 60-period weekly Triangular average!
Hi @robertogozzi
Thanks for the quick response