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:
+2 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.
+3 Reply
can we know what are the differences between your version and JustUncle version ?

Does it repaint at the moment ?

Thank you.
yourmattie LucaTortiglione
@LucaTortiglione, yes, as you can see in the notes. I changed the script from strategy to study. With this change you can set custom alerts on buy and sell signals😁
Does it repaint?
Can it be use for all markets and all time frame?
yourmattie Mriruvie
@Mriruvie, yes it is repaind. And yes it can be used for all markets on all time frame.

It works for me really good with 3commas bot.

If you want a non repaind let me know...
Mriruvie yourmattie
@yourmattie, I want non repaint indicator that can work very well on crypto market and all time frames
lovelycococo yourmattie
I want non repaint indicator,
me too.
sdatir yourmattie
@yourmattie, Yes I want please give access to no repaint version
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out