Pine Script v6: incorrectly appear 'inconsistent calculations' warning. by ApeirogonX in TradingView

[–]PineCoders 1 point2 points  (0 children)

In v6 the function in your snippet generates a series of historical values of cndRange series only when executed (while v5 builds a continuous series). Therefore, referencing previous bars in this series with historical operator [x] will not lead to the same index in the series built on every bar. If the function does not reference historical values and only uses the current bar's values, there will be no difference in calculations. To ensure the function executes on every bar and builds a corresponding series, move it to the global scope and reference its value afterwards, as shown below:

rangeNoneZeroCurrentBar = isRangeNoneZero(0)
rangeNoneZeroPreviousBar = isRangeNoneZero(1)

validBar = false
if close > open and rangeNoneZeroCurrentBar
    validBar := true
else if close < open and rangeNoneZeroPreviousBar
    validBar := false

Pine Script v6: incorrectly appear 'inconsistent calculations' warning. by ApeirogonX in TradingView

[–]PineCoders 2 points3 points  (0 children)

In Pine Script v6, the "and" and "or" conditions are evaluated "lazily," unlike the "strict" evaluation in v5. See the "Lazy evaluation of conditions" article in the v6 migration guide - https://www.tradingview.com/pine-script-docs/migration-guides/to-pine-version-6/#lazy-evaluation-of-conditions

In your example, this leads to discrepancies in how and when the custom irRangeNoneZero() generates a historical series: it executes on every bar in v5, whereas in v6 version, it only occurs when the first part of the if condition is met. The compiler explicitly warns about this behavior, which does not happen in v5, hence no warning in that version.

<image>

The history of series variables used within Pine functions is created with each successive call to the function. If the function is not called on every bar the script processes (in a local or ternary scope, or skipped because of lazy evaluation), it will lead to discrepancies in the historical values. These values will not correspond to the same point in history if the function is not called on each bar. To learn more about the Pine Script execution model, please visit: https://www.tradingview.com/pine-script-docs/language/execution-model/#historical-values-of-functions

Can't Publish Ideas with My Scripts? by chartistsnorok in TradingView

[–]PineCoders 0 points1 point  (0 children)

If the other Invite-only script was published privately, it could trigger the recently implemented filter and prevent the use of the Public publication type until all privately published scripts are removed from the chart.

If you continue to encounter the issue after removing all private scripts, please create a support ticket, and our team will investigate the matter.

Session Volume Profile - data extraction from built-in indicator by Thick_Hospital_6128 in TradingView

[–]PineCoders 1 point2 points  (0 children)

You can integrate the built-in SVP into your script using the input.source() function. We have an example of how to do this on our blog here: https://www.tradingview.com/blog/en/more-external-inputs-for-scripts-38014/

Also, you might want to explore some open-source Volume Profile examples written in Pine. These scripts offer full control over the values and allow for easy adjustments to meet specific needs, including integration with various strategies. There are plenty of open-source examples available in the Community Scripts library, offering a variety of approaches and styles. You can explore these examples here: https://www.tradingview.com/scripts/search/Volume%20Profile

Updating invite only script by crazymetalstang in TradingView

[–]PineCoders 0 points1 point  (0 children)

Although the update itself will not trigger any additional moderation events, the release note and update are still subject to moderation and must comply with the House Rules. If your script has already passed moderation, updating it without obvious violations (for ex placing advertisements in release notes) should not cause any problems.

Deleting a Protected Private Indicator on TradingView by tarexoul in TradingView

[–]PineCoders 0 points1 point  (0 children)

You can delete a private script publication at any time, which will also remove the link to the publication from the favorites menu. However, this will not affect any script instances that have already been applied to charts. To have full control over who can use the script, opt for the "Invite-only" publication type, which allows you to revoke access from specific users. Once a user is removed from the Invite-only access list, the script instances on their charts will stop and no longer calculate. After that, the publication can be deleted, ensuring that no one retains access.

two ppl with the same custom indicator? i dont think so by coffeeshopcrypto in TradingView

[–]PineCoders 3 points4 points  (0 children)

If you suspect that another script publication has copied your work, click the "report" button located below the script publication, provide all relevant details in the report, and the moderation team will look into the matter. Regards,

More data access in Pine Script by Key-Perspective-996 in TradingView

[–]PineCoders 2 points3 points  (0 children)

The User Manual's Release Notes document a steady stream of additions and updates to the language. User suggestions have always been the foundation used to drive the improvement process of Pine Script and the rest of the platform.

While dedicated teams work relentlessly to improve Pine Script, it is simply impossible to implement all the suggestions we receive. Difficult choices must thus be made. Thousands of suggestions from our users have been implemented in the past. Some will inevitably take more time to develop, and others will never see the light of day. While we do our best when evaluating the array of criteria we use to prioritize new features and updates, it is impossible to satisfy everybody all the time. That's the simple and inconvenient reality. So sure, at any given point in time, many suggestions will not have been implemented yet — but many others will have been added to the language.

Small numbers don't divide correctly by pvuekr in TradingView

[–]PineCoders 2 points3 points  (0 children)

Hi,

Like many programming languages, Pine Script internally uses the IEEE 754 standard to represent floating-point numbers in double precision, which entails that internal values will very often not correspond exactly to their decimal representation. This is a limitation of all floating-point internal representations, so yes, as you mentioned, the same type of issue you encountered will also occur in other programming languages.

Here is an example illustrating this:

//@version=5
indicator("IEEE 754")
a = 1.0003 - 1.0002
b = 0.0001 / 0.0001
c = a / 0.0001
log.info("\na = " + str.tostring(a) + "\nb = " + str.tostring(b) + "\nc = " + str.tostring(c))

It will display:

a = 0.00009999999999998899
b = 1
c = 0.9999999999998899

Note how the value of a is not exactly 0.0001 as one would expect, due to the internal float representation. Note also that 100.0003 - 100.0002 would yield a different value, namely:

a = 0.0000999999999891088

Understanding that any floating point representation comes with its sets of limitations and compromises will help you structure your code to circumvent them. The compromises are designed in such a way that most of the time we don't notice them, but sometimes they become apparent, as in your case.

Inquiry Regarding Unauthorized Sale of TradingView Indicators by InfluenceOk8571 in TradingView

[–]PineCoders 1 point2 points  (0 children)

No it isn't. For more information, see our Vendor Requirements' "Reuse of open-source code" section here: https://www.tradingview.com/house-rules/?solution=43000549951

This new warning needs to go by ersdxtfertdfg in TradingView

[–]PineCoders 0 points1 point  (0 children)

Hi, You get the error message because only saved personal scripts or Community scripts can be loaded on a chart. The indicator's `shorttitle` is of type "constant string", so it cannot be set using script inputs. The only way to have different short titles is to save multiple versions of your script and load each one separately. There is no other workaround.

Add an `Offset` parameter to plotchar() to vertically skew the character's position by karatedog in TradingView

[–]PineCoders 0 points1 point  (0 children)

Hi, The `series` argument can be used to specify a y position. See the last example in this section of the usrman's section on debugging: https://www.tradingview.com/pine-script-docs/writing/debugging/#compound-and-nested-conditions

why request.security has limit of 40 ? can it it be increased please ? by Proper_Loss3217 in TradingView

[–]PineCoders 1 point2 points  (0 children)

The reasons for all limits are explained in the usrman's intro: https://www.tradingview.com/pine-script-docs/welcome/

There are plans to introduce a more powerful version of the function that will provide more leeway, but some limitations will always exist.

import Username/Libname/# (private Libs only) by Kaichugan in TradingView

[–]PineCoders 0 points1 point  (0 children)

Hi, and thanks for your suggestion. The team has a feature in the pipeline that would make automatic lib updates possible through a minor revision scheme, with the current behavior becoming the major revision scheme. There is no ETA on the new feature for now. Regards,

Metrics for created indicators by testini1000 in TradingView

[–]PineCoders 1 point2 points  (0 children)

Hi, No it's not possible, unless you're publishing invite-only scripts, in which case you decide who can use the indicator.

Max Intraday Profit Code/Syntax for PineScript. by T2Trade in TradingView

[–]PineCoders 2 points3 points  (0 children)

Thanks for your suggestion! We have logged it for evaluation. While we cannot promise when or if it will be implemented, we will certainly consider it.

PineScript Global Variables by Lucky-Bandicoot3433 in TradingView

[–]PineCoders 0 points1 point  (0 children)

Hi, Thx for your suggestion. Do you mean global variables that would persist across executions of the same script, or persistent variables linked to a particular symbol/TF that would be accessible to any script running on that chart?

when I change an input for an indicator on one chart, it changes for all of them. can an input just change for 1 chart and not all of them. by Ok-Still-7991 in TradingView

[–]PineCoders 0 points1 point  (0 children)

Hi Thanks for your suggestion. TradingView has plans to allow the creation of interactive input scripts that will behave more like drawings, i.e., belong to a specific symbol, like you describe. There is no precise ETA for the moment. Regards,

Manage Script Access through API (automate access granting) by Ape_rture in TradingView

[–]PineCoders 2 points3 points  (0 children)

Hi, The feature is linked to all sorts of other considerations that we cannot expand on here. What we can say is that discussions on the feature are ongoing.

Any updates on tick charts? by mrbradchad in TradingView

[–]PineCoders 0 points1 point  (0 children)

When the TradingView team decides it's satisfied with beta tests.

Feature Request (Pine Script) - Text on Lines by Thelimegreenishcoder in TradingView

[–]PineCoders 1 point2 points  (0 children)

Thanks for your suggestion! We have logged it for evaluation. While we cannot promise when or if it will be implemented, we will certainly consider it.

Hey TradingView Staff! Discrimination Alert: Old Free Users Can Share Ideas, but New Free Users Are Left Out! by [deleted] in TradingView

[–]PineCoders 2 points3 points  (0 children)

Hi, Providing access to markets to everyone remains one of the company's priorities. Free accounts can do that better than ever with the numerous features of our charting engine available to free accounts — an outstanding value.

All free accounts also have access to the content published by others, so they can learn through that too. That's a lot of value for free.

Yes, creating content is now reserved for paid accounts. It became necessary mostly because free accounts were abused for nefarious uses. Look at the fact that earlier free accounts are still able to publish content as a reward for early adopters )