Open Close Cross Strategy R6.1 revised by yourmattie

Original version: Open Close Cross Strategy R5 revised by JustUncle.

Change: script changed to a study script with custom alerts.

This revision is an open Public release, with just some minor changes. It is a revision of the Strategy "Open Close Cross Strategy R2" originally published by @JayRogers.
Revised by JustUncleL

Strategy based around Open-Close Moving Average Crossovers optionally from a higher time frame.

Read more about the indicator original script
Klik here


Use this as overlayer on the original strategy to set custom alerts.
Info: with this study script no buy/sell arrows show up op the chart.

Does some know a solution for this issue:
Issue: sometimes it gives a false signal because even when you set "one per bar close" the custom set alert might come halfway the bar....and it might be a false signal when the bar is closed
Does somone know a fix for this? I tried with barstate.iscomfirmed but it didn't work for me.

Ps. I'm not a developer...just changed the scipt by watching a youtube tutorial.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


To avoid repaint, you can just use an offset in security function here.

reso(exp, use, res) => use ? security(tickerid, res, exp, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on) : exp

Instead of this, use

reso(exp, use, res) => use ? security(tickerid, res, exp, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on) : exp

Have some explanation in one of script on how to avoid repainting in strategies:
+4 Reply
yourmattie HeWhoMustNotBeNamed
@HeWhoMustNotBeNamed, thanks for the advice, but if I lookt at the line of code that you gave me: both are the same😅
Could you give me the correct line of code?
It will be really helpful.

Or is this the correct code?
f_secureSecurity(_symbol, _res, _src) => security(_symbol, _res, _src, lookahead = barmerge.lookahead_(xxx)) : exp

(Xxx)= should i put there "on" or "off"?
@yourmattie, oh sorry. It looks like square brackets are not allowed in the comments and it TV is automatically removing it.

Instead of exp use exp(1). This means you will be using last confirmed bar for calculation instead of current bar.

Note: replace with square brackets.
+5 Reply
bomblevikas yourmattie
@yourmattie, can you tell me result if I used Tema by change multiplier alternate 1 and MA period 30 please make back test
HelloYourmattie, is it possible to receive a strategy of this version?
Could you give me access to a version that works with 3Commas bot? Thanks!
I want non repaint indicator,
I develop the non- repainting version but for real trading thats not enough ... should mix with other algorithms to confirm the buy and sell signal .
ernie76 stanfordisimi123
@stanfordisimi123, can i try? thanks
can we know what are the differences between your version and JustUncle version ?

Does it repaint at the moment ?

Thank you.