Hello fellow traders,
This is a simple but nice code to get a GREEN background if close > Supertrend and Parabolic SAR, and RED background if close < Supertrend and Parabolic SAR.
Simple, but effective and useful. Of course, it is better on trend markets.
It will give you clearly the way to trade, don’t enter against the trend!
Of course, you can add other conditions.
From this, you can try to test your own strategies, with this filter. I will personally try to test it in combination with precise entry / exit rules.
Regards,
1 2 3 4 5 6 7 8 9 10 |
ST = supertrend[3,10] PSAR = SAR[0.02,0.02,0.2] IF close > PSAR and close > ST THEN backgroundcolor(204,255,204) ELSIF close < PSAR and close < ST THEN backgroundcolor(255,204,204) ENDIF RETURN |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi Doc, I changed the code a bit, “RETURN” can be use all alone in version 10.3 since drawing things don’t necessary need predefined variables.
Hi Nico, I’ve just learnt something, thanks !
Shame form IG users still on 10.2…
Thanks Doc!
is Background colour only available from 10.3 and not possible with 10.2 ?
Yes, colouring background by code is only available in the version 10.3. with the instruction BACKGROUNDCOLOR: http://www.prorealcode.com/documentation/backgroundcolor/
Hello ,
J’ai la version 10.2 et ca ne marche pas, qu’est ce qui coince ?
Merci a vous
If i switch between different Markets, the Backgroundcolour will appear where it should not. As you can see at the picture. ( https://picload.org/view/dgpogoga/supertrendsar.png.html) Does anybody know what is the problem?
How can I get alerts on colour change?
Hello, I would like to add a 25 period SMA moving average. It’s possible?