Will inserting a print statement after stipulating a buy order slow the buy order down?  [SOLVED]

Questions about MultiCharts and user contributed studies.
multichartsUser23
Posts: 15
Joined: 02 Mar 2018
Has thanked: 3 times

Will inserting a print statement after stipulating a buy order slow the buy order down?

Postby multichartsUser23 » 27 Jan 2019

Hi guys,

I'd like to deploy some diagnostic print statements to examine the data and conditions that lead to my order entries during autotrading.

However, execution speed and memory usage is somewhat of a concern for me, so I wanted to pose the following question:

When my PL script stipulates a buy order, does MC/Portfolio Trader wait to reach the end of the script before generating that order? Or does it generate it as soon as it interprets that line stipulating the buy order and before it reaches the end of the script?

I ask because if stipulating the buy order and printing output via a print statement on the line immediately after the buy order will slow that buy order (ie. the print statement would be one more line to process before reaching the end of the script, thus taking time), if in fact PL has to reach the end of the script before generating the order.

Thanks a lot!

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

Re: Will inserting a print statement after stipulating a buy order slow the buy order down?

Postby TJ » 27 Jan 2019

Hi guys,

I'd like to deploy some diagnostic print statements to examine the data and conditions that lead to my order entries during autotrading.

However, execution speed and memory usage is somewhat of a concern for me, so I wanted to pose the following question:

When my PL script stipulates a buy order, does MC/Portfolio Trader wait to reach the end of the script before generating that order? Or does it generate it as soon as it interprets that line stipulating the buy order and before it reaches the end of the script?

I ask because if stipulating the buy order and printing output via a print statement on the line immediately after the buy order will slow that buy order (ie. the print statement would be one more line to process before reaching the end of the script, thus taking time), if in fact PL has to reach the end of the script before generating the order.

Thanks a lot!

MultiCharts executes the script Line-by-Line.



Return to “MultiCharts”