To many Text fields causes MC to die.

Questions about MultiCharts and user contributed studies.
NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

To many Text fields causes MC to die.

Postby NW27 » 02 Jun 2012

First, I'm using MC Ver8 RC, although it also does this on any version of Ver8. I have not tried Ver7.

If I have to many text fields on a chart, Multicharts starts to die, ie parts of the screen start to disappear, artifacts, slow responsiveness or none at all.

It would appear that to many text_new(...) are killing the system.

I thought there were comments about this, >12 months ago and if I recall, something was done so that the new text fields were only used/displayed on the visible part of the chart.
As an example, 1 years worth of 5min data loaded and the chart is only displaying 1 days worth, so what isn't visible didn't have the Text loaded and thus consuming resources.

Does anybody recall anything like this or have ideas on how to fix the issue?
The example above is typical of a backtest, where you need to look back over the trades for this period, so saying to reduce the number of days the data is loaded for doesn't work.

Neil.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: To many Text fields causes MC to die.

Postby TJ » 02 Jun 2012

First, I'm using MC Ver8 RC, although it also does this on any version of Ver8. I have not tried Ver7.

If I have to many text fields on a chart, Multicharts starts to die, ie parts of the screen start to disappear, artifacts, slow responsiveness or none at all.

It would appear that to many text_new(...) are killing the system.

I thought there were comments about this, >12 months ago and if I recall, something was done so that the new text fields were only used/displayed on the visible part of the chart.
As an example, 1 years worth of 5min data loaded and the chart is only displaying 1 days worth, so what isn't visible didn't have the Text loaded and thus consuming resources.

Does anybody recall anything like this or have ideas on how to fix the issue?
The example above is typical of a backtest, where you need to look back over the trades for this period, so saying to reduce the number of days the data is loaded for doesn't work.

Neil.
Right click on your chart, select "Format Drawing". You can see how many drawing objects you have on the chart.

One of the often seen coding error with drawing objects (ie TEXT, ARW, TL) is repeated drawings.
A repeated drawing is the unintended re-drawing of the same object at the same position multiple times.

A repeated drawing of text (or any objects) can quickly overload your computer's resources, and render your MultiCharts unresponsive.

Usually this problem only appears in real time, because the code is drawing ONE new text every tick. Therefore the problem is not apparent when debugging off-line.

To check if you are suffering from this particular coding error, click on the text and drag it to another location. If the coding is incorrect, you will see the text moved to a new location, but there is another text sitting in the same location as if you have never moved it. If you move that text away, you will see yet another text in the same place.

If you see multiple text in the same location, you are suffering from this coding error. A review of the coding logic is advised.

NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

Re: To many Text fields causes MC to die.

Postby NW27 » 02 Jun 2012

One of the often seen coding error with drawing objects (ie TEXT, ARW, TL) is repeated drawings.
A repeated drawing is the unintended re-drawing of the same object at the same position multiple times.
Hi TJ,

Unfortunatley, this is not the case here. There is only ONE copy of the text.

Neil.

User avatar
piranhaxp
Posts: 241
Joined: 18 Oct 2005
Has thanked: 4 times
Been thanked: 30 times

Re: To many Text fields causes MC to die.

Postby piranhaxp » 03 Jun 2012

@NW27

Tried to replicate your issue and yes, same issue here ;(

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: To many Text fields causes MC to die.

Postby bowlesj3 » 03 Jun 2012

Just curious. How many text are going out? Maybe there is a limit we need to know about!

I don't know how new you are to MC so I will mention that you may be able to count the number of text out there with MC code if you put the count in a statement that only occurs with BarStatus=2. If you are not sure why BarStatus=2 then study this thread (post #3).
viewtopic.php?f=5&t=6871

This thread may be of interest. I do not remember what I put in it however.
viewtopic.php?f=1&t=6785


Return to “MultiCharts”