Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 20:49:22 +0000



Post From: sc.YPixelCoordinateToGraphValue();

[2017-03-18 07:38:34]
User553714 - Posts: 184
I have spent a fair bit of time trying to resolve this but it seems like an issue with the function itself?
With AutoLoop=1. when you set sc.YPixelCoordinateToGraphValue() to a value in the main price graph region, for example sc.YPixelCoordinateToGraphValue(37) the function returns after the study is added correctly with the main price graph Yaxis region value. However when you set the function to a return a value in the region of the attached study, say MACD in chartRegion 2 with sc.YPixelCoordinateToGraphValue(900), the function returns with incorrect values until the chart is placed in replay/live mode at which point it starts to return correct MACD scale values.

I thought that this might be an issue with when the MACD subgraph is getting populated but surely these would be fully calculated by the time it returns for a 2nd time after running through SetDefaults? Even a manual recalc or reload & recalc it won't return the correct values; it only returns correct values when the chart is placed in replay or live mode? The code itself is physically after the MACD subgraphs are calculated so there should be no precedance issues?

Am I missing something and is the function working as you would anticipate?
Regards