NexusFi: Find Your Edge


Home Menu

 





Stream Deck Elgato and NinjaTrader8


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one mmaker with 9 posts (6 thanks)
    2. looks_two hedgeplay with 3 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (1 thanks)
    4. looks_4 trendisyourfriend with 1 posts (4 thanks)
      Best Posters
    1. looks_one dph1 with 5 thanks per post
    2. looks_two trendisyourfriend with 4 thanks per post
    3. looks_3 Koepisch with 3 thanks per post
    4. looks_4 mmaker with 0.7 thanks per post
    1. trending_up 9,965 views
    2. thumb_up 19 thanks given
    3. group 13 followers
    1. forum 22 posts
    2. attach_file 4 attachments




 
Search this Thread

Stream Deck Elgato and NinjaTrader8

  #11 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


SBtrader82 View Post
Quite interesting, I noticed that recently the platform ProRealtime also offers a stream deck very similar to that of elgato. It is already setup for the platform. https://www.prorealtime.com/en/stream-deck

I never tried it because I would be scared of any mechanical issue with the keys.
If a button get stuck it might send the same signal again and again.


Sent using the NexusFi mobile app

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.

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
 
  #12 (permalink)
 hedgeplay 
Austin Texas / US
 
Experience: Intermediate
Frequency: Several times daily
Duration: Seconds
Posts: 176 since Dec 2019
Thanks Given: 145
Thanks Received: 211

mmaker thanks for the post.

I have the StreamDeck XL as well but have not yet configured for Ninjatrader.


mmaker View Post
The 12 buttons on the right turn on and off 6 strategies i programmed in Autohotkey (https://www.autohotkey.com/) which in turn puts the cursor in the proper place and click in @NinjaTrader to enable & disable the appropriate strategy.

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?

Thanks!
HedgePlay

Reply With Quote
  #13 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508



hedgeplay View Post
mmaker thanks for the post.

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?

Thanks!
HedgePlay

The third file that tells you where your cursor is called windowspy.ahk

I am not sure where i got it.

copy the attached txt file and save it as an ahk file.

It should work. It should give you window name and mouse cursor coordinates.

Attached Files
Elite Membership required to download: WindowSpy.txt
Visit my NexusFi Trade Journal Reply With Quote
  #14 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


mmaker View Post
I will share this info with the understanding that this tool if used improperly allows one to make bad decisions faster. Just kidding.

Use this pgm to find out the name of your window and where the cursor is active when you build your autohotkey file.

It is called WindowSpy.ahk

I have attached it - first upload attempt failed. Lets see if it works.

I also included my hot key file for my strategies. These work off the relative position of the cursor (relative to the strategy tab in the control center window.
So make sure you sort your strategies in the order you will use them.
I have to ask Ninjatrader to save the strategies in some consistent order so they are in sync with my script but until then i have to remember to ssort them manually.

Anyways this hot key file is customized for my six screen setup and these strategies are positioned in the top left corner of my bottom right screen. YOURS WILL LIKELY BE DIFFERENT.

So you will have to figure out where your strategies usually reside and code their position - but with the window spy pgm it is very easy.

You can have the buy mkt and sell mkt and flatten keys without going through any hotkey script.

I learned enough autohotkey to do this in a few hours just by googling.

Good Luck.

You can also launch ninja and the hotkey file with one button....i just programmed that file this aft so only tested it once. It worked. It is called Start NinjaTrader.ahk

I am not seeing the three files i tried to upload.

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

;START NINJATRADER
;SendInput {Ctrl down} ;Start edit for SafeMode
Run, C:\Program Files (x86)\NinjaTrader 8\bin64\NinjaTrader.exe ;Launch NinjaTrader 8 64 Bit
;Sleep, 30000 ;Wait 30 seconds
;SendInput {Ctrl up} ;End edit for SafeMode
Sleep, 60000 ;Wait 15 seconds

Run, C:\Users\User\Documents\AHK\Start Hot Keys Pgm.ahk
Return

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #15 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508

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

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #16 (permalink)
 hedgeplay 
Austin Texas / US
 
Experience: Intermediate
Frequency: Several times daily
Duration: Seconds
Posts: 176 since Dec 2019
Thanks Given: 145
Thanks Received: 211

mmaker

Thank you for going through the hassles to get this example code posted.

An awesome contribution!

HedgePlay



Reply With Quote
  #17 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


hedgeplay View Post
mmaker

Thank you for going through the hassles to get this example code posted.

An awesome contribution!

HedgePlay



scroll up a few posts for the windowspy file.

I could not find it again so i copied it it as txt.

Just download and save it with an ahk extension in the AHK folder.

It should give you what you need.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #18 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508


hedgeplay View Post
mmaker

Thank you for going through the hassles to get this example code posted.

An awesome contribution!

HedgePlay



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.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #19 (permalink)
 hedgeplay 
Austin Texas / US
 
Experience: Intermediate
Frequency: Several times daily
Duration: Seconds
Posts: 176 since Dec 2019
Thanks Given: 145
Thanks Received: 211

Cool!

Got it all.

Now I need to go blow the dust off the StreamDeck and play around..

Reply With Quote
  #20 (permalink)
 
mmaker's Avatar
 mmaker 
Toronto Canada
 
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508



hedgeplay View Post
Cool!

Got it all.

Now I need to go blow the dust off the StreamDeck and play around..

Glad to help.

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 19, 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