Calling on Advanced C# Ninja Coders -- to finish ClickTrade
I'm trying to finish a NinjaTrader "ClickTrader" indicator, for scalpers, that lets me enter an order at the click point, with just one mouse click, and also exit any position and/or pending order when the Space key is pressed.
I have the skeleton complete and working (see attachment)
BUT I'm having trouble with the trade interface. I have used OIF files in the past but would prefer not.
I would like to use NTDirect.dll or NinjaTrader.Client.
But I am not sure how to get them linked into the indicator. I'm unable to reference NinjaTrader.Client. It appears to have conflicts with other Ninja DLLs. (So far no resolution on the NT forum)
I've looked at indicator code in futures.io (formerly BMT) that submits orders but I don't understand how either NTDirect or NinjaTrader.Client are bound to the indicator, and how to call them.
If someone can help me with this part I will put the finished indicator on futures.io (formerly BMT).
Here is what it should do:
Left Mouse + Shift = Submit a Long ATM order at the clicked price
Left Mouse + Control = Submit a Short ATM order at the clicked price
Space Bar = CLOSE ALL POSITIONS FOR THIS INSTRUMENT AND CANCEL ANY PENDING ORDERS
Well, I would like to finish this if possible.
The debugging code is all there (print statements) to verify the execution.
you can't access the ATM strategy feature (and Methods) without being in the strategy namespace - which isn't usable alongside the charttrader.
To enter orders from an indicator, you have to use the order method from the account object which is a complete unmanaged order.
You can find an example here: https://futures.io/download/vip_elite_circle/900-download.html?view
It's possible to track the order and send SL and TP orders after fills - but everthing must be done by yourself.
the other possibility is to exchange your entry information between your indicator and a background strategy running on a different chart window, by a gobal static object or some other kind of exchange function (some use files).
Actually, I have a third party paid software called ClickTrader that does exactly what I'm trying to do, so there must be some way to accomplish it.
And I have used OIF files from an indicator to close positions and that works well.
My preference is to only have software I write running inside NinjaTrader, so that if a vender disappears my trading is not impacted. Also, if there is a bug I can fix it, or if I want a new feature I can do it myself without a petition to the developer.
I have read the indicator you mention, ChartTraderIndicator, but do not see how it is linking to an order engine...I only see this
Order o = a.CreateOrder(Instrument,OrderAction.Buy,OrderType.Limit,TimeInForce.Day,quantity, (double)nudBuyLmtPr.Value,0,"","Buy");
but have no idea where the methods CreateOrder and Submit are hosted. They are not Ninja commands, and there is no entry in the declaratives, it seems.
I have an external hot key manager I use a lot and is great. HotKeyBoard. Very useful. I use it for all sorts of things like clearing drawn objects with one key combo, changing chart preferences, et cetera.
But it has no ability to know what the price is at a mouse click then submit an order.
I use the Ninja Hotkeys also, but I don't see that it can either know the price at a mouse click.
Can the Ninja Hotkeys know the price at a click on Charttrader?