Where should I make changes in the code to solve the error in Pine script v5 for tradingview - pine-script-v5

I am using this code to plot a horizontal line from 9:42 AM candle close each day in tradinview Pinescript verson 5 but getting errors...please help :(
The code
The erroryour text

There is no 'end' at the end of a for block in pinescript.
Delete the line 17 with 'end', this error will disappear.

Related

Replace default chart in Pine Script while using overlay=true

Is it possible to replace/make invisible the default chart using Pine Script? As an example, the default chart always shows candles. I would like to write an indicator (using overlay=true) to erase (or make invisible) the default candle chart and replace it by just plotting the close values (e.g., plot(close)). This is just a simple example to illustrate what I want to do and where I'm getting stuck. Thanks in advance.
That's something I've needed in the past too, but unfortunately there's currently no Pine Script command available that allows for the manipulation of the visibility of the symbol on the chart.
It can be partially done, by making the body of the candle the same as the background color, but that still leaves the candle wicks and border intact.
barcolor(chart.bg_color)
Unfortunatly, there's no command to do the same for wickcolor and bordercolor.
Another approach could be to plot a new bar over the existing bars, with body, wicks and border all in the background color.
However, that will not work either - not even when you use explicit_plot_zorder=true - because the z-index of the chart symbol is always seems to be higher.
//#version=5
indicator("My script", explicit_plot_zorder=true, overlay=true)
plotcandle(open, high, low, close, "hideCandle", chart.bg_color, chart.bg_color, bordercolor=chart.bg_color)
So, in short, no solution for this yet.

Flot chart x axis time is displaying wrong details in the starting of xaxis

I am facing an issue with flotchart x-axis time issue. XAxis data is displaying the wrong details.
Here in the Datagrid time is started from 13:00:04, but in the chart, time is starting from 8:00`.9:00,10:00:11:00:12:00 as you can see in the above screenshot. Actually, it should start from 13:00, I am not sure why 8:00, 9:00 ...12:00 are coming in the chart x-axis. Can anyone please help me? Thanks
Below is the code snippet.

How can you have next line or auto next line in Math.tex in flutter?

I am using flutter_math_fork package to display equations. But sometimes I want to display some text after equation like,
Math.tex('x=y \\text{Equation 1 is looooooooong}'). I am trying to have next line as the "text is long", but \n doesn't work, or how can I have auto next line? Thanks

Get session-time (start and close time) of main chart series in pinescript

I am currently trying to write up a script in Pine Script for TradingView, and am having difficulties getting the session (the start and close times) of the current displayed main chart series.
e.g for Nikkei225, the session would be 8:45am - 5:30am (UTC+9)
I am using this to make a Ku-Chart which resets every day on the close time of the main chart series.
Also having difficulty drawing a vertical line at this close time.
Any help would be appreciated :)
See the How To Show Vertical Lines script by allanster.

Tableau add trend line to discrete data?

I have run into this more times then I like, and I think it will continuously haunt me. I am creating reports/dashboards that report monthly or yearly or weekly data. The dates come in with just the last day of the period. For example, now I am working 2019 monthly report that is a bar chart with a trend line. Took me about 15 minutes to make in excel. However, we are trying to move everything into Tableau for dashboards. Trend line is always grayed out when using discrete dates and sometimes when using continuous dates. The dates are in the format DD/MM/YYYY so I can convert them as continuous but that skews the spacing on the X-Axis. I have messed around to get it to work but it takes time. I am shocked that this very basic thing does not work when Excel has been able to do it for a very long time. Does anyone know of a good work around? I have tried calculated the trend line myself, but do not see how I can add in the y=mx+B line that is generated. I am debating creating a data set just for this, but that seems long and hard way for something that I would have expected out of the box. Below is some basic data, in Excel it takes about 1 minutes to create a line chart, click (+) add trend line and your done.
I was not able to deal with the skew of the X-Axis very well but playing with the date it started and setting the major tick marks to monthly got me close. Looking at the picture below you will see the tick marks are not in the center of the bars but close. As for the trend line, I added a Dual axis on the same data that was the sum of all shown fields with no division by the parts (this is a stack mark bar chart). Since this is a basic line chart with continuous dates, a trend line is a simple click. I then removed the Tick Markets and set the opacity to 0% making the line invisible. I did not change the trend line so now that is all you can see. Seems like a long and hard way to do it, but it works. (UPDATE) Better fix, NEVER USE EOM always use First of Month.