Please note that I am programming in VISUAL BASIC and not with the ninja script. So I am limited to using the API commands found at http://www.ninjatrader-support.com/H...tml?Functions2
I am specifically calling the .command() function to place these orders, as it seems to be the only one that works.
Say I want to place a LIMIT order to sell on a resistance line. Ok so I use the "LIMIT" command as order type, instead of using "MARKET", and I place the order on the resistance line. Well, let's say the market price doesn't go up to touch the entry price for a while, but the market price comes up to within 10 pips of it.... and then my program notices that the resistance line has moved a little bit, so I would like to update my current order, and adjust my entry limit spot, to be where the resistance line is now at...
Now, I'm looking at the command "PLACE", which is what I would have used to initially put in my "LIMIT" order, for entry into the market. I now want to adjust the location of that entry point somewhat, and I see that there is another option instead of "PLACE", I can use "CHANGE"... which I could call, and supply the new limit price....
MY QUESTION: if I call "CHANGE" on an order that is not yet in a live trade, and supply the new limit price, which I intended to be a new price for ENTRY INTO THE TRADE, and just as I'm doing that the market jumps up and touches my entry limit spot, and the trade becomes active... the just that instant, ninja trader receives my "CHANGE" command, which includes a new value for limit price, would not ninja trader think that I was placing a LIMIT FOR EXIT as opposed to a LIMIT FOR ENTRY order, and thereby ninja trader would put in a limit to EXIT the order right on top of where I just got into the trade, which would instantly exit me out of the trade with a loss of spread pips?
If this is the case, then what is the best method for changing a LIMIT FOR ENTRY order, where the program could never mistake it for a LIMIT FOR EXIT order? Should the LIMIT FOR ENTRY order be completely canceled, and a new LIMIT FOR ENTRY order be placed in its stead? I'm sure that would work, however there is the risk that the market could move suddenly while the order cancellation is being processed, and the new order being placed, which would mean that there could be some additional lag and potential loss to do things that way... which lag could be reduced if there is a way to "CHANGE" the order's entry price, without it being potentially confused as an exit price.
I know that's a complicated scenario. If anyone can let me know what the best method for doing this is, I would appreciate it. Thanks!
Aaron
Comment