This seems like it should be easy, but I'm stuck. I simply want to be able to turn on or off the AssignPriceColor function with a user option.
I have a user option:
input show_price_bar_colors = yes;
later in the script I have the AssignPriceColor function. The below code somewhat worked, but it seems like it should be easier than this. I can turn off all the colors assigned by the if statements, but that last "else" that applies to all other conditions ends up painting all the bars.
How can I just toggle the AssignPriceColor function on and off so I either get the custom settings or the default chart settings?
Thanks!
I have a user option:
input show_price_bar_colors = yes;
later in the script I have the AssignPriceColor function. The below code somewhat worked, but it seems like it should be easier than this. I can turn off all the colors assigned by the if statements, but that last "else" that applies to all other conditions ends up painting all the bars.
Code:
AssignPriceColor(if (big_vol_price_up and show_price_bar_colors) then GlobalColor("big_vol_price_up") else if (big_vol_price_down and show_price_bar_colors) then GlobalColor("big_vol_price_down") else if (little_vol_price_up and show_price_bar_colors) then GlobalColor("little_vol_price_up") else if (little_vol_price_down and show_price_bar_colors) then GlobalColor("little_vol_price_down") else GlobalColor("normal_vol_price"))
How can I just toggle the AssignPriceColor function on and off so I either get the custom settings or the default chart settings?
Thanks!