Data1 and Data2(hidden) - Indicator based on Data2

Questions about MultiCharts and user contributed studies.
javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 17 Jul 2014

Hello and thank you for any assistance ...

I have the following condition I'm hopeful to resolve. I have a chart with two time frames for indicator calculations of the same instrument. One is 60min one is 5min. The 60min is hidden on subgraph1 so that indicator calculations with align with the shown 5min bars.

When using TS and selecting 'update every tick' for the indicator based on the 60min data it will paint every 5min bar and update the paint plot in real time.

When using MC and selecting 'update ever tick' it only seems to paint a single plot at every 60min interval.

Is there any way to have it replicate the TS approach?

http://picpaste.com/pics/TSvsMC-60min5m ... 632279.jpg

User avatar
TJ
Posts: 7237
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby TJ » 17 Jul 2014

Hello and thank you for any assistance ...
I have the following condition I'm hopeful to resolve. I have a chart with two time frames for indicator calculations of the same instrument. One is 60min one is 5min. The 60min is hidden on subgraph1 so that indicator calculations with align with the shown 5min bars.
When using TS and selecting 'update every tick' for the indicator based on the 60min data it will paint every 5min bar and update the paint plot in real time.
When using MC and selecting 'update ever tick' it only seems to paint a single plot at every 60min interval.
Is there any way to have it replicate the TS approach?
http://picpaste.com/pics/TSvsMC-60min5m ... 632279.jpg
Please post your code for analysis.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 17 Jul 2014

Use any indicator at all with two data streams of different time periods and plot a point or cross.
It is not code specific.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 18 Jul 2014

Hello javamarket,

If you want to have plots on each 5 min bar - you need to base the study on 5 min data series.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 18 Jul 2014

Thank you folks for taking the time to reply. I should clarify it seems.

When TS paints an indicator based on (for example) a 30min bar ON a 5min bar, it leaves the painted indicator like a trail after a new bar is created.

When MC paints an indicator based on a 30min bar ON a 5min bar, each new 5 min bar MC removes that indicator and moves it forward until the next 30min period at which point it 'leaves' the indicator.

I was hoping to replicate the trail as can be seen in the referenced photo. This trail only happens with live data by the way. Historical on both systems only paint the indicator at the 30min period.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 21 Jul 2014

Hello javamarket,

We find MultiCharts behavior to be the proper one, reflecting the actual indicator calculation based on the selected data series. If you want to have "historical plots" - the study can place drawings where it is required.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 21 Jul 2014

Hi Henry and thank you for your reply. I don't dispute your approach in this respect.

You state:
If you want to have "historical plots" - the study can place drawings where it is required.
... can you clarify this a bit please? I take it to mean that the indicator would need to be recoded such that it becomes based on "data1" (to create the smaller interval plots) however uses "data2" for calculations. Is that what you suggest or is there another method?

The only loss here is no obvious transition from historical data to "new" live data.

Many thanks.
Mark

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 22 Jul 2014

I recoded the indicator to process calculations with Data2 yet be 'based on Data1. As expected the indicator now paints every 'data1 bar' period, however Data2 does not appear to update each tick. This option is selected on the properties tab of the applied indicator.

Could this be because it does not also force 'data2' to update each tick?
.. and if so is there a workaround other than having two versions of the same indicator?

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 22 Jul 2014

Thank you for your response, however the post you reference is not helpful in this case.

In addition,
Data1 time frame is the basis of your plots
is ambiguous. If you mean periodicity of the plots then I agree, but the basis of the plots is hard coded to Data2 as input.

My goal as previously stated to to be able to capture the history of a larger period calculation on smaller timeframes which TS gives by default of live data until closing the application, or can be done with ADE. As MC hasn't implemented int64 that isn't an option.

I was hoping Henry would reply with something more specific.

It would seem the only solution is to have 2 indicators to do the job in a truly bastardized fashion.

In any event, again thank you for your comments.

hughesfleming
Posts: 238
Joined: 22 Apr 2014
Has thanked: 58 times
Been thanked: 61 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby hughesfleming » 22 Jul 2014

Hi Javamarket,

I have had similar frustrations with how multi timeframe is handled. On the other hand, I have managed to solve most of my problems with ADE and Global variables. It works but I would not call it elegant. I have not been able to move all my old code from MT to Multicharts for various reasons which is disappointing. Of course Multicharts has many other advantages but I have run into a few limitations that I did not expect.

Why can't you substitute "double" for int64 with regards to ADE?

regards

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 23 Jul 2014

I recoded the indicator to process calculations with Data2 yet be 'based on Data1. As expected the indicator now paints every 'data1 bar' period, however Data2 does not appear to update each tick. This option is selected on the properties tab of the applied indicator.

Could this be because it does not also force 'data2' to update each tick?
.. and if so is there a workaround other than having two versions of the same indicator?
javamarket, sorry for misinformation. My solution will work only if the study is based on data1.

What exactly does not work with your re-coded study? Have you disabled the "Real-time history matching" and "Skip identical ticks" for it?

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 23 Jul 2014

Hi Henry,

Thank you for the additional information / correction. Yes I have disabled those settings. The difference is visually easy to recognize between MC & TS, however as the indicator is complex I am trying to parse out a simplified version that can be shared and looked at as time allows.

This is purely speculation on my part, but I'm of the mind that there is a fundamental difference in the way MC handles data2 versus TS (not making any characterization as to which is better, worse or proper). Irrespective of the cause I find I now miss painting of informational indicators.

I guess I will have to revert with a simplified example to make it something that can be examined. That said, if there is any known difference on how non-data1 updates are handled I'd love to know.

Many thanks,
Mark

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 23 Jul 2014

As a quick informational, here is the visual:

http://picpaste.com/pics/Pic_example-qv ... 129090.jpg

Left side is MC, right is TS on live ES data.
You can see the 3 Red plotted points on the TS chart. MC does not paint them.
In short, indicator is based on 30min data on 5min chart.

If I close and reopen TS, these points will not be repainted ... it is almost a ghosting from live data. That said, however, they are extremely valuable. There are multiple examples of this, all when data2 is the calculation base. These just happened to pop up in the last 15 minutes as of this writing.

I've tried both approaches with MC (standard based on and hard coding the calculation input) yet neither capture this. I will revert with an example as I am able.

Thanks,
Mark

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 23 Jul 2014

@Henry A quick update. After a reboot I reviewed all settings once again and in the workspace the settings you referenced were not set as you propose. They have been changed. I believe (again being difficult to confirm because it isn't testable in the standard sense) it may now be capturing the data as desired. I will confirm shortly. Unfortunately I have to wait for these indicators to be produced with live data and as previously mentioned they do not survive a close and open of the application

@hughesfleming Thanks for your post as well. The latest version of ADE released requires the variable type. My end goal is backtesting to confirm MatLab results and it would require all processors. A bit of a short unclear answer but it is because of the ADE dll not my source. At the end of the day the .NET version of MC might overcome all of this but the initial code base (it actually started in the Supercharts days) has survived in all iterations of SuperCharts and TS. I'm hoping it can survive a port to MC as well.

Last - thanks again to all for thoughts and effort in trying to help.

janus
Posts: 765
Joined: 25 May 2009
Has thanked: 43 times
Been thanked: 88 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby janus » 24 Jul 2014

Hi Javamarket,

I have had similar frustrations with how multi timeframe is handled. On the other hand, I have managed to solve most of my problems with ADE and Global variables. It works but I would not call it elegant.
regards
Same here but I would call it elegant as it has its own advantages. Besides, doing everything in one study causing it to be huge is not what I call elegant. I'm assuming you are doing what I'm doing and that is have a separate window for each time-frame running their own indicator(s) each sending back information (via global variables) to a "master" study that manages the orders. That way it's all modular (hence elegant). It works very well. Note that I would not be able to do this if we didn't have the RecalcLastBarAfter keyword.

As for the original issue, perhaps a workaround is to draw dots or circles using text_new_s with an appropriate font and size. That way you have complete control over where you want the dots to be "plotted". More coding I know. Not sure if it helps though.

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby evdl » 01 Aug 2014

I have the same issue. With ADE or with the use of data1 and data2.

Use 2 data streams. Let say data1 = 1min and data2 = 30 min (this one is hided).

Calculate an indicator based on data2 and try to plot this on the chart of data1.

Then the value is plotted once in the 30 minutes. What I would like is to plot this value every bar of the chart of data1. This means for 30 minutes an unchanged value will be plotted on data1. And not once in the 30 minutes.

This is not possible at the moment. Because it will only plot the value once in the 30 min on the chart of data1 because the calculating of the plot is based on data2. I tried to plot with text_new, but it will behave the same, because the data is calculated on data2.

This behaviour also results in all sorts of timing issues when working with multiple timeframes. Best solution in my opinion would be that data1 is always leading with using values calculated on other timeframes and in the case someone would like to not use data1 as leading, you can use the "if barstatus(2)=2" statement for example if you want to use data2 to be leading.

Another question related to using multiple timeframes on a chart. Many times values calculated on higher timeframes will mess up the chart of data1. For example, if you have a trendline of data2 plotted on data1, 100 points above the current price, then the bars of data1 gets compressed to show all the trendlines that are out there on the chart. I know you can manually rescale the chart, but when you scroll the chart or the price runs out of the chart, you will have to keep changing it manually. And it is difficult to compare the different timeframes, when the scale of the charts are not the same.

Is there a way to keep the rescale of the charts on one setting when plotting information on the chart that is outside the current view of the chart as leading setting. And keep the automatic compressing of the charts as a manual handling.

janus
Posts: 765
Joined: 25 May 2009
Has thanked: 43 times
Been thanked: 88 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby janus » 01 Aug 2014

This behaviour also results in all sorts of timing issues when working with multiple timeframes. Best solution in my opinion would be that data1 is always leading with using values calculated on other timeframes and in the case someone would like to not use data1 as leading, you can use the "if barstatus(2)=2" statement for example if you want to use data2 to be leading.
That would be very nice feature as I would use it that way myself to consolidate some of my studies, which are currently spread across different timeframes in different windows and using global variables for sharing information. In addition to your suggestion it would be even better to allow the hidden chart to be moved and made visible in another window in the same workspace to make the spacing of the bars the same as though the chart was plotted on its own. IMHO that would be a huge and beneficial improvement to the way MC can be used. The SubChart feature under Properties for an indicator could include an extra selection category to specify which window within the current workspace to use. How to reference the windows is questionable since one could have two or windows with the same title/description. There are ways to get around that small issue though.

User avatar
swisstrader
Posts: 110
Joined: 16 Nov 2005
Location: Earth
Has thanked: 13 times
Been thanked: 19 times
Contact:

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby swisstrader » 04 Aug 2014

Hello and thank you for any assistance ...

I have the following condition I'm hopeful to resolve. I have a chart with two time frames for indicator calculations of the same instrument. One is 60min one is 5min. The 60min is hidden on subgraph1 so that indicator calculations with align with the shown 5min bars.

When using TS and selecting 'update every tick' for the indicator based on the 60min data it will paint every 5min bar and update the paint plot in real time.

When using MC and selecting 'update ever tick' it only seems to paint a single plot at every 60min interval.

Is there any way to have it replicate the TS approach?

http://picpaste.com/pics/TSvsMC-60min5m ... 632279.jpg

Do you use MC64 beta2?

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 08 Aug 2014

@swiss I'm currently using 8.8 Release (Build 9589) but am unaware of any expected change to the current behavior.

User avatar
swisstrader
Posts: 110
Joined: 16 Nov 2005
Location: Earth
Has thanked: 13 times
Been thanked: 19 times
Contact:

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby swisstrader » 09 Aug 2014

javamarket,
I had this issue in v9 beta 2 after copy of a chart window and paste it in a different workspace.
Some days later I deleted the chart window and rebuild it with same data streams and indicators,
the issue was solved.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 12 Aug 2014

I have the same issue. With ADE or with the use of data1 and data2.

Use 2 data streams. Let say data1 = 1min and data2 = 30 min (this one is hided).

Calculate an indicator based on data2 and try to plot this on the chart of data1.

Then the value is plotted once in the 30 minutes. What I would like is to plot this value every bar of the chart of data1. This means for 30 minutes an unchanged value will be plotted on data1. And not once in the 30 minutes.

This is not possible at the moment. Because it will only plot the value once in the 30 min on the chart of data1 because the calculating of the plot is based on data2. I tried to plot with text_new, but it will behave the same, because the data is calculated on data2.

This behaviour also results in all sorts of timing issues when working with multiple timeframes. Best solution in my opinion would be that data1 is always leading with using values calculated on other timeframes and in the case someone would like to not use data1 as leading, you can use the "if barstatus(2)=2" statement for example if you want to use data2 to be leading.
Unfortunately there is no such functionality at the moment.
You may want to submit a feature request to the Project Management of our web site so other users can vote for it: https://www.multicharts.com/pm/

Another question related to using multiple timeframes on a chart. Many times values calculated on higher timeframes will mess up the chart of data1. For example, if you have a trendline of data2 plotted on data1, 100 points above the current price, then the bars of data1 gets compressed to show all the trendlines that are out there on the chart. I know you can manually rescale the chart, but when you scroll the chart or the price runs out of the chart, you will have to keep changing it manually. And it is difficult to compare the different timeframes, when the scale of the charts are not the same.

Is there a way to keep the rescale of the charts on one setting when plotting information on the chart that is outside the current view of the chart as leading setting. And keep the automatic compressing of the charts as a manual handling.
It is already implemented in MultiCharts 9.0 beta 2.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 25 Aug 2014

I'm putting one last comment here (although it could if not should have a thread all of its own) as it is germane to these problems between data streams. The problems that exist between the usage of Data1 and DataN are (in my opinion) unreasonable, most especially because they are widely known by the developers and customers alike and has existed perhaps since inception of the codebase (including TS).

Specifically, it is not only intuitive but reasonable to expect that what you can paint as an indicator on a chart referencing a data stream should be accessible as data in a signal generation. Time and time again I find myself spending hours trying to overcome this fundamental flaw. Have there been 'workarounds'? Certainly. They are, at best, hacks that aren't fixes. ADE, Global Variables, DLLs to create virtual bars ... it is frankly unacceptable. This isn't a consideration for some extra feature where chart#1 interacts with chart#2, or between workspaces. This is the domain of a single chart with a single symbol with bar periods. Nothing more.

While it is likely I will be offered the opportunity to create a enhancement for MC to post to the schedule, this too is unreasonable.

This condition exists, everyone knows about it, and little if any resource is being allocated to make it go away.

If you think this is a rant, that it not its intent. I like MC - in fact I'm a recent convert from TS and to date happy with the cost associated with the purchase. What I've referenced here remains a real issue. All one must do is examine the forums (here or elsewhere) to see the volume of posts and approaches trying to overcome this most fundamental need.

It is no more complicated than

Code: Select all

variable = someFunction(dataSet);
where the dataSet can be explicitly set and we can't pull it off.

Disappointing.

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby evdl » 25 Aug 2014

First of all, I also like MC. As all software it has it's issues and also some behaviour that is not always logical. But maybe this is the limitation of easylanguage compared to a "real" programming language like C#.

That said, I have spend many hours to synchronise multiple datastreams in a signal. But for some reason, there was always a difference in the data compared to the indicator that was used to send the data from. Probably this has to do with some functions that are calculated different when using it with a signal instead of an indicator. It can also be me ofcourse, but I don't use multiple datastreams anymore for strategies as I found it to hard to handle.

I now only use ADE and GV to get data from another chart. Ofcourse there are limitations too, like the timeframe of the sender charts can not be smaller then the receiving charts. And also the timing issues still exist, but better manageable. For example, try to mix a tick chart with a time chart and do some calculatings where you want to get a certain value at a certain time.

To get data from other charts or workspaces should be easier and something that is incorporated in the software and available with a mouseclick. At the moment it will take someone a great amount of time to accomplish simple ideas. It is called easylanguage, but I am not sure about the easy part. The jury is out on that one. But then again, I am not the best programmer as my goal is to trade and not to program.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 25 Aug 2014

Hi @evdl, thank you for your viewpoint.
my goal is to trade and not to program.
This is exactly my point and thank you for expressing it. Some limitation can be expected in any software. This specific limitation, however, to me rings inappropriate.

Perhaps to sum my view up as you have:

You shouldn't have to work hard to arrive at the same calculations with the same data on the same chart on the same time periods across indicators and signals.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 09 Sep 2014

javamarket, evdl, there are two helpful features that should be useful for you:
1. Study on study. You can base your signal calculations on a certain indicator plot.
2. i_setplotvalue and i_getplotvalue (introduced in MultiCharts 9.0 Beta 1). Allow sending info from signal to indicator in order to see which values it actually uses, help to avoid excessive programming and eliminate discrepancies between indicator and signal.

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 09 Sep 2014

Hi Henry,

Thank you for the references however they do not accomplish what is needed (at least in my requirement). I need a signal to exactly replicate what is derived / calculated from a study, not paint on a chart what a study does.

Unfortunately this remains a difficulty when using more than a single data stream.

That said "study on a study" is a great feature of which I am familiar.
I find the "plotvalue" approach to be a poor hack frankly, albeit at times useful.

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby evdl » 09 Sep 2014

javamarket, evdl, there are two helpful features that should be useful for you:
1. Study on study. You can base your signal calculations on a certain indicator plot.
2. i_setplotvalue and i_getplotvalue (introduced in MultiCharts 9.0 Beta 1). Allow sending info from signal to indicator in order to see which values it actually uses, help to avoid excessive programming and eliminate discrepancies between indicator and signal.
Thank you for the suggestions. Just like Javamarket, I need to have the data of other datastreams in a signal. For example, the result of the calculation of an indicator on a 500 tick chart, to use in a signal on the tradingchart that has a 50 tick timeframe. As it is now, I must use the 500 tick as data 2 and plot the values on the chart for strategy development only. To have the same calculation (of the 500tick indicator) in a signal, I have to use the same code and reference in the signal to data2. And what happens is that the calculation of code in the signal is sometimes differently calculated as the same code in the indicator. Especially when using functions. And getting the same data at the same time as it is plotted by the indicator on the chart, in the signal, is hard work.

The plotting workaround, would also be better if it can function both ways. From signal to indicator, but more importantly from indicator to signal. As it is know, you can only see the plotting on the chart after the signal is calculated. But every change to the signal (when you are developing a strategy) will cause the recalculating of the signal and therefor the loss of the plotting on the chart. I use tick by tick barmagnifier, and every recalculating of a signal will take several minutes to 15 minutes. As long as the signal is calculating, I have no plotting on the chart and can not look to see what I can improve to the strategy untill the recalculating is done. That is very timeconsuming and as a result, I use several double indicators, one to plot and one to send data via ADE to the signal. All these indicators have to match the calculation of the signal or vice versa and that is a lot of work.

Secondly, the ability to send the plot results from indicator to signal would solve many work with multiple datastream issues and would make the use of ADE and GV obsolete.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 10 Sep 2014

Thank you for the references however they do not accomplish what is needed (at least in my requirement). I need a signal to exactly replicate what is derived / calculated from a study, not paint on a chart what a study does.
javamarket, what exactly your signal is unable to replicate? There is nothing that indicator does, but signal cannot do.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 10 Sep 2014

And what happens is that the calculation of code in the signal is sometimes differently calculated as the same code in the indicator. Especially when using functions. And getting the same data at the same time as it is plotted by the indicator on the chart, in the signal, is hard work.
evdl, have you studied the information in this article? Can you provide an example of such discrepancy? If you have an example - please provide the workspace, study, screenshots with description and output of the issue you have.
Secondly, the ability to send the plot results from indicator to signal would solve many work with multiple datastream issues and would make the use of ADE and GV obsolete.
This is what Study on Study feature does.

User avatar
Smoky
Posts: 415
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 67 times
Been thanked: 105 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Smoky » 10 Sep 2014

I have the same issue. With ADE or with the use of data1 and data2.

Then the value is plotted once in the 30 minutes. What I would like is to plot this value every bar of the chart of data1. This means for 30 minutes an unchanged value will be plotted on data1. And not once in the 30 minutes.
TRUE !

a good warkaround is to use GV with tick/tick indicators on data1 AND data2.
(every tick on data1 receive data2 in real time ;) ) Works fine with many charts better than standard MC display data2 on data1 ....

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby evdl » 10 Sep 2014

Hi Henry,

I did read the article you mentioned, a long time ago. I think the problem lies in the way a signal/strategy calculates the same code that is used for indicators. What I understand is that indicators are always calculated on barclose when using historical data (and that is the case with backtesting).

From the article.
On the historical data indicator, only values on bar close are calculated. There are multiple historical data calculation modes for the signal. In order for the indicator and signal historical calculations to match, IOG and Bar Magnifier should be disabled for the signal.
In order to get the same values for HISTORICAL data, the barmagnifier and IOG should be put to off. Is my conclusion right that it is not possible to backtest with IOG and barmagnifier and get the same values in my strategy as calculated in the indicator? And you will only get the the same results realtime if you use IOG and barmagnifier? I thought it had something to do with multidata streams but is it just not possible?

When you use the same code in a signal and use IOG and barmagnifier, the calculating will be at tick base and not at barclose. I suspect even if you use barstatus(2)=2 the calculation gets mixed up at some points. It is not always. 99% of the values are the same, but those sometimes mess up the strategy. With an moving average function I use, I could not get it to line up. After days of trying I gave up and started using ADE instead, which has some delay (some seconds). But I am not HFT so that is ok. Complete different values at some time, is not managable. I can supply workspaces etc. But that is a lot of work to set it up again. Maybe if I have some more time.

I am not sure how I can use the study on study feature to send data from a 500 tick chart to a strategy applied on a 50 tick chart. As I understand it can be used for indicator on indicator and use the outcome of one indicator as input for another indicator. But I could be wrong.

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby evdl » 05 Oct 2014

Reading back on my previous post, is my assumption right concerning this:
In order to get the same values for HISTORICAL data, the barmagnifier and IOG should be put to off. Is my conclusion right that it is not possible to backtest with IOG and barmagnifier and get the same values in my strategy as calculated in the indicator? And you will only get the the same results realtime if you use IOG and barmagnifier?
and this:
I am not sure how I can use the study on study feature to send data from a 500 tick chart to a strategy applied on a 50 tick chart. As I understand it can be used for indicator on indicator and use the outcome of one indicator as input for another indicator. But I could be wrong.
Thanks in advance for replying to my assumptions being right or not.

User avatar
Henry MultiСharts
Posts: 9149
Joined: 25 Aug 2011
Has thanked: 1260 times
Been thanked: 2932 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby Henry MultiСharts » 10 Oct 2014

Reading back on my previous post, is my assumption right concerning this:
In order to get the same values for HISTORICAL data, the barmagnifier and IOG should be put to off. Is my conclusion right that it is not possible to backtest with IOG and barmagnifier and get the same values in my strategy as calculated in the indicator? And you will only get the the same results realtime if you use IOG and barmagnifier?
As our analysis has shown - when two data series are used, one can get the same results on historical data, but not on realtime data. If you reference data2 in your code then there can be some lag between the signal and indicator calculation results due to the data series receiving the realtime data asynchronously.
  • BarMagnifier does not affect realtime calculations. If you do not use IntraBarPersist variables then BarMagnifier will not affect historical calculation results as well. If you use IntraBarPersist - it depends on the particular code/use case.
  • MaxBarsBack should be the same for both signal and indicator.
  • If you want to have tick by tick calculations in realtime then signal should have IOG = On, indicator should have Update on very tick = On. Whether IOG is On or Off does not affect the calculation results on historical data.
  • Skip identical ticks should be disabled for the indicator, because signals internally have it disabled.
To sum up - you can use ADE to get the required values if that works for you. We have not found a better solution so far.
and this:
I am not sure how I can use the study on study feature to send data from a 500 tick chart to a strategy applied on a 50 tick chart. As I understand it can be used for indicator on indicator and use the outcome of one indicator as input for another indicator. But I could be wrong.
That is correct. Study on study feature works in terms of a single chart. There is no way to make the charts talk to each other using this feature. This feature can replace creating functions or copy/pasting the code of a function into a signal for those that are not familiar with PL programming.

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby bensat » 10 Oct 2014

Hello and thank you for any assistance ...

I have the following condition I'm hopeful to resolve. I have a chart with two time frames for indicator calculations of the same instrument. One is 60min one is 5min. The 60min is hidden on subgraph1 so that indicator calculations with align with the shown 5min bars.

When using TS and selecting 'update every tick' for the indicator based on the 60min data it will paint every 5min bar and update the paint plot in real time.

When using MC and selecting 'update ever tick' it only seems to paint a single plot at every 60min interval.

Is there any way to have it replicate the TS approach?

http://picpaste.com/pics/TSvsMC-60min5m ... 632279.jpg
I know this thread is way "old" but it got to my attention. Reading the thread remembers me on the dark side of TS working with data1 and data2. Of course you have always a constant plot in data1 referred to data2 in the the "Format Study" window and "Base Study ON" on data2 with "Update every tick". But we both know, that the indicator is calculated and shown by every new bar in data one as well, witch leads to false plotted values, as we can see in your provided link and TS chart. The close of bar in data2 is not "ready and made".

If you want to plot the current value of an indicator based on data2 in data1 and updated by any new bar, you have to re-write to hole code and to talk to the data in case of data2. But, if functions are included, you have to re-write these functions as well. Every function has to be based on data2 ... in the code. Just to adjust the indicator by himself doesn't work.

If the functions you use are not open, just bad it is. With the right adjustments in the code, the indicator will plot the value just perfect. With and without "Update every tick" and in realtime and/or historically.

Chart ( Data1 = 5min / Data2 = 45min )

Image

If you found no solution so far and want me to re-write your code, just write me a PN.

Regards.

Ben

javamarket
Posts: 55
Joined: 10 Jul 2014
Has thanked: 10 times
Been thanked: 18 times

Re: Data1 and Data2(hidden) - Indicator based on Data2

Postby javamarket » 10 Oct 2014

Hi @Ben,

First and foremost thank you for your offer to help. Indeed I recoded all indicators, functions and associated libraries to perform exactly as you described. It is indeed all able to be managed from code, albeit I found for my specific needs I was much better suited in C++.

The only thing I'll say in regards to a remaining headwind with MTF is that because a signal is aggregated in order to apply the all signal logic properly, although it has been asserted that any strategy can be made to replicate an indicator and vice versa, this is not necessarily true when it involved multiple data streams, at least solely within PowerLanguage.

With all that, this limitation is worth the penalty in my view for the overall product offering of MC. To their credit, the MC staff have offered to look at my specific issues but because of some restriction the code in question cannot be shared.

In any event thank you for taking the time to provide an offer of assistance and some additional viewpoints.

Mark


Return to “MultiCharts”