View Full Version : Unmanaged approach & FromEntrySignal
ScottB
09-13-2010, 07:46 PM
Hi,
I realize NinjaTrader doesn't tie orders together in any way when using the unmanaged approach but it appears that it does not store FromEntrySignal.
I put a signal name in the entry signal parameter in Submit order but when I do a Print at a later point it is empy. Is that the correct behavior?
Short of being able to use that, what would happen if I put a value in OCO in only one entry order? My thought is that I want to tie orders together via something that I get in OnExecution, etc.
If I cannot use either of those two fields, is there any other value I can use? I am trying to tie a pair of OCO exit orders to the original entry order.
Thanks in advance
Scott
NinjaTrader_Bertrand
09-14-2010, 05:24 AM
Hi Scott, correct - there's no signal tracking by NT in this mode, you can supply a signal name but this is just for display purposes and for the BarsSinceEntry / Exit methods going by signal name.
You would need to provide the tieing in your code, if the entry IOrder reports filled you can SubmitOrder() the exit bracket linked via a custom OCO Id.
ScottB
09-14-2010, 06:41 AM
Bertand, thanks for the reply. I am doing what you suggested but need a way to tie everything together based on something in the IOrder.
I found an old post about this and it appears the guy is putting a value (he used the instrument and Time[0] which was causing him problems occasionally) in signal when submitting the order and retrieving that string in OnExecution but I am getting an empty string.
I have order sets as opposed to individual orders so there is a base value that every order in the set needs and then subdivisions within that. This is not for backtesting or anything but I need it to be persistent.
Is there a way to put a value in either signalName or OCO when submitting an entry order such that the information is available in OnExecution?
Thanks
Scott
NinjaTrader_Bertrand
09-14-2010, 07:29 AM
Scott, just tried on my end here in a unmanaged strategy and I can access / print the OCO string property from the IOrder object passed through OnExecution(). Can you perhaps share the code that does not work as you would expect?
ScottB
09-14-2010, 07:41 AM
Bertrand,
It isn't the OCO string, I am using the signalName in SubmitOrder and expecting to get it in OnExecution, OnOrderUpdate, etc. via IOrder.FromSignalName. I also thought IOrder.FromEntryOrder would be persistent through the life of the entry order.
Thanks,
Scott
NinjaTrader_Bertrand
09-14-2010, 07:46 AM
For the entry signal name itself, you would need to work with the entryOrder.Name property, this works here for me as well going unmanaged.
ScottB
09-14-2010, 08:42 AM
As always, you guys know your stuff; that is exactly what I was looking for. Thanks so much.
Scott