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?
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.
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.
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.
Last edited by ratfink; August 17th, 2014 at 08:45 AM.
The following 2 users say Thank You to ratfink for this post:
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.
The following 2 users say Thank You to frontrunner007 for this post:
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.
The following 3 users say Thank You to ratfink for this post:
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.
The following 5 users say Thank You to ratfink for this post: