Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Color options is added to indicatorDialog even if the color is passed as an argument to plotline #335

Open
2 of 3 tasks
adeacetis opened this issue Jun 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working scripts Custom scripts / indicators related ux UX enhancements/proposals to make users' life better

Comments

@adeacetis
Copy link
Collaborator

adeacetis commented Jun 12, 2023

Describe the issue

If your script contains a plotline method, a color attribute is added to the sidebar.

If you pass a given color as an argument to the method, the color attribute is still visible but is useless. Nonetheless, it will temporarily preview the color in the chart if changed but the result won't be saved.

If you pass a variable as an argument, this variable will be added as a new attribute to the sidebar next to color which would still be useless.

If you have several plotline methods without color arguments, only one attribute is added to the right sidebar.

Steps to reproduce

(Preferably from a clean environment / incognito mode)

CASE 1: 1 plotline method with static argument

  1. Click on Add Indicator
  2. Copy-paste the following line in the script editor
plotline(avg_close(bar), color=blue)

You should see this:

image

  1. Change the color attribute

image

  1. Close the indicatorDialog

image

In this case, since we have a valid color passed as an argument, I am not expecting to see a color attribute added to the sidebar

CASE 2a: 1 plotline method with a dynamic argument of name 'color'

  1. Click on Add Indicator
  2. Copy-paste the following line into the script editor
plotline(avg_close(bar), color=options.color)
  1. Change the color attribute

image

  1. Close the dialog.

It should work as expected, the color is saved and visible onto the chart.

CASE 2b: 1 plotline method with a dynamic argument of a name different than 'color'

All the same steps as CASE 2a to the exception that the variable name passed as an argument.

plotline(avg_close(bar), color=options.color2)

Now we have two color pickers in the sidebar. color attribute is useless as explained earlier but the line will eventually be as defined in color2.

image

CASE 3: multiple plotline methods with dynamic arguments

In the next screenshot, the color attribute is green here, as seen in the next screenshot.

image

The problem is that it does absolutely nothing. If you change the color or focus outside the indicatorDialog, it will override all other colors passed as arguments in plotline methods and then revert the color to the user-defined once I close the dialog.
Color shouldn't be visible if a color argument is passed explicitly to all `plotline methods found in the script.

  1. Import the following indicator which defines 3 plotline methods.

indicator_ichimoku.txt

  1. Change the color attribute.

It overrides dynamically defined colors temporarily.

image

  1. Exit the dialog.

Lines' colors revert back to user-defined colors in indicatorDialog.

image

In this 3rd case, we observe there's a single automatically populated color attribute for 3 plotline methods in the script.

A color attribute should be added to the sidebar for every plotline that has no color attribute defined. The order should follow the order of appearance of the methods in the scrip.

Summary

[ ] I added my browser's console output in the issue (open the console first, try to reproduce the issue then see if there is anything)

  • I have attached an export of my aggr database in the issue
  • I documented the issue with screenshots
  • I provided a clear and concise description of what the bug is (see both sections below)
@adeacetis adeacetis added bug Something isn't working ux UX enhancements/proposals to make users' life better scripts Custom scripts / indicators related labels Jun 12, 2023
@adeacetis adeacetis assigned adeacetis and Tucsky and unassigned Tucsky and adeacetis Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripts Custom scripts / indicators related ux UX enhancements/proposals to make users' life better
Projects
None yet
Development

No branches or pull requests

2 participants