ChartShot API

11 Jun 2015, 11:00ChartShot API#1
SwapBridgeCapitalposts: 34since: 01 Oct 2014

http://help.spotware.com/charts/chartshots

 

Can I access this feature within calgo api. 

 

I would like to automate the process of taking a screenshot based on logic. 

If it can't be done with the calgo api, What function in c# or dll to use. Please include sample code, thank you

11 Jun 2015, 14:29#2
Spotware Teamposts: 3359since: 23 Sep 2013

Dear Trader,

Thank you for your suggestion. We will consider it. Additionally you can post your ideas/suggestions to http://vote.spotware.com/


TRADERS FIRST™ Vote for your favorite features: http://vote.spotware.com/
10 Feb 2019, 12:51Solved with ffmpeg#3
BetsAnalistasCBotposts: 5since: 10 Feb 2019

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

10 Feb 2019, 13:21RE: Solved with ffmpeg#4
BetsAnalistasCBotposts: 5since: 10 Feb 2019

BetsAnalistasCBot said:

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

10 Feb 2019, 13:22RE: RE: Solved with ffmpeg#5
BetsAnalistasCBotposts: 5since: 10 Feb 2019

 

using System.Diagnostics;

private string FFmpegArguments;

if (CaptureChart(Symbol.Code.ToString()))
{
        Print(Symbol.Code.ToString() + " Chart successfully captured");
}

private bool CaptureChart(string Simbolo)
{
     FFmpegArguments = "-f gdigrab -i title=\"" + Simbolo + ", " + TimeFrame.ToString().Replace("Minute", "m").Replace("Hour", "h").Replace("Daily", "D").Replace("Day", "D").Replace("Tick", "t") + " - FxPro cTrader\" -s 800x400 -vframes 1 -f mjpeg z:/ForexCharts/" + Simbolo + ".png -y";

     if (Simbolo.Substring(0, 1) == "#")
           FFmpegArguments = "-f gdigrab -i title=\"" + Simbolo + ", " + TimeFrame.ToString().Replace("Minute", "m").Replace("Hour", "h").Replace("Daily", "D").Replace("Day", "D").Replace("Tick", "t") + " - FxPro cTrader\" -s 800x400 -vframes 1 -f mjpeg z:/ForexCharts/" + Simbolo.Substring(1) + ".png -y";

     try
     {
        Process myProcess = new Process();
        myProcess.StartInfo.UseShellExecute = false;
        myProcess.StartInfo.Arguments = Argumentos;
        myProcess.StartInfo.FileName = "c:/nginx/ffmpeg/bin/ffmpeg.exe";
        myProcess.StartInfo.CreateNoWindow = true;
        myProcess.Start();
        myProcess.WaitForExit();
        return true;
     } catch (Exception e)
     {
        Print(e.Message);
        return false;
     }
}
10 Feb 2019, 13:24RE: RE: Solved with ffmpeg#6
BetsAnalistasCBotposts: 5since: 10 Feb 2019

BetsAnalistasCBot said:

BetsAnalistasCBot said:

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

First Detach your Symbol Chart from cTrader window and then use the code below to capture your Window Symbol Chart

Best regards

10 Feb 2019, 13:32RE: RE: RE: Solved with ffmpeg#7
BetsAnalistasCBotposts: 5since: 10 Feb 2019

BetsAnalistasCBot said:

BetsAnalistasCBot said:

BetsAnalistasCBot said:

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

I have solved the problem running ffmpeg with "Process" from System.Diagnostics

First Detach your Symbol Chart from cTrader window and then use the code below to capture your Window Symbol Chart

Best regards

using System.Diagnostics;
 
private string FFmpegArguments;
 
if (CaptureChart(Symbol.Code.ToString()))
{
        Print(Symbol.Code.ToString() + " Chart successfully captured");
}
 
private bool CaptureChart(string Simbolo)
{
     FFmpegArguments = "-f gdigrab -i title=\"" + Simbolo + ", " + TimeFrame.ToString().Replace("Minute", "m").Replace("Hour", "h").Replace("Daily", "D").Replace("Day", "D").Replace("Tick", "t") + " - FxPro cTrader\" -s 800x400 -vframes 1 -f mjpeg z:/ForexCharts/" + Simbolo + ".png -y";
 
     if (Simbolo.Substring(0, 1) == "#")
           FFmpegArguments = "-f gdigrab -i title=\"" + Simbolo + ", " + TimeFrame.ToString().Replace("Minute", "m").Replace("Hour", "h").Replace("Daily", "D").Replace("Day", "D").Replace("Tick", "t") + " - FxPro cTrader\" -s 800x400 -vframes 1 -f mjpeg z:/ForexCharts/" + Simbolo.Substring(1) + ".png -y";
 
     try
     {
        Process myProcess = new Process();
        myProcess.StartInfo.UseShellExecute = false;
        myProcess.StartInfo.Arguments = FFmpegArguments;
        myProcess.StartInfo.FileName = "c:/ffmpeg/bin/ffmpeg.exe";
        myProcess.StartInfo.CreateNoWindow = true;
        myProcess.Start();
        myProcess.WaitForExit();
        return true;
     } catch (Exception e)
     {
        Print(e.Message);
        return false;
     }
}