Questions tagged [pinescript-v5]

40 questions
0
votes
1 answer

Need help fixing the script to Pinescript Version 5 Tradingview

So I have a script that was version 2, and I tried to convert it to version 5, but it seems like there are still 2 errors, and I personally can not seem to get it to work. I tried to change as much as my own knowledge allowed me, and now I need help…
0
votes
0 answers

Trailing stop loss price reversal on entry candle

i have a pine script which calculates trailing stop price and the problem is when the entry is made the trail stop shifts downward if the price reverses immediately after the entry is made and resulting is loses to be huge for intraday move and risk…
0
votes
1 answer

Opening a position every 1 minute in Pine Script v5 (if there is not opened a position)

I want to run/execute the script every 1 minute. Everytime it checks if there is no position opened. If there is no position opened then it opens a new position. I just need a hint how to open a position every 1 minute. I am going to implement it…
0
votes
2 answers

Bar crossover wont work on my plotted box

I have coded to create a box when a specific confition is detected, the box is stored in an array and plot on the chart correctly. I have plotted the box to cut off when price crosses the average line and all this plots ok however when i try and…
BigH
  • 3
  • 1
0
votes
1 answer

Is it possible to return the bar_index of a PivotHigh in Pine Script 5?

I'd like to set the index of bar_index[] based on ta.pivothigh in a dynamic way. // PivotHigh Check leftBars= input(4) rightBars = input(4) ph = ta.pivothigh(leftBars, rightBars) plot(ph, style=plot.style_circles, linewidth=3, color=#ffffff,…
Mlabuit
  • 65
  • 7
0
votes
1 answer

How to define the 'return type form' of a pinescript method/function?

I have a library method that I want to call in a const context. The problem is that I cannot define the type form of the output of the method and pine script uses the defaulted "series string" type. My method looks like this: // @function make_title…
Jason
  • 97
  • 7
0
votes
0 answers

Pinescript to Discord Alerts with embeds

Trying to setup a tradingview v5 strategy to send alerts to discord via webhook. I found another user question and the code below was used. Similarly, I cannot get the alerts to go to TV. I can get it to work if I manually type into message window…
0
votes
1 answer

Unable to plot background & bar color for TradingView in Pine Script

enter image description hereenter image description here I am trying to build a BUY/SELL Indicator for TradingView by EMA. Conditions for BUY Signal: The 9 EMA LINE (Green) is above the 18 EMA LINE (Red) Conditions for SELL Signal: The 9 EMA LINE…
-1
votes
1 answer

Pine Script code converted from v.1 to v.4 not working as intended

I've tried to convert this Pine Script v.1 code from the first version to the v.5 and it seems to not work as it would do with the v.1 version. I've tried to apply the most frequent changes needed top convert the v.1 code in the v.5 code so far but…
GGG
  • 1
  • 1
1 2
3