TradingView
pilotgsms
2016年5月5日午後9時17分

Mirocana Strategy 

U.S. Dollar/Japanese YenFXCM

詳細

Check out this strategy.
for more information: mirocana.com
コメント
kunjanverma
version 3 does not repaint(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[1]))/security(tickerid, 'D', close[1])
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)


Kermit70
@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
Kermit70
this is the error report:

line 11: mismatched input 'strategy.exit' expecting 'end of line without line continuation'
kunjanverma
@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[1]))/security(tickerid, 'D', close[1])
//confidence=(security(tickerid, '60', close)-security(tickerid, '60', close[1]))/security(tickerid, '60', close[1])
prediction=close>close[1]
prediction:=confidence > dt ? true : (confidence < -dt ? false : prediction[1])

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. :)
Kermit70
@kunjanverma,

Hi friend, you are really kind. Thank you for your reply and best wishes!!!
sano84
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.
sosizi1214
fake
tickwatch
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. :)
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.
K_Andou
hi,could anyone suggest me how to apply an alarm to this strategy?
詳細