does description slow an indicator down?

 

Hello Forum, possibly my most ignorant question, but then again I don't know!

As a newbie I find myself putting a lot of descriptive text in my code, to remind me of what I am trying to do and allow me to come back to rework errors etc

In the more complex work, this might be 100 or 200 lines of description, maybe more !!

Just thought I should ask whether this has any affect on the speed of the indicator, when attached to a chart?

Feeling a bit exposed asking this one, but would like to know whether I should have 2 indicators one with the descriptive text for coding and one without descriptive text for actual use on charts

thanks as always

dave

 
pullend:

Hello Forum, possibly my most ignorant question, but then again I don't know!

As a newbie I find myself putting a lot of descriptive text in my code, to remind me of what I am trying to do and allow me to come back to rework errors etc

In the more complex work, this might be 100 or 200 lines of description, maybe more !!

Just thought I should ask whether this has any affect on the speed of the indicator, when attached to a chart?

Feeling a bit exposed asking this one, but would like to know whether I should have 2 indicators one with the descriptive text for coding and one without descriptive text for actual use on charts

thanks as always

dave


You mean comment like this :

/*
this is ...
... a multiline ...
... comment.
*/

// this is single line comment

Then the answer is no - it's not slowing down the CI, EA or Script. In compiled code or .ex4, all comments is deleted.

Most likely the calculation in your CI, is the one that causing your CI to slow down, like for example, in some cases, some loop within loop can cause a slow down

 
  1. phi.nuts: Most likely the calculation in your CI, is the one that causing your CI to slow down, like for example, in some cases, some loop within loop can cause a slow down
    Most likely, the CI is recalculating every bar on every tick, instead of just what is required.
    int counted = IndicatorCounted();
    if (counted < N) counted = N;  // Adjust for maximum look back, e.g. iMA(length) N=length
    for(int iBar    = Bars - 1 - counted; iBar >= 0; iBar--)
        buffer[iBar] = ...

  2. pullend: ask whether comments has any affect on the speed of the indicator, when attached to a chart?
    Comments have no effect on compiled code.
  3. There are no mind readers here. Without you posting your code, we can only guess.
 
phi.nuts:


You mean comment like this :

Then the answer is no - it's not slowing down the CI, EA or Script. In compiled code or .ex4, all comments is deleted.

Most likely the calculation in your CI, is the one that causing your CI to slow down, like for example, in some cases, some loop within loop can cause a slow down


thanks, the fact that in compiled code "all comments are deleted" is exactly what I was looking for.

apologies if I was not clear, I was talking about comments like

// the is a comment......

the fact that they are all removed when compiled means I can be as descriptive as I want

thanks

dave

 
WHRoeder:
  1. phi.nuts: Most likely the calculation in your CI, is the one that causing your CI to slow down, like for example, in some cases, some loop within loop can cause a slow down
    Most likely, the CI is recalculating every bar on every tick, instead of just what is required.
  2. pullend: ask whether comments has any affect on the speed of the indicator, when attached to a chart?
    Comments have no effect on compiled code.
  3. There are no mind readers here. Without you posting your code, we can only guess.

Thanks WHRoeder apologies I was a little unclear

I did not know that comments had no affect on compiled code and that was the answer I was looking for.

However your additional information is great as I have had trouble with code in the past for I suspect exactly the reasons you mention.

Have to admit I have not known to make the careful the distinction about how often the calculation is made.

Might just have been lucky up until now, will go and do some research now

thanks again

dave

Reason: