joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
813 stars 224 forks source link

Add name argument to add_TA #377

Closed SamoPP closed 1 year ago

SamoPP commented 1 year ago

Description

It would be nice to have a name argument in add_TA function (instead of lenv$name <- deparse(substitute(x))).

Expected behavior

Instead of using lenv$name <- deparse(substitute(x)) function argument name (if set, not NULL) would be used.

Minimal, reproducible example

[Insert your sessionInfo() output]

joshuaulrich commented 1 year ago

I just noticed that this is similar to #205. add_TA() and add_Series() have a legend argument to set the name. I'm going to update this fix to remove the name argument it added and make the fix using the legend argument.

joshuaulrich commented 1 year ago

I changed my mind. I tried to pass user-supplied 'legend' values through the plotting functions, but it didn't work seamlessly like it does when passing the 'name' argument. So I'm keeping this fix instead of doing what I said in my previous comment.