any chance of having this coded for .NET?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

any chance of having this coded for .NET?

Postby arnie » 19 Aug 2015

Hi.

Here is another basic study that everyone should have in their chart platform. A study that plots the OHLC, namely yesterday's RTH high, low, close, yesterday's full day high and low, today's overnight high and low and also today's RTH high, low and open.
The result would be something similar to this

Image

For better management of all plotted data, we should have inputs for each group since user might not want to see everything plotted at the same time. Also, a time input would facilitate the settings for ETH and RTH session so it could be applied in every market.
Attachments
ohlc.png
(30.36 KiB) Downloaded 3123 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 19 Aug 2015

I'll try to code this for you if it's not urgent (I'm working on another script that I want to finish first, so I won't start working on it right away). I'll let you know the progress on this 'session OHLC' indicator.

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 21 Aug 2015

I'll try to code this for you if it's not urgent (I'm working on another script that I want to finish first, so I won't start working on it right away). I'll let you know the progress on this 'session OHLC' indicator.
For sure Josh, no urgency. I'm happy that someone is offering their knowledge to make the .NET study experience more rich.

And not wanting to push my luck here, remember this thread viewtopic.php?f=20&t=46112 ?
Will it be possible to code it now?
Personally, I really don't care anymore about the channels, way too much information. I just would like the VWAP. You can see it plotted in the chart above, the gray line.

Regards

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 24 Aug 2015

Here is another basic study that everyone should have in their chart platform. A study that plots the OHLC, namely yesterday's RTH high, low, close, yesterday's full day high and low, today's overnight high and low and also today's RTH high, low and open.
I'm pretty far in terms of progress, but I'm not clear about what "24Hi" and "24Lo" mean. These are horizontal charts on your chart, but I interpreted it as the 'highest high and lowest low of the last 24 hours' based on their name (24Hi and 24Lo).

That would give a chart where the "24Hi" and "24Lo" lines are not horizontal but move along the price action of the last 24 hours, like this:

Image

If you can say what 24Hi and 24Lo mean, that would be great.
And not wanting to push my luck here, remember this thread viewtopic.php?f=20&t=46112 ?
Will it be possible to code it now?
Personally, I really don't care anymore about the channels, way too much information. I just would like the VWAP. You can see it plotted in the chart above, the gray line.
You're surely not pushing your luck. :) It's no problem; I'll look into that indicator after the session OHLC (taking it one at a time).
Attachments
scr.24-08-2015 21.42.39.png
(12.26 KiB) Downloaded 3104 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 24 Aug 2015

I'm pretty far in terms of progress, but I'm not clear about what "24Hi" and "24Lo" mean. These are horizontal charts on your chart, but I interpreted it as the 'highest high and lowest low of the last 24 hours' based on their name (24Hi and 24Lo).

That would give a chart where the "24Hi" and "24Lo" lines are not horizontal but move along the price action of the last 24 hours, like this:

Image

If you can say what 24Hi and 24Lo mean, that would be great..
24hHi and 24hLo actually are indicating yesterday's full day (ETH + RTH) high and low.
Some traders prefer to just look at regular trading hours, others the entire full day session. Personally I like to look at both separately.
This way the study extends into today's session yesterday's RTH session high and low and yesterday's full session high and low. That's why they plot horizontal lines.

Today's full session high and low can be viewed by looking at the overnight high and low and the RTH high and low, so there's no need to plot it.

I see that you are also making the lines start plotting only when today's trading day starts, not plotting them for the prior days (I love that), although you should give the option to show the lines on previous days since there are traders that need to see them.

The study will recognize futures full trading day right? The full trading day for ES for example, starts today at 17:00 pm and ends tomorrow at 16.15 pm.

Did MC coded the CurrentSession function for .NET?
You're surely not pushing your luck. :) It's no problem; I'll look into that indicator after the session OHLC (taking it one at a time).
For sure Josh. One at a time.
A big thank you I give you for all this work.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 25 Aug 2015

I see that you are also making the lines start plotting only when today's trading day starts, not plotting them for the prior days (I love that), although you should give the option to show the lines on previous days since there are traders that need to see them.
Yes, that's possible but traders will need to change the lines to 'points' or 'cross' because otherwise those 'ugly connecting lines' appear.
The study will recognize futures full trading day right? The full trading day for ES for example, starts today at 17:00 pm and ends tomorrow at 16.15 pm.
Yes, it can deal with those overnight sessions.
Did MC coded the CurrentSession function for .NET?
I don't know; it's not in my MC NET install. I also don't know of that function.

=======
session-ohlc.zip
(7.59 KiB) Downloaded 377 times
The indicator (see above) now looks like:

Image

It has these inputs (hopefully, all of them are self-explanatory):

Image

If someone finds an error/bug or has a further suggestion, please let me know. I consider this version a first release, so it's likely not perfect.
Attachments
sessions-ohlc-settings.png
(8.54 KiB) Downloaded 3068 times
sessions-ohlc-1.png
(19.83 KiB) Downloaded 3076 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 25 Aug 2015

Nice!

Many thanks JoshM.

It seems there's a bug there.
Image

Using the 16:15 has the time end the lines start plotting a couple of bars back, from yesterday.

ES pit opens at 8:30CT and closes at 15:15CT. From 15:30 till 16:15 it's ETH session.
Previous close should use the 15:15 bar and not the 16:15 which is the end of the trading day. Well, at least that is the close I'm interested to see. Since this is available to all, maybe other prefer to see the full trading day close and not the RTH. Maybe it's preferable to have both closes available.

If we use the 15:15 time for the end, the close will be plotted correctly but the study will start plotting the next bar has the new trading day, when in fact it only starts 45 minutes later at 17:00.

Image

Maybe it's easier to use 2 set of time inputs, one for RTH ( 830 to 1515) and another for ETH (1700 to 830)? Those last 45 min will be in sort of a limbo but traders can easily see how it was traded looking at the chart and where the RTH stop trading.

Also, I think it's easier to group the highs and lows inputs. Plot Overnight HiLo, Plot Yesterday HiLo and so forth instead of having an input for each high and low.
Attachments
time_issue02.png
(37.63 KiB) Downloaded 3048 times
time_issue.png
(37.33 KiB) Downloaded 3076 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 25 Aug 2015

What resolution are you using with those screenshots? Then I can replicate it here.

By the way, if you have a non-time based resolution it's unfortunately not possible to retrieve the exact closing time of 16:15 since an indicator can only access the bar's closing time (not the ticks inside the bar). If you have a time-based chart, then it can, but just saying for clarification. :]

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 25 Aug 2015

What resolution are you using with those screenshots? Then I can replicate it here.

By the way, if you have a non-time based resolution it's unfortunately not possible to retrieve the exact closing time of 16:15 since an indicator can only access the bar's closing time (not the ticks inside the bar). If you have a time-based chart, then it can, but just saying for clarification. :]
Yes I know, all studies that are time based cannot work properly in non time based charts.
The first chart is a 5min one and the second is a 15min.
The time template I'm using is this

Image
Attachments
template.png
(73.45 KiB) Downloaded 3084 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 26 Aug 2015

The first chart is a 5min one and the second is a 15min.
The time template I'm using is this

Image
With that template, on a 5 minute chart set to exchange time, and the indicator set to 8:30 till 16:15 I don't have that error:

Image

What am I missing/overlooking?

(On a 15minute chart I also cannot replicate it).

(Edit: Didn't find anything in the changelog that can affect this, since I'm still on MultiCharts .NET64 Version 9.0 Release (Build 10362)).
Attachments
scr.26-08-2015 19.09.02.png
(22.78 KiB) Downloaded 3070 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 26 Aug 2015

Here are more charts hoping to help debug this.

Using exchange time, not plotting previous days, you can see that the study starts plotting at 16:00 the prior day.

Image

I then decided to switch to local time.
Again, it starts plotting at 16:00 the prior prior day

Image

Then I tested with plotting all the prior days and this actually looks correct. It starts plotting/the trading day at the correct time, at 17:00.

Image

It seems that when it plots all days the study resets the trading day at the correct time but when it plots only the last day something gets off.

Attached ES data for this month. Test with my data to see what happens.
Attachments
ESU5-Minute-Trade.txt
(784.55 KiB) Downloaded 606 times
us_time01.png
(54.21 KiB) Downloaded 3056 times
pt_time02.png
(53.7 KiB) Downloaded 3018 times
pt_time01.png
(50.88 KiB) Downloaded 3048 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 27 Aug 2015

Thanks for the additional information and ES data; I think I fixed this error now.

It now looks like this:
Image
sessions-ohlc-v2.pln
(4.1 KiB) Downloaded 570 times
I hope it works for you now like you intended. I also added an additional input for specifying the close time other than RTH close.

And my apologies for that it didn't worked earlier, although I'm pretty sure it annoyed me much much more than it annoyed you. :)
Attachments
scr.27-08-2015 09.45.03.png
(64.41 KiB) Downloaded 3018 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 27 Aug 2015

Beautiful work JoshM.

I'm sorry to say this but.... it seems there's a small bug there yet :(
I made a video

http://www.screencast.com/t/ghNlGWvialA

You plot the study and all's fine, you switch it off and when you switch it back on the 24h high and low labels are not there anymore.

And by the way, while reviewing the video I noticed that by that time ZN was making new pit lows but the low label could not be seen. Only when I switched the study off/on the labels became visible again. Maybe the label problem is not only with the 24h high and low...

Sorry for making this way too more complicate than originally sounded :(

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 27 Aug 2015

Sorry for making this way too more complicate than originally sounded :(
That's not a problem, I made the coding error not you. ;)

Anyway, I've fixed/changed:
- Inputs to combine overnight and 24hour data (as mentioned in an earlier post),
- Fixed the label that was missing (thanks for the video, that was a big help),
- Fixed the updating of the text labels (like OnLow, OnHigh when new low/highs are formed).

I'll post the indicator tomorrow or later, primarily because the 'missing label' problem was just an oversight error. I guess I wanted to have the indicator done too quickly for you, which ironically might have costs both of us more time. :)

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 28 Aug 2015

New version:
sessions-ohlc-v2.pln
(4.42 KiB) Downloaded 639 times
I couldn't find an error with it on my side, hopefully it's the same for you.

Have a nice weekend, :)

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 28 Aug 2015

New version:
sessions-ohlc-v2.pln
I couldn't find an error with it on my side, hopefully it's the same for you.

Have a nice weekend, :)
I think you've sent the wrong file.
Shouldn't it be version 3?
I'm saying this because it has the same label bug.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 29 Aug 2015

I think you've sent the wrong file.
Shouldn't it be version 3?
I'm saying this because it has the same label bug.
Yes, it's the correct .pln file.

Sorry, but I'm not seeing the label issue on MultiCharts .NET64 Version 9.0 Release (Build 10362). I did see something else that I couldn't explain with the code (and that seems to be a MultiCharts issue), so I contacted MultiCharts Support on that.

It might take a while before I can continue working on it though, since I also have 2 other open issues with Support from 4 weeks ago that I haven't received an update yet on.

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 29 Aug 2015

Yes, it's the correct .pln file.

Sorry, but I'm not seeing the label issue on MultiCharts .NET64 Version 9.0 Release (Build 10362). I did see something else that I couldn't explain with the code (and that seems to be a MultiCharts issue), so I contacted MultiCharts Support on that.

It might take a while before I can continue working on it though, since I also have 2 other open issues with Support from 4 weeks ago that I haven't received an update yet on.
Oops. Ma bad.
I compiled the wrong file :(

When you get the time and the reply from support, there are a couple of things that should be addressed.
Why not also aggregate yesterdays high and low and todays high and low into single inputs like you did with overnight and 24h?

Image

Now regarding the RTH high and low, there's a problem with the reading and plotting.
The chart is the 10 year note.
Overnight (ETH - electronic trading hours) starts at 17:00 and ends at 7:20. Pit session (RTH - regular trading hours) starts at 7:20 and ends at 14:00. Between 14:00 and 16:00 it's another ETH session.

The RTH high and low at the moment is plotting between 7:20 and 16:00. The 7:20 marks the start of the pit session which is correct but the 16:00 is marking the end of the trading day and not the end of the pit session which is given by the third time input you added to mark the RTH (pit) close.

So you can see in the chart that after the pit close at 14:00, the 10 year made new high for the day, above the pit high. The pit high line after 14:00 should not continue to update, it should extend that last high till the end of the day at 16:00. You can also see that at the next day what was extended was the 24h high which was also the pit high according to the study but in fact, although the 24h high is OK at 15.5, the pit high was at 14, not 15.5.

Image

I hope I'm making myself understood. When we get too technical things can become quite confuse.
It's just a problem of time reading.

Here's another thing I've just noticed, it seems the study starts the reading 1 bar before the pit open.
Using the 10 year as example, if the pit opens at 7:20, the time stamp of the first bar on a 5 minute chart is 7:25 but the study is starting the reading at 7:20 bar which can give a wrong open price and also a wrong high and low.
Since the bar time stamp in MC is the bar close the study needs to use the first bar after the RTH_Begin time to start the RTH(pit) high, low and open calculations.
Attachments
rth.png
(35.69 KiB) Downloaded 3014 times
inputs.png
(32.5 KiB) Downloaded 2984 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?

Postby JoshM » 30 Aug 2015

Now regarding the RTH high and low, there's a problem with the reading and plotting.
The chart is the 10 year note.
Overnight (ETH - electronic trading hours) starts at 17:00 and ends at 7:20. Pit session (RTH - regular trading hours) starts at 7:20 and ends at 14:00. Between 14:00 and 16:00 it's another ETH session.

The RTH high and low at the moment is plotting between 7:20 and 16:00. The 7:20 marks the start of the pit session which is correct but the 16:00 is marking the end of the trading day and not the end of the pit session which is given by the third time input you added to mark the RTH (pit) close.
Okay, I'll see if I can recode the indicator to work with multiple trading sessions. I'll probably add an input for the ETH session, or do you also want to plot the 'non regular RTH' hours on the chart (so plotting the OHLC of 7:20-14:00 and plotting the OHLC values from 14:00-16:00)?

*removed rant*
Last edited by JoshM on 02 Sep 2015, edited 1 time in total.

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: any chance of having this coded for .NET?

Postby MidKnight » 01 Sep 2015

This should be start of the standard indicator suite instead of the huge majority of other junk indicators packaged.

With kind regards,
MK

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: any chance of having this coded for .NET?

Postby MidKnight » 01 Sep 2015

I have a version of this, but it may not work if your after hours session spans past midnight - is that of any use to you?
Attachments
MK-2015-09-01_205348.png
(41.89 KiB) Downloaded 2676 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: any chance of having this coded for .NET?

Postby arnie » 01 Sep 2015

I have a version of this, but it may not work if your after hours session spans past midnight - is that of any use to you?
I really need/want to see the entire day so the reset at midnight does not suits my needs.
Thanks for your help though.

And you're right, basic studies such as this one should be part of the default package on MC. I'd love to know the number of times a MC user actually use most of the studies that MC has by default.

SC for example accept studies coded by their users and after they test it the study becomes part of the default package. This is a great feature for users to have and of course a great way for them to maintain the platform always updated with the most "trendy" studies at the moment, attracting this way new users.
See also IRT. They invest a lot in study development.

A platform not only needs to have great built in tools but also great built in studies.
And while MC in the built in tools department is spotless, in the studies department things can become really poor. For those with programming knowledge there's no problems, business as usual, but for those without programming knowledge and rely on the available studies, I'm sure MC is not on the top of their wishing list.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: any chance of having this coded for .NET?  [SOLVED]

Postby JoshM » 12 Sep 2015

By the way, the indicator is done and seems to be working correctly as far as we can tell. I've placed it here: Sessions OHLC.

If you find an error or if there's anything else, let me know. :]

MidKnight
Posts: 343
Joined: 12 Aug 2012
Has thanked: 123 times
Been thanked: 56 times

Re: any chance of having this coded for .NET?

Postby MidKnight » 13 Sep 2015

This looks far superior to what I coded and use. Thanks so much for the effort JoshM. A tool like this should have been included in the default indicator suite for MC.net.

With kind regards,
MK

samuelhogg
Posts: 3
Joined: 07 Apr 2013
Has thanked: 1 time

Re: any chance of having this coded for .NET?

Postby samuelhogg » 02 Nov 2020

Hi,

Does anyone have the final version of this as the tradingscripts.net website doesn't appear to be up anymore?

Kind regards
By the way, the indicator is done and seems to be working correctly as far as we can tell. I've placed it here: Sessions OHLC.

If you find an error or if there's anything else, let me know. :]


Return to “MultiCharts .NET”