NexusFi: Find Your Edge


Home Menu

 





Efficient order execution - Assign Hot Key...


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ratfink with 5 posts (15 thanks)
    2. looks_two frontrunner007 with 4 posts (2 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Fritzk with 1 posts (1 thanks)
    1. trending_up 4,548 views
    2. thumb_up 18 thanks given
    3. group 3 followers
    1. forum 10 posts
    2. attach_file 8 attachments




 
Search this Thread

Efficient order execution - Assign Hot Key...

  #1 (permalink)
 frontrunner007 
Los Angeles/USA
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 5 since Jul 2014
Thanks Given: 8
Thanks Received: 1

Hey guys,

I'm curious if this is even possible, but the idea is to create an automated order entry hotkey to be able to quickly enter an ATM using NinjaTrader. For example, for a long entry assign F9 to buy stop 1 tick above the previous candles high and place a stop below the previous candle's low? For shorting the market it would be the opposite - assign F10 to sell stop 1 tick below the previous candles low and place a stop above the previous candle's high?

Any help would be greatly appreciated.

Cheers

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
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
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
Fritzk's Avatar
 Fritzk 
North America
 
Experience: None
Platform: NT
Trading: Futures
Posts: 1,376 since Jan 2013
Thanks Given: 3,457
Thanks Received: 5,064



frontrunner007 View Post
Hey guys,

I'm curious if this is even possible, but the idea is to create an automated order entry hotkey to be able to quickly enter an ATM using NinjaTrader. For example, for a long entry assign F9 to buy stop 1 tick above the previous candles high and place a stop below the previous candle's low? For shorting the market it would be the opposite - assign F10 to sell stop 1 tick below the previous candles low and place a stop above the previous candle's high?

Any help would be greatly appreciated.

Cheers

NinjaTrader Version 7

Head up and keep your stick on the ice!
Reply With Quote
Thanked by:
  #4 (permalink)
 frontrunner007 
Los Angeles/USA
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 5 since Jul 2014
Thanks Given: 8
Thanks Received: 1

Thanks Fritzk.

But yeah, know about those hot keys.. however, they do not detect previous candle's high/low. I was wondering if this is programmable? And having the order execution utilize this information to submit an ATM.

Started this thread Reply With Quote
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


frontrunner007 View Post
Thanks Fritzk.

But yeah, know about those hot keys.. however, they do not detect previous candle's high/low. I was wondering if this is programmable? And having the order execution utilize this information to submit an ATM.

Yes, it is certainly programmable, built one tonight as a Saturday fun project, mine uses +/- keys, i'll productionise and ship it here next week. Nice idea.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 frontrunner007 
Los Angeles/USA
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 5 since Jul 2014
Thanks Given: 8
Thanks Received: 1

ratfink, you're awesome. thank you. feature request, is it possible to queue the order ahead of time on the local system (not the exchange) before the candle prints and then automagically execute the order immediately following the print? This will eliminate a lot of human error, especially getting in too late or even too early.

P.S. If there's anything I can do to contribute please don't hesitate. I am very appreciative of your time and talents.

Cheers

Started this thread Reply With Quote
  #7 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


frontrunner007 View Post
ratfink, you're awesome. thank you. feature request, is it possible to queue the order ahead of time on the local system (not the exchange) before the candle prints and then automagically execute the order immediately following the print? This will eliminate a lot of human error, especially getting in too late or even too early.

P.S. If there's anything I can do to contribute please don't hesitate. I am very appreciative of your time and talents.

Cheers

Well, for a start the number of stupid things I've done in my life rules out any possibility of awesome, so we can kill that one.

I'm still exploring this whole area so we'll see how I get on and I'm more than happy to work together on it, I'll ship in some code in the next day or two and then you can tell me how I've completely missed the point, lol.

What works so far (in my +/-/Return key test version, should be configurable to any keys/Alts/whatever eventually) is:

Minus key - cancels any pending orders, closes any open positions and, if the current market price is inside the previous bar, immediately sets a sell order at the Low of the previous bar when pressed and, if the order is executed, automatically sets a buy stop order at the saved High of the previous bar when the key was pressed.

Plus key - cancels any pending orders, closes any open positions and, if the current market price is inside the previous bar, immediately sets a buy order at the High of the previous bar when pressed and, if the order is executed, automatically sets a sell stop order at the saved Low of the previous bar when the key was pressed.

Return key - cancels any open orders and exits any open market positions.

Orders are Gtc so can trigger any number of bars after user requested, e.g works well for congestion breakdown/breakout and I think it already works in the way you describe, but I could easily be dumb enough to miss the elephant...

We can discuss options for using Closes rather than Highs/Lows and for using previous bar when executed rather than previous bar when key pressed (but that version resulted in a lot of stops getting hit, so I dropped it for now.)

I will look into targets and see if I can link it more directly into Ninja user built ATM's, I didn't have enough time yesterday to explore.

At the moment it runs in one chart and I visibly monitor the orders and positions in a separate ChartTrader chart (as you can't have a strategy running in a ChartTrader chart)

I will also explore having it as an indicator that hooks into ChartTrader (same as MiniTradePanel does), and optionally drawing the positions in the strategy window if we keep it as a strategy as well, obviously there are pros and cons to each approach.

At the end of the day if/once we have something sensible working anybody can do whatever works best (and safely) for them or we can just evolve it, I'm liking it so far. Obviously all use of such tools is entirely at the users risk.

There may be other tools on the forum that already do this but I wanted to understand the area for my own work anyway so I'm glad you dropped the idea in. Cheers.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
 frontrunner007 
Los Angeles/USA
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 5 since Jul 2014
Thanks Given: 8
Thanks Received: 1

The very fact that you responded with exploratory evidence makes you an awesome individual.

The minus/plus/return key functions are spot on. The return key function is especially helpful for resetting the entry on the fly.

Defining manual targets will more than suffice, although attaching the hotkey to the selected ATM in the NT DOM allows the solution to leverage the rich features already built into the ATM framework. This is certainly not a core requirement, but rather a "nice to have". Pre-defined targets works just fine, too.

I find that the previous candles High/Low (+/- 1 or 2 ticks depending on the time frame) for entries and stops works well for my trading system and rules, but to each is own. Different strokes for different folks. If this is something we could configure it would be incredibly flexible and helpful for many trading styles. I could see where the solution you describe works better for very fast scalping, 1-2 ticks. Tell me if I'm wrong (highly likely).

I too use NT/Jigsaw for order execution, order flow and data, and use TD's TOS (Newbie) for charting - but that's just my preference. I haven't fully migrated from TOS yet.. I'm still doing the "keep repeating until insanity ensues" approach to trading.

I haven't found any tools that do this yet. I've seen some posts on the NT forums but I'll scour around some more because I would hate for you to recreate the wheel.

Best regards.

Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

Hi @frontrunner007, I appreciate the kind words, thank you.

Have done some more building and exploring and as of today I am ruling out closer integration with the NT Atm strategies, way above my pay grade for now, I sort of glazed over when I got in there ... It looks like a lot of work to get something that I would be comfortable with and I've already got too much on the go for this year.

However, it doesn't seem to be a big deal, a simple lean mean solution may be enough. I have done extensive testing of the core approach today (only on 20X-30X Fdax replay data of course) and it seems to stand up for itself. The SetStopLoss/SetTargetPrice OCO now goes in with the order as per Ninja and in the current version I've also added a chase mode which uses the current developing bar's H/L rather than the previous, this seems surprisingly effective. Alt-key separates the two modes, chase uses fixed 8/16 tick stop/targets, not the 1-2 you suspected

I'll do some more testing tomorrow and make it a bit more configurable, then you can have a play. I was assuming that anybody wanting sophisticated stuff would be using one of the high-faluting Jigsaw/9G/etc DOMs anyway.

Cheers for now and thanks again for kicking this off, I've had fun and the cricket was awesome, the cats are happy and the missus is painting. Only bad news is we've run out of vodka, bugger.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



frontrunner007 View Post
The minus/plus/return key functions are spot on. The return key function is especially helpful for resetting the entry on the fly.

I find that the previous candles High/Low (+/- 1 or 2 ticks depending on the time frame) for entries and stops works well for my trading system and rules, but to each is own. Different strokes for different folks. If this is something we could configure it would be incredibly flexible and helpful for many trading styles.

A lot is working now and I have decided to polish it more than I originally intended for the selfish reason (often the best reason ) that it seems to be beneficial to my own trading, encouraging me to participate a lot more in breakout and with-trend momentum trades than I normally would. This was an outcome I did not expect so thank you, it has reminded me of a time a friend and I got hold of some old 80's synthesisers and each time you pressed a key on a new one it instantly created a mental shot of the song or group that was created by it's existence.

The Alt key switch for previous bar or current bar is now replaced by the Ctrl key - for the simple reason that there is a horrible Ninja<->Windows bug in mouse/key handling where a (fake) mouse leave event can get generated up to 200ms after an Alt-key up event, this is a stateful strict no-no and can't be countered as genuine mouse leave events can also occur in the same time frame. I use mouse enter/leave events and gotfocus tests to enable or disable the key trader and it's visible display.

I have attached some example shots of where it's at now, that will be extended today and, as the markets seem to have gone into a jumpy summer mode, I'm happy tidying it up for my own use and anybody else who wants to try it and will create a new support thread when done and link to it in here.

I may re-investigate more complex Atm integration at some future time but it doesn't seem necessary for now.

Cheers.

Travel Well
Attached Thumbnails
Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h23m4s.png
Views:	207
Size:	11.6 KB
ID:	153592   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h23m7s.png
Views:	189
Size:	11.6 KB
ID:	153593   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h23m22s.png
Views:	182
Size:	11.9 KB
ID:	153594   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h25m6s.png
Views:	179
Size:	13.3 KB
ID:	153595   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h25m17s.png
Views:	199
Size:	13.3 KB
ID:	153596   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h25m21s.png
Views:	177
Size:	13.2 KB
ID:	153597   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h25m34s.png
Views:	181
Size:	14.9 KB
ID:	153598   Click image for larger version

Name:	0 FDAX 09-14 3 Min 6h25m52s.png
Views:	185
Size:	15.4 KB
ID:	153599  
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on August 20, 2014


© 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