Support Board
Date/Time: Sat, 23 Nov 2024 17:02:43 +0000
Post From: Study write to file problem with SC 996
[2013-07-13 22:27:14] |
Sierra Chart - Max - Posts: 5730 |
I do see an issue the compilation. Also a quick look at the code shows that there is an extra "}" at the end. The following code does compile and output to the file. #include <fstream> #include "sierrachart.h" SCDLLName("KAI TEST") SCSFExport scsf_KAI_TEST(SCStudyGraphRef sc) { if (sc.SetDefaults) { sc.GraphName = "KAI Test Study"; sc.StudyDescription = "KAI Test Study"; sc.GraphRegion = 0; sc.AutoLoop = 1; sc.FreeDLL = 0; return; } SCString Buffer; std::ofstream DataFile("D:\\KAI_TEST.TXT", std::ofstream::out | std::ofstream::app); Buffer.Format("%s,%f\n",sc.Symbol.GetChars(), sc.Close[sc.Index]); DataFile << Buffer.GetChars(); DataFile.close(); } Also please look at the provided Write Bar Data To File study source code found inside of Studies6.cpp scsf_WriteBarDataToFile in the ACS_Source folder within your Sierra Chart installation folder. Sierra Chart Support Date Time Of Last Edit: 2013-07-13 22:59:38
|