Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version = 2
- study(title="test")
- source = close
- fastLength = input(12, minval=1)
- slowLength=input(26,minval=1)
- signalLength=input(9,minval=1)
- // res5 mutiplies the current interval which is an integer by a factor 5 and turns it into a string with the value of "interval*5" or "1D" depending on the value of interval*5
- res5= interval*5 < 1440 ? tostring(interval*5) : "1D"
- src5=security(tickerid, res5, close)
- fastMA5 = ema(src5, fastLength)
- slowMA5 = ema(src5, slowLength)
- macd5 = fastMA5 - slowMA5
- signal5 = sma(macd5, signalLength)
- outMacD5 = security(tickerid, res5, macd5)
- plot( outMacD5 ? outMacD5 : na, color= red)
- //@version = 2
- study(title="test")
- source = close
- fastLength = input(12, minval=1)
- slowLength=input(26,minval=1)
- signalLength=input(9,minval=1)
- // res5 mutiplies the current interval which is an integer by a factor 5 and turns it into a string with the value of "interval*5" or "1D" depending on the value 9of inteval*5
- //res5= interval*5 < 1440 ? tostring(interval*5) : "1D"
- res5= interval*5 < 1440 ? tostring(interval*5) : interval >= 1440 and interval*5 < 2880 ? "1D":na
- src5=security(tickerid, res5, close)
- fastMA5 = ema(src5, fastLength)
- slowMA5 = ema(src5, slowLength)
- macd5 = fastMA5 - slowMA5
- signal5 = sma(macd5, signalLength)
- outMacD5 = security(tickerid, res5, macd5)
- plot( outMacD5 ? outMacD5 : na, color= red)
- Add to Chart operation failed, reason: Error: Cannot call `operator ?:` with arguments (bool, literal__string, na); available overloads ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement