iCustom - prevent indicator from init()'ing at every call

 

I am using iCustom along with 'indicator input parameters' to call a indicator. When the indicator input has variables (containing constants), the indicator is init()'ing at every call to iCustom. Any workaround / suggestions to prevent indicator from init()ing, each time iCustom is called with variable input parameters?

 
AnkaSoftware:
prevent indicator from init()ing, each time iCustom is called with variable input parameters?

Not true. Nothing to prevent needed.

Each unique combination of input parameters (including pair and timeframe, but not buffer and shift) loads a completely SEPARATE indicator on to the chart. Init is called for each one - once only.

Repeated iCustom calls with a previously used combination will only be reading the indicator's buffer.

If repeated iCustom calls ARE reloading the indicator - that's because the indicator crashed, look in the log for divide by zero and fix the indicator.

 
WHRoeder:

Not true. Nothing to prevent needed.

Each unique combination of input parameters (including pair and timeframe, but not buffer and shift) loads a completely SEPARATE indicator on to the chart. Init is called for each one - once only.

Repeated iCustom calls with a previously used combination will only be reading the indicator's buffer.

If repeated iCustom calls ARE reloading the indicator - that's because the indicator crashed, look in the log for divide by zero and fix the indicator.


iCustom returns a valid 'indicator' value and no crash - zero divide / deinitialized messages in the logs.
 
AnkaSoftware:

I am using iCustom along with 'indicator input parameters' to call a indicator. When the indicator input has variables (containing constants), the indicator is init()'ing at every call to iCustom. Any workaround / suggestions to prevent indicator from init()ing, each time iCustom is called with variable input parameters?

on the expert tab, you might see it reporting and happening every instance, but that is fine. That does not refer to init()ing, (as I used to think initially), but just the next instance of start() due to a new tick.

In fact, I have come to conclude that iCustom() works almost, if not EXACTLY = EA. (you can test this hypothesis easily, minus the trade commands/operations, etc)

Also deductively reasoning, since there are NO de-initialized messages in your logs, only goes to show that: there has NOT been any re-init() whatsoever, hence what else? has to be because of start() -- just like EA.

hope this helps...

 
diostar:

on the expert tab, you might see it reporting and happening every instance, but that is fine. That does not refer to init()ing, (as I used to think initially), but just the next instance of start() due to a new tick.

In fact, I have come to conclude that iCustom() works almost, if not EXACTLY = EA. (you can test this hypothesis easily, minus the trade commands/operations, etc)

Also deductively reasoning, since there are NO de-initialized messages in your logs, only goes to show that: there has NOT been any re-init() whatsoever, hence what else? has to be because of start() -- just like EA.

hope this helps...



Will if I hardcode ie replace variables by constants, the multiple init() messages in the expert window disappear.
 
AnkaSoftware:

Will if I hardcode ie replace variables by constants, the multiple init() messages in the expert window disappear.

Like I mention, those are NOT init(). Those refers to a re-calculation of iCustom(). It is NOT in any case whatsoever, re-initializing as you had it load once before and as you yourself have said,

"iCustom returns .... and no .../ deinitialized messages in the logs."

If it is init()...deinit()...init()....deinit()....and so on, so forth, as you imagined, then did you, or did you not see deinitialized messages in the logs." ?

 
diostar:

Like I mention, those are NOT init(). Those refers to a re-calculation of iCustom(). It is NOT in any case whatsoever, re-initializing as you had it load once before and as you yourself have said,

"iCustom returns .... and no .../ deinitialized messages in the logs."

If it is init()...deinit()...init()....deinit()....and so on, so forth, as you imagined, then did you, or did you not see deinitialized messages in the logs." ?




Only one init() in the logs, at the start of EA. no imagination at work.
 
AnkaSoftware:

Only one init() in the logs, at the start of EA. no imagination at work.
Then WHY did YOU open this post and say:
When the indicator input has variables (containing constants), the indicator is init()'ing at every call to iCustom. Any workaround / suggestions to prevent indicator from init()ing, each time iCustom is called with variable input parameters?
 
WHRoeder:
Then WHY did YOU open this post and say:

Because that is the PROBLEM, when variables are used in iCustom inputs to the indicator. Are you sure you understand the problem?
 

First you say it is init()ing each time iCustom is called

Then you say Only one init() in the logs, at the start of EA.

witch is it? post the log

 
WHRoeder:

First you say it is init()ing each time iCustom is called

Then you say Only one init() in the logs, at the start of EA.

witch is it? post the log


To clarify

- With hard coded constants ie - iCustom(NULL, 0, <indicator name>, 105, 38.2, 30, mode, bar); <----------- inits once

- With variables ie - iCustom(NULL, 0, <indicator name>, x, y, z, mode, bar); <----------- inits at each call

Hope this clarifiies

Reason: