-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed is_market_listed() for multi pane charts where the first pane i…
…sn't a price chart Signed-off-by: timelyart <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timelyart the very first time you load a chart evaluating
div[class^="price-axis-currency-label-wrapper"] > div:nth-child(1) > div:nth-child(1) > span[class^="price-axis-currency-label-text"]
on a multi-pane layout it will return an empty string even when the symbol is valid. Only when you disable/enable the strategy, will it populate with a value. We had exactly the same problem when using the price axis to read the currency and, therefor switched to reading that from the properties tab.ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Yes, I remember now. I'll change it to what you suggested earlier.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After doing some more testing.... the currency symbol seem to show up now even if it is the first chart, regardless of it being a multi chart and/or multi pane layout.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested and on a multi pane it still doesn't show up for me.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't come up in the DOM for you?
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DOM element does come up, but it has no text value (initially). Only when you toggle the strategy on/off the value gets populated.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How odd... it seems to work fine for me. I cleared the cache and opened a layout with 3 charts and 2 panes per chart (price + MACD).
All the MACD panes have an empty text value but all the price panes have a currency immediately (in my case BTC).
Maybe it depends on the asset class? What is the initial ticker on your chart?
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm checking crypto assets and this is a common pattern across all pairs.
Upon loading the chart
div[class^="price-axis-currency-label-wrapper"] > div:nth-child(1) > div:nth-child(1) > span[class^="price-axis-currency-label-text"]
evaluates to<span class="price-axis-currency-label-text-SfCx6ur0"></span>
.After toggeling the strategy on/off it evaluates to
<span class="price-axis-currency-label-text-SfCx6ur0">BUSD</span>
as expected.ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange.
Even though I can no longer reproduce this issue myself, I'll search for the 'invalid symbol' text instead per your earlier proposal.
It is a shame, as searching for something that shouldn't be there is less efficient than searching for something that should be there.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a solution in between where only for the first market Kairos will search for Invalid symbol and the other markets it will search for the currency on the price axis.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that's not going to work. The price axis value stays empty upon changing the market. The only solution that works on my end is toggling the strategy on/off. But that's even less efficient.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. I never had this issue that severe. I only remember it from when the chart got opened but changing markets did work.
You are running MacOs, correct?
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deceiving thing is that once you've got it populated it works from that moment on across all charts. But the only way (I have found) to populate it is by turning the strategy on/off.
Correct.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a refresh help?
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope unfortunately not.
I'm surprised that you're not experiencing this. Are you sure that you have set the indicator in the second pane as an external indicator in the strategy of your first pane? So these two panes need to be "connected". When they aren't you don't run into the issue.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. No. This was not clear to me at all.
I tried with my own strategies but I can only add indicators with
/
, and then it either integrates with the price chart, or gets onto a separate pane.How do you set the indicator in the second pane as an external indicator in the strategy of your first pane?
Have you contacted TV support about this?
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.tradingview.com/blog/en/use-an-input-from-another-indicator-with-your-strategy-19584/
Yes, already in August. They have confirmed that it's a bug.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the link. I had all but forgotten about that.
Personally, I haven't seen the need for this as I write Pine myself but I can see how it is useful to apply other people's scripts on more indicators and extend their utility.
I'll add an option to the YAML configuration in order to handle this issue.
ad88770
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue to handle this bug from Kairos' perspective.