Does using separate functions slow down code?  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Does using separate functions slow down code?

Postby ZaphodB » 22 May 2020

If I were to allocate parts of my strategy code to functions, would that slow down the calculation time? Let's say it's a pretty simple strategy and you move parts of the code to functions with all things pretty much being equal, what percent effect would this have on speed?

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

Re: Does using separate functions slow down code?

Postby TJ » 22 May 2020

If I were to allocate parts of my strategy code to functions, would that slow down the calculation time? Let's say it's a pretty simple strategy and you move parts of the code to functions with all things pretty much being equal, what percent effect would this have on speed?
No, it won't slow down your strategy.
When MultiCharts compiles your code, the process integrates everything into one operation.

User avatar
ZaphodB
Posts: 64
Joined: 12 Feb 2019
Has thanked: 20 times
Been thanked: 2 times

Re: Does using separate functions slow down code?  [SOLVED]

Postby ZaphodB » 08 Jun 2020

Excellent, thank you


Return to “MultiCharts”