NexusFi: Find Your Edge


Home Menu

 





Chart Picture through EL?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,446 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Chart Picture through EL?

  #1 (permalink)
 
westsider's Avatar
 westsider 
St Louis, MO
 
Experience: Intermediate
Platform: Ninjatrader TOS Jigsaw
Broker: Ninjatrader
Trading: MES
Posts: 114 since Jun 2011
Thanks Given: 55
Thanks Received: 127

Hello,
Does anyone know how to take a screen shot of a chart through easy language? It can be done if you buy an indicator but I like to do things myself.
Thanks
Westsider

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


westsider,

it will likely be along the lines of using the command line to execute a macro or call the program that does the screenshot. The downside with the command line is that the commands are applied to the chart that currently has the focus (basically the one you last clicked into). This can lead to unwanted results.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
westsider's Avatar
 westsider 
St Louis, MO
 
Experience: Intermediate
Platform: Ninjatrader TOS Jigsaw
Broker: Ninjatrader
Trading: MES
Posts: 114 since Jun 2011
Thanks Given: 55
Thanks Received: 127

Thanks for your input ABCTG . Got me thinking. Since there is no way to do this I wrote app in Visual Studio. You would have to replace your email address and mail client then compile it and finally call the exe from within your EL code. Henry @ Multicharts wrote an elegant function to call apps or DLL's and its called

ShellExecute.pla sample

So I use that function to call my Exe file when I want to take a screenshot and email it to me from within TS.

Westsider

 
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Mail;

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
using System.Reflection;
using System.Windows.Forms;


namespace MailScreenShot
{
    class Program
    {
        static void Main(string[] args)
        {
            // Capture the screen to a stream
            Bitmap memoryImage = new Bitmap(SystemInformation.VirtualScreen.Width,
                                SystemInformation.VirtualScreen.Height,
                                PixelFormat.Format64bppArgb);       
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            memoryGraphics.CopyFromScreen(SystemInformation.VirtualScreen.X,
                                       SystemInformation.VirtualScreen.Y,
                                       0,
                                       0,
                                       SystemInformation.VirtualScreen.Size,
                                       CopyPixelOperation.SourceCopy);
            System.IO.Stream stream = new System.IO.MemoryStream();
            memoryImage.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
            stream.Position = 0;

            // send mail
            string to = "[email protected]";       //  Replace with your email address
            string from = "[email protected]";   //  Replace with your email address
            MailMessage message = new MailMessage(from, to);  
            message.Subject = "Tradestation";
            message.Body = @"Trade Alert";
            Attachment attach = new Attachment(stream, "MyImage.Jpeg");
            message.Attachments.Add(attach);
            SmtpClient client = new SmtpClient("Your Mail Client");   // Replace with your email client
            // Credentials are necessary if the server requires the client 
            // to authenticate before it will send e-mail on the client's behalf.
            client.UseDefaultCredentials = true;
            try
            {
                client.Send(message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception caught in CreateTestMessage2(): {0}",
                            ex.ToString());
            }
            return;
        }
    }
}

Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on May 12, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts