Category "pine-script"

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

Get & apply setting (e.g. color) from another indicator

I am creating multiple indicators - ideally to be used together. Since many levels share the same coloring, I was wondering if I can get the color a user may sp

Create MACD band on Tradingview

My idea is to make the MACD histogram oscillating in a range from 0-100 just like the RSI. I did it successfully, but compared to normal MACD histogram it is to

Pine Script v5, EMA clouds and alerts

Trying to learn Pine script here to optimize my trading strategy. I have around 1.5 year of experience trading. The trendsystem Im using is the all mighty Ripst

PineScript order entry, stop loss and take profit

I am just getting to grips with PineScript and more specifically writing strategies to place orders/trades however, have a quick question. I want to create a ba

My strategy.cancel does not close my trades, when criteria is met. Why?

I'm trying to hunt down a bug. My strategy wouldn't close, even if the closing criteria is met. I checked multiple point manually, using the Data Window which c

Relative volume by time of day

Relative volume is the ratio of the current volume to the average volume during a prior number of bars. Given that volume changes drastically by time of day, a

how to plot labels up to yesterday not for current day in pine-script

study("temp",overlay=true) startDate=input(title="StartDate",type=input.time,defval=timestamp("01 Jan 2000 09:15:00 UTC+5:30")) // newDay=change(time("D"))!=

plotcandle and plotbar don't support " offset " argument like plot and plotchar

I want to predict and generate candles and show them in the chart after current time but plotcandle and plotbar don't support the offset argument for shifting m

Pinescript "undeclared Identifier"

I am getting an Undeclared identified 'd' error. This was converted from an indicator that had alerts. But when I had them in TV nothing would happen. I can't s

Problems to Define Strategy with RiskReward Ratio

I am trying to define my strategy based on desired values of RR (RiskRewardIndex), and risk ro reward ratio changes by currency and timeframe. I use the dist

Checkbox toggle not matching input

Is it no longer possible to toggle a "checkmark" input box to match a coded switch? I believe we used to be able to do this and have the checkmark box toggle on

Movable vertical line pine script

I want to add a vertical line like below pic and it should be movable line, I'll tried many codes but they can't add movable vertical line, how can I do this ?

Draw a horizontal line in Pine at trade entry

There is a simple script on Pine. When executing strategy.entry, I try to draw a horizontal line at the level of the trade entry price. The only way I found to

Get indicators on 1 hour daily time frame in correlation to daily timeframe

In one hour timeframe I am trying to study the four days of daily candles to know the trend to create an indicator on the 1 hour chart if I should make a sale o