Hi All,
I’m trying to develop a screener but I’m facing a small problem that here,
As I’m not expert in Probuilder coding (I’m learning), I try to create an indicator that I transform into a screener and vice-versa, is there any other solution please ?
Best Regards,
Screeners are much the same as indicators, with just a few exceptions:
- do not support graphics
- do not return any data, they simply highlight the instruments that meet the conditions
- have a data history of just 254 bars, with IG (PRT offer 1024 bars, though).
That said, this indicator:
Sma100 = average[100,0](close)
Signal = 0
IF close CROSSES OVER Sma100 THEN
Signal = 1
ELSIF close CROSSES UNDER Sma100 THEN
Signal = -1
ENDIF
RETURN Signal AS "Crossover"
can be easily converted into a screener by simply:
- replacing the last line with the keyword SCREENER (and optionally adding the CRITERION)
- replacing -1 with 2 or any positive value of your choice to tell long from short signals
Sma100 = average[100,0](close)
Signal = 0
IF close CROSSES OVER Sma100 THEN
Signal = 1
ELSIF close CROSSES UNDER Sma100 THEN
Signal = 2
ENDIF
SCREENER[Signal](Signal AS "1=long, 2=short")
tks for your answer, I will try and come back if I don’t undertsnad the idea or if have some problem,
have a data history of just 254 bars, with IG (PRT offer 1024 bars, though).
with this answer you helped me for my future question (you are in my head 🙂 ), the 254 it’s for all TF ?
and PRT from IG it’s 1024, that is nice but they block some history too short on some TF, but it’s also a good information tks you,
and last think but not least, the screener strat working from the last 254 (Barindex of now – 254) but how about the indicator if they use moree then 254 period in the begining for exemple in the Candle[254] ?
IG only supports 254 bars, for all TFs, that is 254 minutes, hours, days, and so on…
1024 are supported by PRT from their own website, not with IG.
If any indicator needs more than 254 bars, then it will return incorrect data.
Be warned that some indicators need many more bars than the periods in brackets. EMAs can have, at most, about 70-80 periods, because of their inner calculations.