RicardoSantos

[RS]MicuRobert System V0

Request for MicuRobert.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=2
//  Request for MicuRobert
study(title='[RS]MicuRobert System V0', shorttitle='MAC', overlay=true)
src = input(title='Source series:', type=source, defval=close)
ma0_length = input(title='Moving average length', type=integer, defval=1)
ma1_length = input(title='Moving average length', type=integer, defval=50)
sl_in_pips = input(title='Stoploss in pips:', type=float, defval=4.00, step=0.01) * (syminfo.mintick*10)

ma0 = sma(src, ma0_length)
ma1 = sma(src, ma1_length)
plot(title='MA0', series=ma0, color=gray)
plot(title='MA1', series=ma1, color=black)

crossup = crossover(ma0, ma1)
crossdown = crossunder(ma0, ma1)
direction_up = barssince(crossup) <= barssince(crossdown)
plotshape(title='UP', series=crossup, style=shape.triangleup, location=location.abovebar, color=green)
plotshape(title='DOWN', series=crossdown, style=shape.triangledown, location=location.belowbar, color=maroon)

buy_sl = direction_up ? na(buy_sl[1]) ? low-sl_in_pips : max(low-sl_in_pips, buy_sl[1]) : na
sel_sl = not direction_up ? na(sel_sl[1]) ? high+sl_in_pips : min(high+sl_in_pips, sel_sl[1]) : na
plot(title='BSL', series=buy_sl, style=circles, color=black)
plot(title='SSL', series=sel_sl, style=circles, color=black)

buy_close = direction_up and crossunder(ma0, buy_sl)
sel_close = not direction_up and crossover(ma0, sel_sl)
plotshape(title='BX', series=buy_close, style=shape.xcross, location=location.belowbar, color=green)
plotshape(title='SX', series=sel_close, style=shape.xcross, location=location.abovebar, color=maroon)

open_range = input(title='Open range value:', type=float, defval=0.0020, step=0.00001)
isnewday = change(time('D'))!=0
open_price = isnewday ? open : open_price[1]
open_top = open_price + open_range
open_bot = open_price - open_range
plot(title='O', series=open_price, color=isnewday ? na : black)
plot(title='OT', series=open_top, color=isnewday ? na : blue)
plot(title='OB', series=open_bot, color=isnewday ? na : blue)