SetActiveWindow in NT - NinjaTrader Programming | futures io social day trading
futures io futures trading


SetActiveWindow in NT
Updated: Views / Replies:2,338 / 13
Created: by terratec 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 100,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

 
 
Thread Tools
 

SetActiveWindow in NT

 
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 512 received

SetActiveWindow in NT

If working with HotKeys in NT you have the problem that some of them need the window to be active. If you fire a market order then it goes to the active window. If you have (HotKey) code in a non active window it will not be executed.

How can I set a window a moment before execution to active in NT?

Something like:

SetActiveWindow()
SendKeys.Send("^%{LEFT}"); // for market order

But of course it is not that simple. What I found in the WWW was confusing and not very simple.

Has someone a code for NT?

 
 
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
 
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,423 since Jun 2009
Thanks: 29,509 given, 84,383 received




Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

 
 
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,072 received


terratec View Post
If working with HotKeys in NT you have the problem that some of them need the window to be active. If you fire a market order then it goes to the active window. If you have (HotKey) code in a non active window it will not be executed.

How can I set a window a moment before execution to active in NT?

Something like:

SetActiveWindow()
SendKeys.Send("^%{LEFT}"); // for market order

But of course it is not that simple. What I found in the WWW was confusing and not very simple.

Has someone a code for NT?

NT Hotkeys are quite basic and limited, why don't you use an external app like autohotkey AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText Some pictures and more explanations would help to define the problem. I am currently using AHK find some examples here https://futures.io/ninjatrader/8373-ninja-autohotkey-order-entrys-4.html


Last edited by redratsal; November 30th, 2011 at 05:40 PM.
The following user says Thank You to redratsal for this post:
 
 
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 512 received

I set an entry order by pushing a button in an indicator (as always not strategy) one tick above the close of the last bar. Then the entry is trailed if the next bar's high is lower. If it get triggered a hotkey does send a MIT order with the active ATM strategy.

Problem: The code does only execute the hotkey when the window is active (that's by NT) So I have to set it active before the hotkey code is executed.

@redratsal: thanks for the AutoHotKey link. I will check it. If I can call AutoHotKey from the NT code it could work.

 
 
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,072 received

This is an example how you could use AHK integrated with NT Hot Key:

1) I set in NT my market buy order with the keys ALT+F12
2) I set my Activation Window with AHK with the keys ALT+F11

Everytime you have the trigger all you have to do is push ALT+F11+F12



AHK script

 
Code
!F11::
WinWait, 6E 12-11 , 
IfWinNotActive, 6E 12-11   , , WinActivate, 6E 12-11 , 
WinWaitActive, 6E 12-11 , 
return

IfWinActive [, WinTitle, WinText, ExcludeTitle, ExcludeText]

**you will have to specify the name of the window you want to activate, in my case 6E 12-11**

The following 2 users say Thank You to redratsal for this post:
 
 
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 512 received


redratsal View Post
Some pictures and more explanations would help to define the problem.

In the meantime I did post the related indicator here.

The following user says Thank You to terratec for this post:
 
 
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,072 received

With AHK all you have to do is insert the AHK shortcut before your NT shortcut string:


//if (entryprice*TickSize>=GetCurrentBid())
else if (entryprice*TickSize>=Low[0])
{
SendKeys.Send("AHK keys");
SendKeys.Send("^%{RIGHT}");
entryprice=0;
}

 
 
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 512 received

@redratsal:
My thinkung did go in the same direction. Will do over the weekend. THX

 
 
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,072 received


Another solution is via c#, I haven't tested it yet but you can look here (if you haven't already done it):

Activated Event


 



futures io > > > > > SetActiveWindow in NT
Thread Tools



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

July Journal Challenge - $500 in Amazon Gift Cards!

July
 

Current Events in Commodity Markets: Influence & Crowd Psychology w/IQFeed

Jul 12

AXESS Trader: Powerful cloud Based Trading Platform w/GFF Brokers

Jul 17

TBA: FuturesTrader71 w/Morad Askar

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade NT 6.5 to NT 7..BIG PROBLEMS! turkmay NinjaTrader 36 May 18th, 2011 09:48 AM
Simple template to convert NT Strategy to NT IUndicator visounds NinjaTrader Programming 4 March 31st, 2011 07:16 AM
Converting your Indicator for free --> NT 6.5 to NT 7 Druid The Elite Circle 21 September 27th, 2010 08:49 AM
NT 6.5 issue - image sometimes stays on screen after I close NT window Todd The Elite Circle 11 March 19th, 2010 09:14 AM


All times are GMT -4. The time now is 01:10 AM. (this page content is cached, log in for real-time version)

Copyright © 2018 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 2018-07-14 in 0.13 seconds with 14 queries on phoenix