Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 05:11:16 +0000



Post From: How to read file with sc.ReadFile()?

[2022-05-21 21:26:19]
User431178 - Posts: 541
I assume your 40ms is the calculation time shown in the studies window?

Use manual looping and only open/read the file once, outside of the main loop.
By using auto loop and structuring the code the way you have, the file is opened/read/closed once for every bar in the chart.

EDIT:
I lied, the file is opened/read/closed twice for every chart bar, as you have two calls to ReadTextFile in this line -

MyInputString.Format(ReadTextFile(sc, PathAndFileName).GetSubString(ReadTextFile(sc, PathAndFileName).GetLength()-1, 0));

Date Time Of Last Edit: 2022-05-22 11:33:39