Sending a keyboard Command from a NinjaTrader Script - NinjaTrader | futures io social day trading
futures io futures trading


Sending a keyboard Command from a NinjaTrader Script
Updated: Views / Replies:735 / 2
Created: by ECI Ed Attachments:0

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 dont 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
 

Sending a keyboard Command from a NinjaTrader Script

  #1 (permalink)
Trading Apprentice
Seminole, FL
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 17 since Oct 2011
Thanks: 9 given, 1 received

Sending a keyboard Command from a NinjaTrader Script

Would it be possible to send a keyboard command such as <PrintScreen> to the computer from within NinkaTrader script? Specifically, I'd like to save a copy of my charts at a trigger point using the Hot key in SnagIt. If so, can you please explain how and maybe provide some sample code?

There is another post on Big Mike's forum that suggests using:

SendKeys.Send("{PrintScreen}");

but when I tried this I got an error message on compile of:

The name 'SendKeys' does not exist in the current context.

Thanks

Reply With Quote
 
  #2 (permalink)
Elite Member
Barcelona
 
Futures Experience: Beginner
Platform: NinjaTrader 7
Favorite Futures: CL, TF
 
grankus's Avatar
 
Posts: 8 since Aug 2012
Thanks: 5 given, 0 received


Quoting 
...The name 'SendKeys' does not exist in the current context...

Did you finally find the solution?

Reply With Quote
 
  #3 (permalink)
 Vendor: www.edevaay.com 
Al,India
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: RKG
Favorite Futures: NiftyFuture
 
devdas's Avatar
 
Posts: 1,547 since Feb 2010
Thanks: 1,460 given, 1,661 received



ECI Ed View Post
....... Specifically, I'd like to save a copy of my charts at a trigger point using the Hot key in SnagIt. If so, can you please explain how and maybe provide some sample code?

There is another post on Big Mike's forum that suggests using:

SendKeys.Send("{PrintScreen}");

but when I tried this I got an error message on compile of:

The name 'SendKeys' does not exist in the current context.

Thanks

SendKeys.Send will work with a listener , here it should be SnagIt.

You have to send keys to SnagIt from NT.

For that perhaps i only know some dirty methods of Dll import like this,

 
Code
using System.Threading;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using System.Linq;

[DllImport("user32.dll",EntryPoint = "FindWindow")]
private static extern IntPtr FindWindow(string lp1,string lp2);

[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetForegroundWindow(IntPtr hWnd);


private void trigger_function()
		{
			IntPtr handle = FindWindow(null, "SnagIt");      // handle for SnagIt
			 
				if(!handle.Equals(IntPtr.Zero))
				{
					if(SetForegroundWindow(handle))
					{
						
						SendKeys.SendWait("Key combo for print in SnagIt");
						
						SendKeys.Flush();
					}
					else Print("Failed In");
					
				}
				else Print("Failed Out"+handle.ToString());
				
		}
I have exampled above code snap from my own different key thrower script, you have to take care of key combos
that are accepted in SnagIt.

OTOH, just for saving your chart, there are other esay way you can use, just look some tools from @vvhg

Harvest The Moon
Nest The Market
Reply With Quote
The following user says Thank You to devdas for this post:

Reply



futures io > > > > Sending a keyboard Command from a NinjaTrader Script

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming with NinjaTrader script Wolfgang NinjaTrader Programming 4 February 25th, 2014 12:11 PM
Ninja Script Print command fails to show on chart. TheGaryGuy NinjaTrader 7 January 22nd, 2013 07:38 PM
Sending a keyboard command from an efs study ECI Ed eSignal 0 January 10th, 2012 10:13 AM
Need little help with a Ninjatrader script raindrop NinjaTrader Programming 9 April 20th, 2011 11:35 PM
looking for C# code for a keyboard command simulation max-td NinjaTrader Programming 3 December 29th, 2010 10:24 AM


All times are GMT -4. The time now is 04:12 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-12 in 0.08 seconds with 19 queries on phoenix via your IP 54.163.210.170