Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
"The developer used a lot of cum on this module. In fact, there's cum all over the project."
-
Voxera113886yAccording to their docs you should be able to have multiple statements in a line if you separate them with a comma and start the new statement directly after the comma, no space
https://tradingview.com/wiki/...
Also their ”lambdas” are not lambdas but they call them “single line functions”.
So its just a way to shorten very simple functions like one expression. Its not really a lambda.
But I do agree its seems very haphazardly designed :/ -
Root797706y@Voxera I went over the docs several times and didn't see the comma syntax. Maybe the docs linked from the editor are different?
And yeah, they aren't lambdas, just fancy function declarations. -
Root797706yAnother infuriating FineScript issue:
It is impossible to get an integer, float, bool, color, etc. out of a series (array). You can, of course, but the data is ALWAYS still a series.
Several functions require a float or integer, such as `color(color color, integer/float transp)`. If you give it a series, the parser/compiler pukes. However... the [] operator on a series always returns data of type series, all math on series data returns a series, and there is no explicit casting, making it impossible to use any series data in many scenarios. And since it's for writing indicators for use on stock, crypto, etc. charts, most data is in series form (candle data, moving averages, ...).
colors // a series of colors
colors[1] // a single color. of type series.
ma8 // 8-candle moving average
ma8[1] // a single average, of type series.
cum(ma8[1]) // the cumulative sum of a single-element candle average... of type series.
cum(abs((ma8[1] * 100.0)) // You guessed it: returns a series containing a single float.
Dgkdgjgsjfdhk. -
@sergiolarosa89 cum array? That sounds like a Japanese product to clean up protein stains...
New cum array! Cleans the stains you love to make -
You guys haven't even seen the worst of it.
len=input(9,"Length")
len2=9
These two AREN'T equivalent. They're different variable types, and if you use seriesvar[len] or serisvar[len2] in a conditional that uses barstate.islast, the former will choke with an error message that you need to set max_bars_back, but the latter will work just fine.
What's worse, if you use the function form of max_bars_back as recommended by their docs, you have to set it on the builtin variable 'time', which isn't even directly referenced: max_bars_back(time,5000). You just have to know this from having made the mistake, googled, & found the only place they buried mention of it, at the bottom of their Drawings docs page.
It turns out it has to do with the compiler being certain ahead of time of Literal variables but needing to wait until runtime for Input variable values. But, talk about unintuitive. And the error messages tell you nothing.
These are the sorts of things about Pine that make me crazy. -
Paulmarkax04yI beg to disagree with yoll
First, i dont think that any of you has really had to give a keen look at this platform. Its a mess, and thats just my opinion.
Second, am almost certainly sure that none of you is a trader.
Third, you all need to come to terms that the world is relative. Everything is subjective. We all experience the world by way of an individual experience.
Now, the only way for each of us to comprehend or make sense of that “Individual Experience” is by comparing one thing to another.
So, I really dont judge any of you critics here but yoll need to understand that your criticism is merely a comparative analysis. Not facts but opinions.
While that is allowed, it is absolutely unnecessarily illegal and even evil to try and get others into buying your personal opinions.
I began learning programming as a trader and from pine. And it made perfect sense. You know why, I dint have any prior knowledge to compare it to.
So please give us a break!!!!! -
Root797704y@Paulmarkax
My girlfriend and I are traders, both crypto and stocks, and we’ve been decently successful at it. I’ve written several indicators in Pine, but stopped because it’s too much effort fighting with the language, and honestly just glancing through the charts (plus some MAs) tells us enough anyway.
Just because Pine is your first language does not mean that it is decent. I’m sure you are aware of its flaws, or at least some of them. Please don’t dismiss or explain them away; see them for what they are.
Also, if you’re even a little interested in programming, try picking up another language like Ruby or Python. They’re bliss by comparison, and worlds more useful. -
karatedog13y@Paulmarkax
No problem with Pine whatsoever, just nobody should call it a programming language. That needs fundamental rework.
I tried to fix an `if`, `then`, `else` structure for 10 damn minutes. Not to mention that documentation has notes on `then`, problem is, this keyword does not exist at all. I have seen non-updated documents to contain stuff that existed before but I have never seen documentation that contains stuff that never existed...
I understand the need that Pinescript shouldn't be Turing complete, this way it is possible to analyze externally and filter out bad code.
But this could have been done picking an already existing, small footprint programming language (like Lua) and build a domain specific language around it (DSL).
When you need to fix an if-else statement for 10 minutes and it is not even trivial to write, that "language" is a clusterf*ck.
Related Rants
PineScript is absolute garbage.
It's TradingView's scripting language. It works, but it's worse than any language I have ever seen for shoddy parsing. Its naming conventions are pretty terrible, too:
transparency? no, "transp"
sum? no, cum. seriously. cum(array) is its "cumulative sum."
There are other terrible names, but the parser is what really pisses me off.
1) If you break up a long line for readability (e.g. a chained ternary), each fragment needs to be indented by more than its parent... but never by a multiple of 4 spaces because then it isn't a fragment anymore, but its own statement.
2) line fragments also cannot end in comments because comments are considered to be separate lines.
3) Lambdas can only be global. They're just fancy function declarations. Someone really liked the "blah(x,y,z) =>" syntax
4) blocks to `if`s must be on separate lines, meaning `if (x) y:=z` is illegal. And no, there are no curly braces, only whitespace.
There are plenty more, but the one that really got me furious is:
98) You cannot call `plot()`, `plotshape()`, etc. if they're indented! So if you're using non-trivial logic to optionally plot things like indicators, fuck you.
Whoever wrote this language and/or parser needs to commit seppuku.
rant
or python?
pinescript
or fucking euphoria?
or ruby?
why can't they just use lua?
or javascript?
tradingview