Support Board
Date/Time: Sat, 10 May 2025 21:46:01 +0000
Post From: Read parameters from a file and set variables
[2016-01-19 19:01:57] |
ertrader - Posts: 682 |
I have created a functioning example of how to read in parameters from a file. The .cpp and text file are attached. I have searched the support board and documentation and could not find a good example so I created one. To get the code working: 1) Place the text file with parameters in the data folder or where your custom .dlls get compiled to 2) Compile the .cpp and attach to a graph as any other study 4 MA's will be drawn as an example. My question is: In regards to reading in values from a file and setting variables, is the method I have coded the correct and most efficient way for the SC environment? In particular: 1) I am using global variables to pass multiple values (integers w,x,y,z read from the file and then the global variables are updated) 2) I am using iostream to read data that is space delimited. A close file command is not needed with iostream as best I can tell. I'm not a c++ expert so am looking for suggestions. Best regards Date Time Of Last Edit: 2016-01-19 23:14:05
|
![]() ![]() |