NexusFi: Find Your Edge


Home Menu

 





ninja & AutoHotKey for order entrys


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one redratsal with 13 posts (21 thanks)
    2. looks_two monpere with 9 posts (8 thanks)
    3. looks_3 max-td with 7 posts (4 thanks)
    4. looks_4 paulg with 5 posts (0 thanks)
      Best Posters
    1. looks_one redratsal with 1.6 thanks per post
    2. looks_two sam028 with 1 thanks per post
    3. looks_3 monpere with 0.9 thanks per post
    4. looks_4 max-td with 0.6 thanks per post
    1. trending_up 31,601 views
    2. thumb_up 38 thanks given
    3. group 20 followers
    1. forum 60 posts
    2. attach_file 1 attachments




 
Search this Thread

ninja & AutoHotKey for order entrys

  #41 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


redratsal View Post
I have been rethinking the possibility to switch my NT workspaces in a faster way. Since I didn't like to assign a key sequence on my keyboard via autohotkey, as it could interfere with non trading activities, for example while I am writing a post via futures.io (formerly BMT) I could hit an AHK key and launch the function without wanting it. I also didn't like the idea to pause and restart the AHK everytime. I found a fast and easy solution by creating single functions via AHK and installing them on the windows tasks bar. As AHK assigns always the same icon, I created personalized icons with the name of my workspace in order to better visualize wich workspace I want to open. I applied the icons to each function via the icon changer function of AHK (C:\Program Files (x86)\AutoHotkey\Compiler\ahk2.exe).

Instead of using the sequential shift+f3 NT function, which might be long if working with several workspaces, this method is fast and direct; all I have to do is click on the respective icon and the workspace will be opened within the blink of an eye.

In the attached video a brief demonstration how to use the function:



Find below the AHK script code for each function (the function replactes the sequence of keys as with the mouse; in the control center alt+f+w+ the initial letter of the workspace)

WinWait, Control Center ,
IfWinNotActive, Control Center , , WinActivate, Control Center ,
WinWaitActive, Control Center ,
Sleep, 100
Send, {ALTDOWN}f{ALTUP}w5

Note:

The first letter of each workspace name must be different

For the icon builder you can find many free applications on the web, I used IcoFx2.0

The CPU usage with AHK is irrelevant, as the functions are closed once executed.

Very cool. In reference to hotkeys executing in undesired windows. Here's how I determine if the active window is a Ninjtrader Chart:

WinGetTitle, title, A ;### Get Active Window title
if ( RegExMatch(title, ".*?\(.*?\).*?\d+/\d+/\d+") ) {
MsgBox This is an NT Chart
;### Execute chart window code
}

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
24 thanks
The Program
18 thanks
  #42 (permalink)
paulg
NY
 
Posts: 90 since Sep 2009
Thanks Given: 54
Thanks Received: 23


paulg View Post
In NT, is there any way to click to place a limit order at the same price with 3 clicks, e.g. 1+1+1 , instead of using the context menu to change the lot size (and eventually the queue since you're increasing the order size in a FIFO engine)?

Anyone with an idea about this simple task?

Reply With Quote
  #43 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371



paulg View Post
Anyone with an idea about this simple task?

Not sure I understand, you want to place a limit order at the current market price, or a limit order at the price your crosshair is, or you want to change the lot size of an existing limit order?

Reply With Quote
  #44 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090


paulg View Post
Anyone with an idea about this simple task?


If your mouse has customizable buttons you can replicate the nt command:

rightclick+s+enter = sell limit
rightclick+b+enter = buy limit


all you have to do than is point your mouse on the chart at the price you want to put the order and click it.


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #45 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


redratsal View Post
If your mouse has customizable buttons you can replicate the nt command:

rightclick+s+enter = sell limit
rightclick+b+enter = buy limit


all you have to do than is point your mouse on the chart at the price you want to put the order and click it.

Also see post #25, for another option with AutoHotKey, if you have a simple mouse. If your non-programmable mouse has more then 3 buttons, you can also use the software to re-program the additional keys to perform these entry functions with once mouse click, and leave the main buttons for chart navigation.

Reply With Quote
  #46 (permalink)
paulg
NY
 
Posts: 90 since Sep 2009
Thanks Given: 54
Thanks Received: 23


redratsal View Post
If your mouse has customizable buttons you can replicate the nt command:

rightclick+s+enter = sell limit
rightclick+b+enter = buy limit


all you have to do than is point your mouse on the chart at the price you want to put the order and click it.

Thanks but I meant 1+1+1 at the same price and on superdom not on charts.

Reply With Quote
  #47 (permalink)
paulg
NY
 
Posts: 90 since Sep 2009
Thanks Given: 54
Thanks Received: 23


monpere View Post
Not sure I understand, you want to place a limit order at the current market price, or a limit order at the price your crosshair is, or you want to change the lot size of an existing limit order?

I simply want to place 3 limit orders of 1 lot each at the same price at my crosshair (effectively 3 limit orders that should not go at mkt) without using the 'change lot' feature; just a simple triple click at the same price. At least with standard NT setting you are asked to change the size of the order with a context menu and not adding a further 1 lot order (without asking further order size or change). Hope this clarifies a bit.

Reply With Quote
  #48 (permalink)
 steve2222 
Auckland, New Zealand
 
Experience: Beginner
Platform: Sierra Chart
Broker: AMP/CQG
Trading: Whatever moves in my timezone
Posts: 1,896 since Sep 2009
Thanks Given: 3,379
Thanks Received: 1,540


redratsal View Post
Those functions are not customizable with the Hot Key Manager, what you can do is use your keyboard:

Sell Limit= right click s + enter
Buy Stop= right click b + enter
Buy Stop Limit= right click ss + enter

It's not one button it's 2 but once you get confident it's faster

Hi @redratsal

Buy Stop Limit = right click bs + enter, would it not?

I can get Sell Stop Limit to work with right click ss + enter, but with Buy Stop Limit the press of the 'b' key takes you to 'Buy Stop' and if you then press 's' it drops down the menu to 'Show Data Box' as that also starts with 's'.

Any ideas?

PS: I think I solved it - Buy Stop Limit = right click bb + enter

Thanks

Reply With Quote
  #49 (permalink)
 greenr 
london/england
 
Experience: Advanced
Platform: Sierra charts, NinjaTrader, VK Trader
Broker: CQG, AMP, VK, Kinetick
Trading: CL/6E/TF/ES
Posts: 952 since Sep 2011
Thanks Given: 562
Thanks Received: 1,280


steve2222 View Post
Hi @ redratsal

Buy Stop Limit = right click bs + enter, would it not?

I can get Sell Stop Limit to work with right click ss + enter, but with Buy Stop Limit the press of the 'b' key takes you to 'Buy Stop' and if you then press 's' it drops down the menu to 'Show Data Box' as that also starts with 's'.

Any ideas?

PS: I think I solved it - Buy Stop Limit = right click bb + enter

Thanks

Does any one know how to program a hot key to plot executions or not?

:-D

thanks

" I will follow my rules, I will take my stops, I will be disciplined and i will work with the market....NOT AGAINST IT! Professional mind control is the key"
Reply With Quote
  #50 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54



greenr View Post
Does any one know how to program a hot key to plot executions or not?

:-D

thanks

greenr,

In the indicator downloads there is a very nice indy that puts a button on your toolbar and and allows you to turn your executions on and off. It is called Toggle Trades. I think it will be just what you are looking for.

gever17

Reply With Quote




Last Updated on December 1, 2021


© 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