pilotgsms

Mirocana Strategy

Check out this strategy.
for more information: mirocana.com
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
strategy("Mirocana.com", overlay=true, currency=currency.USD, initial_capital=10000)
dt = input(defval=0.0010, title="Decision Threshold", type=float, step=0.0001)

confidence=(security(tickerid, 'D', close)-security(tickerid, 'D', close[1]))/security(tickerid, 'D', close[1])
prediction = confidence > dt ? true : confidence < -dt ? false : prediction[1]

bgcolor(prediction ? green : red, transp=93)

if (prediction)
    strategy.exit("Close", "Short")
    strategy.entry("Long", strategy.long, qty=10000*confidence)

if (not prediction)
    strategy.exit("Close", "Long")
    strategy.entry("Short", strategy.short, qty=-10000*confidence)
    
    
    
hi,could anyone suggest me how to apply an alarm to this strategy?
Reply
Hello, I'm interested in the news indicator at the bottom of the graph, as it is called, you can get the script because it looks like in the picture? Thank you.
Reply
version 3 does not repaint(https://www.tradingview.com/wiki/Pine_Script:_Release_Notes). So with some change, it does not repaint:

//@version=3
strategy("Mirocana.com", overlay=true, currency=currency.USD, initial_capital=10000)
dt = input(defval=0.0010, title="Decision Threshold", type=float, step=0.0001)

confidence=(security(tickerid, 'D', close)-security(tickerid, 'D', close))/security(tickerid, 'D', close)
prediction = confidence > dt ? 1 : confidence < -dt ? 0 : -1

//bgcolor(prediction ? green : red, transp=93)

if (prediction == 1)
strategy.exit("Close", "Short")
strategy.entry("Long", strategy.long, qty=10000*confidence)

if (prediction == 0)
strategy.exit("Close", "Long")
strategy.entry("Short", strategy.short, qty=-10000*confidence)


+11 Reply
Kermit70 kunjanverma
@kunjanverma,

hi friend, I tried to load this script as you wrote it but it doesn't work. Would you have any suggestions?
Thank you
Reply
Kermit70 Kermit70
this is the error report:

line 11: mismatched input 'strategy.exit' expecting 'end of line without line continuation'
Reply
@Kermit70, use this:

//@version=3
strategy("Mirocana.com", overlay=true, currency=currency.USD, initial_capital=10000)
dt = input(defval=0.0010, title="Decision Threshold", type=float, step=0.0001)

// Date range filter
testStartYear = input(2018, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear, testStartMonth, testStartDay, 0, 0)

testStopYear = input(2018, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(31, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear, testStopMonth, testStopDay, 0, 0)

inTimeRange = time >= testPeriodStart and time <= testPeriodStop

confidence=(security(tickerid, 'D', close)-security(tickerid, 'D', close))/security(tickerid, 'D', close)
//confidence=(security(tickerid, '60', close)-security(tickerid, '60', close))/security(tickerid, '60', close)
prediction=close>close
prediction:=confidence > dt ? true : (confidence < -dt ? false : prediction)

bgcolor(prediction ? green : red, transp=93)

goLong = prediction and inTimeRange
goshort = (not prediction) and inTimeRange

strategy.entry("Long", strategy.long, qty=10000*confidence, when=goLong)
strategy.close("Long", when=goLong)
strategy.entry("Short", strategy.short, qty=-10000*confidence, when=goshort)
strategy.close("Short", when=goshort)
/////////////

But now as you can see this script has such bad results in backtesting. Pretty useless now. :)
+1 Reply
Kermit70 kunjanverma
@kunjanverma,

Hi friend, you are really kind. Thank you for your reply and best wishes!!!
Reply
It's fake... Signals are put at the past candles when the actual price turned around and walked a few candles)... Really is a good picture, which is based on history, but it is not a strategy.
I think that the principles of such strategies should be disclosed in the description, or people should be warned that the signals are put on a few candles ago.
+13 Reply
Tradingview should do an analysis on the source code to determine if a script will repaint & then warn unsuspecting users of the issues with repainting. Otherwise someone might go out and mortgage their house and lose everything thinking they're going to be 98.78% (or 100%) profitable. :)
+5 Reply
tickwatch tickwatch
I mean on all strategies. Maybe an option "disable_repaint_warning=true" or "enable_unrealistic_outcomes=true" with a popup to warn users the the script is using values that will probably render the strategy performance report as (very) unreliable.
+4 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out