Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
For regular hotkeys.....I guess that could happen if you splashed a sugary drink on the keyboard making the keys sticky but other than that i think you would be pretty safe. Out of the box I would not be worried about that. They function well.
For my strategies I have a flag coded in C# that once the trade is fired that is it. No additional order will be submitted even if the strategy remains enabled. The only way for that strategy to submit another order is to disable the strategy, re-enable the strategy and wait for the price action to trigger the strategy again.
Can you help answer these questions from other members on NexusFi?
I have the StreamDeck XL as well but have not yet configured for Ninjatrader.
There is a large collection of resources for AutoHotKey that look to be prior to Windows 10 context. Somewhere in the vast historic postings on AutoHotKey I picked up the notion that Autohotkey would be a no-go with NT8's WPF environment.
Would you posting tips or links on where I can find good discussion or code examples to help me grow in skills of integrating Autohotkey with NT8?
Copy the following and save it with the file extension .AHK
It is called Start NinjaTrader.AHK
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay 10 ;Set the keyboard time delay to 10 milliseconds
CoordMode, Mouse, Screen ;Set all mouse clicks to be absolute positioning to the screen & not relative.
;START NINJATRADER 8, GOTO STRATEGIES TAB, SELECT ALL STRATEGIES, ENABLE, GOTO POSITIONS TAB
SetTitleMatchMode, 2 ;Look for a partial name match in the available window's title bar
;CLICK ON DESKTOP
Sleep, 1000 ;Wait 5 seconds
Click 250, 550 ;Click in Desktop Area to establish a starting point
Sleep, 1000 ;Wait 5 seconds
This file contains the script for launching my strategies on a 6 monitor setup.
The strategies are visible in the strategies tab in the top left (in the Control Center window - Strategies Tab) of the bottom right screen.
Save this in a folder called AHK under DOCUMENTS
Call the file Start Hot Keys Pgm.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay 10 ;Set the keyboard time delay to 10 milliseconds
CoordMode, Mouse, Screen ;Set all mouse clicks to be absolute positioning to the screen & not relative.
;Buy Dots
^!A::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 75 ;Left click on the Top Strategy
Sleep, 100 ;Wait 200 milliseconds
Click right 1990, 75 ;Right Click on the Top Strategy
Sleep, 100 ;Wait 200 milliseconds
Click 2040, 175 ;Left Click on Enable Option
Return
;Kill Dots
^!B::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 75 ;Left click on the Top Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 75 ;Right Click on the Top Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 195 ;Left Click on Enable Option
Return
;Sell Dots
^!C::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 95 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 95 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 195 ;Left Click on Enable Option
Return
;Kill Dots
^!D::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 95 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 95 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 215 ;Left Click on Enable Option
Return
;Buy 21
^!E::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 115 ;Left click on the Strategy
Sleep, 100 ;Wait 200 milliseconds
Click right 1990, 115 ;Right Click on the Strategy
Sleep, 100 ;Wait 200 milliseconds
Click 2040, 215 ;Left Click on Enable Option
Return
;Kill 21
^!F::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 115 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 115 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 230 ;Left Click on Enable Option
Return
;Sell 21
^!G::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 135 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 135 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 230 ;Left Click on Enable Option
Return
;Kill 21
^!H::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 135 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 135 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 255 ;Left Click on Enable Option
Return
;Buy ST
^!J::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 155 ;Left click on the Strategy
Sleep, 100 ;Wait 200 milliseconds
Click right 1990, 155 ;Right Click on the Strategy
Sleep, 100 ;Wait 200 milliseconds
Click 2040, 255 ;Left Click on Enable Option
Return
;Kill ST
^!K::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 155 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 155 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 275 ;Left Click on Enable Option
Return
;Sell ST
^!L::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 175 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 175 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 275 ;Left Click on Enable Option
Return
;Kill ST
^!M::
WinActivate, Control Center - Strategies ;Activate Control Center
WinWaitActive, Control Center - Strategies ;Wait until the NT Control Center window is displayed
Sleep, 100 ;Wait 100 milliseconds
Click 2169, 360 ;Left click on the Strategies Tab
Sleep, 100 ;Wait 100 milliseconds ;SELECT ALL STRATEGIES & THEN ENABLE
Click 1990, 175 ;Left click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click right 1990, 175 ;Right Click on the Strategy
Sleep, 100 ;Wait 100 milliseconds
Click 2040, 295 ;Left Click on Enable Option
Return
;Move chart up
^!N::
WinActivate, Chart - 200 vol ;Activate Control Center
WinWaitActive, Chart - 200 vol ;Wait until the NT Chart window is displayed
Sleep, 100 ;Wait 100 milliseconds
Send {lctrl down}
Send {lbutton down}
MouseMove, 0, -100, 1, R
Sleep 100
Send {lbutton up}
Send {lctrl up}
MouseMove, 0, 100, 1, R
Return
;Move chart down
^!Q::
WinActivate, Chart - 200 vol ;Activate Control Center
WinWaitActive, Chart - 200 vol ;Wait until the NT Chart window is displayed
Sleep, 100 ;Wait 100 milliseconds
Send {lctrl down}
Send {lbutton down}
MouseMove, 0, 100, 1, R
Sleep 100
Send {lbutton up}
Send {lctrl up}
MouseMove, 0, -100, 1, R
Return
;Capture and save a pic
^!S::
WinActivate, Chart - 200 vol ;Activate Control Center
WinWaitActive, Chart - 200 vol ;Wait until the NT Chart window is displayed
Sleep, 1000 ;Wait 100 milliseconds
Send, {Enter 1}
Return
;GOTO Chart Window and open indicator window
^T::
WinActivate, Chart - 200 vol ;Activate Control Center
WinWaitActive, Chart - 200 vol ;Wait until the NT Chart window is displayed
Sleep, 1000 ;Wait 100 milliseconds
Click 120, 120 ;Left click
Send, ^i ; Open indicator window
Return
On your stream deck box you are just going to save hot keys NOT already devoted to Ninja.
Ctrl + ALT + A
Ctrl + ALT + B
Ctrl + ALT + C
Ctrl + ALT + D etc
Ninja uses ctrl alt O so skip that one.
There is a way to print out current ninja hot keys
you put your cursor over the open hot key window in Ninja and click when the word Print shows up.
I knew nothing about Autohotkey before friday - 3 days ago - so test what you can with a sim account or least risk senario.
If anyone knows how to improve anything i posted or can add to it - i will be happy to hear.
Thanks.
100 is 100 milliseconds or one tenth of a second.
1000 is one second.
if something is not working like you think it should, you might have to right click on the file and select Run as Administrator. I am thinking of the windowspy program here.
Also you will have to look in your system tray on your main window and close the autohotkey program if you modify it, so a new instance can be launched with your new changes.