Search found 20 matches

Go to advanced search

by kmarryat
Mon Mar 15, 2021 2:16 am
Forum: Request Scripts
Topic: change color RSI
Replies: 2
Views: 1505
 
Jump to post

Re: change color RSI

Hi, I think this is what you described. //@version=4 study("RSI Color") //RSI Calc RSI = rsi(close, 14) //Ternary Condition to Set Color - if RSI > 70 then yellow, if RSI < 60 then purple, otherwise white RSIColor = RSI > 70 ? color.yellow : RSI < 60 ? color.purple : color.white //Plot RSI using def...
by kmarryat
Sat Feb 27, 2021 9:07 pm
Forum: Pine Script Q&A
Topic: Access value from custom indicator in pinescript
Replies: 7
Views: 13775
 
Jump to post

Re: Access value from custom indicator in pinescript

TV can only access 1 external plot from 1 external indicator at a time. You can use your 1 source input to switch from one external indicator/plot to another, but only one at a time. Since you can only have 1 source input, you can only look at 1 indicator/plot at a time. That's why I went with the s...
by kmarryat
Sat Feb 27, 2021 7:29 pm
Forum: Pine Script Q&A
Topic: Access value from custom indicator in pinescript
Replies: 7
Views: 13775
 
Jump to post

Re: Access value from custom indicator in pinescript

You can only access 1 external plot value. I have developed a process for accessing multiple signal values from an external indicator by doing the calculations in the external script. Then convert the individual signals into a single decimal value that I plot. Then convert the decimal value back to ...
by kmarryat
Sat Feb 27, 2021 7:15 pm
Forum: Pine Script Q&A
Topic: Access value from custom indicator in pinescript
Replies: 7
Views: 13775
 
Jump to post

Re: Access value from custom indicator in pinescript

In order for the External Indicator feature to work you can only have 1 input of the type input.source in your strategy/study that is trying to access the external value. Are there any other inputs in your Pinescript strategy that are set as input.source? An I'm pretty sure the plot statement needs ...
by kmarryat
Fri Feb 26, 2021 8:55 pm
Forum: General Trading Discussions
Topic: indicator for measuring the average bar size?
Replies: 3
Views: 9467
 
Jump to post

Re: indicator for measuring the average bar size?

Hi dusktrader, A common indicator for dynamic stops is ATR (Average True Range), check it out. Generally a multiple of ATR is used. IE. 2*ATR for Target, 1.5 * ATR for Stop. Here's a short code snippet to compare a simple average of bar ranges with ATR. //@version=4 study("Range",overlay=false) Rang...
by kmarryat
Fri Feb 19, 2021 2:48 pm
Forum: Pine Script Q&A
Topic: Input function to disable script on higher time frame
Replies: 4
Views: 2170
 
Jump to post

Re: Input function to disable script on higher time frame

Hi @frien_dd, Nice Script! A great example of how to use an input to enable/disable output. Since your loadIndicator is using timeframe.multiplier it would still show output on Daily,Weekly,and Monthly charts. Since those periods have a multiplier of 1, which is less than your inputMaxInterval of 30...
by kmarryat
Thu Feb 18, 2021 11:35 pm
Forum: Pine Script Q&A
Topic: Convert day of week and time to other timezone
Replies: 10
Views: 4955
 
Jump to post

Re: Convert day of week and time to other timezone

@Fxxtrader - the time variable is based on the bar open time. try changing the source of the dayofmonth function to time_close. FirstBarOfMonth = dayofmonth(time_close) < dayofmonth(time_close)[1] if FirstBarOfMonth LabelText = tostring(month(time_close),"1st Bar\nMonth ") LabelAbove = label.new(x=b...
by kmarryat
Thu Feb 18, 2021 11:31 pm
Forum: Pine Script Q&A
Topic: Input function to disable script on higher time frame
Replies: 4
Views: 2170
 
Jump to post

Re: Input function to disable script on higher time frame

You can't disable a script using an input but you can use an input or a condition to determine whether your output is displayed. I think the simplest way to accomplish what you described is to add a timeframe.isintraday condition to your plotshape statements, That way they will only display when the...
by kmarryat
Thu Feb 18, 2021 10:55 pm
Forum: Pine Script Q&A
Topic: Making Label Optional
Replies: 2
Views: 1201
 
Jump to post

Re: Making Label Optional

Conditional label. Create a boolean input to turn the label display on an off, then place the function call in an if statement ShowLabel = input(defval=true, title="Show Label", type=input.bool) f_print(_text) => var _label = label.new(time, y=na, text=_text, xloc=xloc.bar_time, yloc=yloc.price, col...
by kmarryat
Thu Feb 18, 2021 10:26 pm
Forum: Pine Script Q&A
Topic: arrays
Replies: 1
Views: 692
 
Jump to post

Re: arrays

I don't think your issue is with the array but with the color.new function. color.new only accepts a constant integer for the transp parameter. When you use := to change the tranp variable it changes from a constant integer to a series[integer]. color.new will not accept a series[integer] as the tra...

Go to advanced search