Code to save my chart in a directory - NinjaTrader Programming | futures io social day trading
futures io futures trading


Code to save my chart in a directory
Updated: Views / Replies:1,995 / 9
Created: by cunparis Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Code to save my chart in a directory

  #1 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received

Code to save my chart in a directory

I trade from work and during my commute using my iPhone. Don't laugh, Darvas traded with telegrams! I find that I actually do very well if I'm not watching the market. I have my charts emailed to me whenever a trigger occurs (new swing hi/low for example).

I'd like to have my indicator save my image as a jpeg to a specific directory on my pc, I have tomcat running to serve it up over HTTP. Then I can check my chart real time any time I want without waiting for a trigger to send an email.

Any ideas on how to do this? I'm using this to email the chart, I got it from a forum, I don't know .NET:

 
Code
                // get bitmap of chart panel
                System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(chart.ChartPanel.Width, chart.ChartPanel.Height, PixelFormat.Format16bppRgb555);
                chart.ChartPanel.DrawToBitmap(bmp, chart.ChartPanel.ClientRectangle);
                
                // save to stream (as jpg to reduce size)
                System.IO.MemoryStream stream = new System.IO.MemoryStream();
                bmp.Save(stream, ImageFormat.Jpeg );
                stream.Position = 0;
I can post my email indicator if anyone is interested.

Reply With Quote
 
  #2 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 73 received

Cunparis, yes it can be done. I had an auto screen saver working that would periodically capture all my trading screens. I stop using it because it was capturing too many forums in lull periods. LOL. I will try to dig it out for you after the close.

Reply With Quote
 
  #3 (permalink)
CL Assassin
Near Dallas, Texas, US
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: ZenFire
Favorite Futures: CL
 
Gary's Avatar
 
Posts: 1,070 since Jun 2009
Thanks: 504 given, 2,230 received


Have you looked at something like this?

It's Here! Remote Desktop Client (RDP) for the IPhone and iPod Touch - Terminal Services / Citrix Client

Reply With Quote
 
  #4 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received



I use Jaadu remote desktop for iPhone. It works great. Well almost. There is no way to middle click so I use AutoHotKey. There is no way to scroll the DOM either. I haven't got a solution for that one.

But I can't leave remote desktop connected all the time. I just want something where I can refresh a webpage and see my chart. Just one.

TAJTrades - I want to save just the chart and not all the desktop because I need the file to be very small so I don't use up my bandwidth limit on the iPhone.

Reply With Quote
 
  #5 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 73 received


cunparis View Post
TAJTrades - I want to save just the chart and not all the desktop because I need the file to be very small so I don't use up my bandwidth limit on the iPhone.


Does anyone know the code to bring "Focus" to a specific chart within an NT Indicator. Say I want to make the 5 Min chart the active chart and then get the get the location of the Form on the screen? That would solve an issue for cunparis and myself.

Reply With Quote
 
  #6 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received


TAJTrades View Post
Does anyone know the code to bring "Focus" to a specific chart within an NT Indicator. Say I want to make the 5 Min chart the active chart and then get the get the location of the Form on the screen? That would solve an issue for cunparis and myself.

I think you're looking at it from another perspective.

I add an indicator to my chart which emails me the chart when a trigger occurs. So there is no focus. The only catch is the chart cannot be minimized but that's not a problem for me.

I'm going to fool around with .NET and find a way to save the bitmap to a PNG file, will try it this weekend.

Reply With Quote
 
  #7 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 73 received


cunparis View Post
I'm going to fool around with .NET and find a way to save the bitmap to a PNG file, will try it this weekend.


What I have working uses the following:

Screen[] screens = Screen.AllScreens;
switch (whichScreen)
{
case "One":
bounds = screens[0].Bounds;
break;
case "Two":
bounds = screens[1].Bounds;
break;
case "All":
bounds = Rectangle.Union(screens[0].Bounds, screens[1].Bounds);
break;
default:
bounds = Rectangle.Union(screens[0].Bounds, screens[1].Bounds);
break;
}

Screen[] If you have a multiple screen setup you must specify which or all screens to capture the image as will as the the BitsPerPixel.


using (Bitmap captured = new Bitmap(bounds.Width, bounds.Height, format))
using (Graphics gdi = Graphics.FromImage(captured))


Bounds will tell the indicator to draw a rectangle and then you capture that area to create the image. Once you have captured the image then you can draw on the image any additional information you would like.

So if you have a Static screen (never changes from day to day) then you can avoid bringing Focus to a specific Form and just capture the same rectangle. The rectangle can be any size you want to specify. If you are concerned about band width then you may choose to capture just a small part of the screen.


captured.Save(publicFileName, ImageFormat.Png);

This would be an example of how you specify the file format.


What I have done is capture all the screens individually. Then manipulate the individual images and stack them vs having them side by side as is the Windows setup. I also replace the DOM with a blank rectangle and use that area to add additional notes to the image. It is very specific to what I wanted to accomplish and only works on the computer that it was written for. All this is done based upon the bar count for the fastest time frame therefor I capture every bar on every chart.

The advantage of bringing Focus to each Form before capturing would be that you would not be capturing this Big Mikes Trading website when the indicator fired the command to capture.


Forgot to add: If someone has already figured out how move from Form to Form and then do a check for the Period and Interval thereby knowing which Form to bring Focus to then it would be easy for me to convert my stuff for you. By doing this I can code an indicator that says: 1) Entry signal issued, 2) Capture the 5 Minute Chart, 3) save the chart. Then all that is left is mailing the Attachment.


Last edited by TAJTrades; September 25th, 2009 at 10:41 AM.
Reply With Quote
 
  #8 (permalink)
Trading for Fun
Here, GA
 
Futures Experience: Intermediate
Platform: Ninja
 
Posts: 146 since Jun 2009
Thanks: 1 given, 73 received

Here is a sample picked at random of my automated screen capture. It is the 3rd image captured on July 13, 2009. On the very bottom right corner you will see where I added the File Name to the Image on Top of the Slider Bar. The White rectangle is where I remove the DOM from the image.

Attached Thumbnails
Code to save my chart in a directory-public-es-090713-mon-day-3.png  
Reply With Quote
 
  #9 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received


TAJTrades View Post
Here is a sample picked at random of my automated screen capture. It is the 3rd image captured on July 13, 2009. On the very bottom right corner you will see where I added the File Name to the Image on Top of the Slider Bar. The White rectangle is where I remove the DOM from the image.

'What I want to do is even easier. I have one small chart. That's all I want. I'm viewing these on an iphone so it has to be as small as possible. and as fast as possible.

Reply With Quote
 
  #10 (permalink)
Membership Revoked
Ontario, Canada
 
Futures Experience: None
Platform: NT
Broker/Data: IB
Favorite Futures: gold
 
dario1's Avatar
 
Posts: 405 since Jan 2012
Thanks: 62 given, 52 received

save a chart every 30 min


Anyone has a program to save a NT chart every 30 min. The chart is inside my NT workspace but is not an active chart on my PC screen.
Thank you

Reply With Quote

Reply



futures io > > > > > Code to save my chart in a directory

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save The Gambling Bankers zt379 News and Current Events 5 August 23rd, 2011 09:59 AM
Time remaining code for candlestick chart NJ cattlefitter NinjaTrader 3 July 20th, 2011 06:42 PM
Debt Restructuring Is the Only Way To Save the Euro Quick Summary News and Current Events 0 January 25th, 2011 04:40 AM
Save parameters from one session to another bukkan NinjaTrader Programming 7 January 4th, 2010 05:54 AM
Save the Drama for your Mama Dragon Off-Topic 20 November 19th, 2009 10:15 PM


All times are GMT -4. The time now is 12:59 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-16 in 0.14 seconds with 20 queries on phoenix via your IP 54.91.38.173