Hi,
I’m getting an Null Object exception when creating an order type in the Create() method.
See screen shot below.
Thanks,
drolles
Null Object exceiption in Create() when creating an order
Re: Null Object exceiption in Create() when creating an orde
Thanks MidKnight for the reminder. PSA.
Cheers,
drolles
Cheers,
drolles
- Attachments
-
- Null Object exception - Create.JPG
- (60.09 KiB) Downloaded 1017 times
Re: Null Object exceiption in Create() when creating an orde
Hi drolles,
You are putting long entry orders into an array? If so, I can assume you have created the array object? At a glance, the OrderCreator call looks fine to me.
As an aside, maybe you can share why you think the long entry orders need to be in array? Maybe my stuff is too simple, but I've yet to have a need to do this.....
You are putting long entry orders into an array? If so, I can assume you have created the array object? At a glance, the OrderCreator call looks fine to me.
As an aside, maybe you can share why you think the long entry orders need to be in array? Maybe my stuff is too simple, but I've yet to have a need to do this.....
Re: Null Object exceiption in Create() when creating an orde
Hi MK,
I’ve used arrays of orders in the past on other platforms. It helps when one is using multiple entries / exits. I had a friend who used to write trading platforms for large institutional, he showed me the trick. In fact he recommended ArrayLists, given their variable sizing feature; but what I’m doing doesn’t require it.
I’m suspecting that there might be a bug that particular OrderCreator method. It was suspicious that it was making the order creator for the short orders. I’ve managed to work around this by using a different order creator (see below).
long_entry_orders[temp_counter] = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, "Long Entry", EOrderAction.Buy));
Cheers,
drolles
I’ve used arrays of orders in the past on other platforms. It helps when one is using multiple entries / exits. I had a friend who used to write trading platforms for large institutional, he showed me the trick. In fact he recommended ArrayLists, given their variable sizing feature; but what I’m doing doesn’t require it.
I’m suspecting that there might be a bug that particular OrderCreator method. It was suspicious that it was making the order creator for the short orders. I’ve managed to work around this by using a different order creator (see below).
long_entry_orders[temp_counter] = OrderCreator.MarketThisBar(new SOrderParameters(Contracts.Default, "Long Entry", EOrderAction.Buy));
Cheers,
drolles
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Null Object exceiption in Create() when creating an orde
Please provide a complete study code for demonstrating this behavior and the workspace you are using.I’m suspecting that there might be a bug that particular OrderCreator method. It was suspicious that it was making the order creator for the short orders.