Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 21:29:24 +0000



Post From: Python for Sierra Chart

[2014-01-09 05:39:24]
onnb - Posts: 660
this is off the original topic on python, jbutta, for what its worth, the following study will create an image for you on bar close. I used it in order to save images to a web server and it works quite well. You might need to adapt it for your needs like saving the file on session close or at a specific time of day. You would then apply this study to all charts you want saved. SC saves them for you in the images directory same as you would be saving an image manually.


  if (sc.SetDefaults)
  {
    sc.GraphName = "Save Chart Image to File";
    sc.StudyDescription = "";
    sc.AutoLoop = 1; // true
    sc.GraphRegion = 2;
    sc.HideStudy = 1;
    sc.DrawZeros = 0;
    sc.FreeDLL = 1;
    return;
  }
  
  if (sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_NOT_CLOSED)
  {
    return;
  }

  sc.SaveChartImageToFile = 1;