Category "pine-script"

An argument of 'float[]' type was used but a 'series float' is expected

I wrote this code in pinescript: kijen_forw(period ) => kjf = array.new_float(20) for i = 1 to period array.set(kjf,i,donchian(kijensenPeriod

"line 168: Syntax error at input 'end of line without line continuation'."

I'm trying to create a crypto trading strategy in TradingView, and everything was going well until my script decided to upgrade to v5. Everything works, but whe

PineScript strange behaviour creating Table. Table is displayed as dot when using IF barstate.islast to create table.cells

Hello I isolated code which cause this strange behavior. It is caused by variable price. Is there way around? //@version=5 strategy("My script",overlay=true)

Pine Script Fill Stop Order Only If Stop Price Was Reached Before Stop Loss

I'm building a strategy using Pine Script Version 5. I'm trying to create a stop order using strategy.order command. The command is working as expected and exec

Hi,Why i get this error? Cannot call 'operator ?:' with argument 'expr0'='Candy'

//@version=5 indicator(title='Rsi color', shorttitle='RSI col', overlay=false) theme = input.string(defval='Dark', title='Colors', options=['Candy', 'Dark', 'L

An argument of 'series string' type was used but a 'simple string' is expected when comparing close and vwap

When trying this code: strategy.risk.allow_entry_in(close > ta.vwap(hlc3) ? strategy.direction.long : strategy.direction.short) I get this error: An argume

"Highest value offset for a given number of bars back" meaning?

I'm new to Pine script, please, anyone explain me exactly what this high[abs(highestbars(amplitude))] statement returns, specially in highestbars(2) definition

converting pine script to mql4 ....This is indicator in Pine Script language. Can anyone help me to convert it into MQL4

This is a High/Low indicator in Pine Script language. Can anyone help me to convert it into MQL4. It should be very easy for some of you https://www.tradingview

Get the bar_index of the first bar that has a lower low than the low of the current bar

To find divergences I'm trying to get the bar_index of the first bar that has a lower low than the low of the current bar. I wish I could inject current bar va

How to cancel orders if they are not triggered within 1 bar?

How do i prevent orders from remaining open and executing later. For long entries i have a buystop = high, so if the next candle the price doesn't hit the high

I confuse convert Tradingview Strategy to study strategy.position_size and strategy.position_avg_price to study

I try to convert Strategty to study I don't know it right? if Long strategy.entry("L", strategy.long) if Short strategy.entry("S", strategy.short) I c

CUSTOM RELATIVE between two securities

there is a Study to build a RELATIVE between two symbols that is like this: ` study("RELATIVE STRENGTH", shorttitle="RS") a = tickerid b = input("SPY", type=s

How to locate lines we drew on the chart e.g. for marking trends, support/resistance? Pine Script V5

There you can see two horizontal (dotted white) lines on the chart below, placed manually. Is it possible to make the script retrieve their locations?

Pinescript trade pause xx hours after wins

I want to apply a function to pause the strategy for xx hours or bars after win trade, how to do that? because my strategy is trending so there is always a peri

How to connect tradingview to 3commas (stop loss)

How can I put the stop loss in my strategy in tradingview to 3commas bot? I am using this code for trailing profit and stop loss strategy.entry("Short", strateg

How to create TradingView indicators that look like this?

I've been trying to create similar indicator to this This is the reference I have the code for RSI, Stochastic RSI, MACD and 50/100/200 MA (with crosses), but I

How to create TradingView indicators that look like this?

I've been trying to create similar indicator to this This is the reference I have the code for RSI, Stochastic RSI, MACD and 50/100/200 MA (with crosses), but I

Convert pine script code to version 4 or 5

I would like to convert this script from version 2 to version 4 or 5 in order to create buy and sell alert messages. Can someone help me with this or explain it

Pine Script - Multiple Conditions in few bars

I have 3 conditions that needed for entry. But they can be met in 4 bars. I use MACD, stochastic and RSI. For example, in first bar there is macd lines cross, a

Alert function for order blocks

I recently started trying to code in Pine on my own and built my own OB indicator with help from some other indicators. I know want to add an alert, that is tri