duplicating running scripts


Category:
0
0

Hi Pete, When you use a script multiple times in a quote does it run once or one for each occurrence e.g.
def pcc = sp_ichimoku17072101().”price_confirmed_by_chikou”;
def ccf = sp_ichimoku17072101().”chikou_crossed_first”;

Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on July 27, 2017 7:38 am
65 views
0
Private answer

I’m not sure why this is a concern. But my understanding is that it will run each time it is called. It’s really just shorthand, to keep the code neat and tidy. If you suspect performance is an issue I would test it using the entire code instead of calling to the external script multiple times.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 27, 2017 9:50 am
0

learning. i worry about this because being a programmer for so long i always worry about such things.
the real concern is that i see messages that say query is too complex for realtime but it’s fine to put it in the script. that doesn’t really help anything. It wastes so much time to run the script serially for how many times it’s used.
i’ve have started putting the query questions inside the script so a query only has to get 1 answer. its another reason i want to use the script command. i can get rid of swaths of code at one time.
Thanks again

( at July 27, 2017 11:08 am)
0

”to complex for realtime”, I’ve only seen that when adding code to a custom scan filter. Assuming that is your case as well, it helps to understand the limits to the scan engine. It is nowhere near as robust as chart studies. Here is an example of one of those limits: https://www.hahn-tech.com/ans/relative-volume-by-time/

One way to get around the limits is to split the code into various study filter elements. That would not work in the case of nested IF’s. But it can be used in many other instances.

( at July 27, 2017 12:17 pm)