Profile Picture

GoodTillCancelled

Posted By DrKoch 8 Years Ago
Message
Posted Wednesday November 25 2009
Deep inside my Broker Plugin I can read and react on BrokerOrder.GoodTillCancelled.

But how do I (re-)set this flag in a script.

I use
OpenPosition(PositionSettings) for new positions and
SubmitOrder(OrderSettings) for existing positions. None of these allows access to the GoodTillCancelled flag.

Ideas?


www.finantic.de

Our Trading System at C2: Topaz
Posted Wednesday November 25 2009
These get passed through to the BrokerOrder object. You have access to the setter there.

DrKoch (11/25/2009)
Deep inside my Broker Plugin I can read and react on BrokerOrder.GoodTillCancelled.

But how do I (re-)set this flag in a script.

I use
OpenPosition(PositionSettings) for new positions and
SubmitOrder(OrderSettings) for existing positions. None of these allows access to the GoodTillCancelled flag.

Ideas?
Posted Thursday November 26 2009
???
Sorry, I don't understand...

How can I set *in the script* any "GoodTillCancelled-Flag".

There is no such field in PositionSettings or OrderSettings.

I can't see how I can access the BrokerOrder form my script.

... lost ...



www.finantic.de

Our Trading System at C2: Topaz
Posted Saturday November 28 2009
Sorry, I read that wrong, you said within the script. So now I'm a bit confused, if an order is submitted, how can you reset the GTC flag without resubmitting the order?

DrKoch (11/26/2009)
???
Sorry, I don't understand...

How can I set *in the script* any "GoodTillCancelled-Flag".

There is no such field in PositionSettings or OrderSettings.

I can't see how I can access the BrokerOrder form my script.

... lost ...
Posted Sunday November 29 2009
We don't currently have a way to control this flag. All orders created will have the GoodTillCancelled flag set to true.

Thanks,
Daniel
Posted Thursday April 21 2011
Has there been any changes regarding being able to set GoodTillCancelled in PositionSettings or OrderSettings?

Thanks, Duane
Posted Tuesday April 26 2011
No, there's still no way to set this flag. If you want to turn it off for all of your orders, you could always just modify the broker plugin to ignore the flag.

Thanks,
Daniel
Posted Saturday May 07 2011
How can tif = day be handled in the paper trader? I’m running a system where all orders valid for the day only. The only alternative I see is to cancel all pending orders at the beginning of each new system bar which unfortunately slows the simulation to a crawl. Setting BarCountExit to 0 or -1 still resulted in pending orders from the previous bar executed on the current. Calling SystemData.Broker.SubmitOrder did not result in any trades when working with the paper trader.

Also, can you elaborate on the difference between position.BarCountExit and position.BarsValid?

Thanks, Duane
Posted Thursday May 12 2011
dwebber (5/7/2011)
How can tif = day be handled in the paper trader? I’m running a system where all orders valid for the day only. The only alternative I see is to cancel all pending orders at the beginning of each new system bar which unfortunately slows the simulation to a crawl. Setting BarCountExit to 0 or -1 still resulted in pending orders from the previous bar executed on the current. Calling SystemData.Broker.SubmitOrder did not result in any trades when working with the paper trader.


By default, orders should only be valid for one bar. So if your system bar frequency is daily, by default your orders should be cancelled after one bar. However, if you submit orders in the middle of a bar (ie in response to ticks), RightEdge doesn't count the bar they were submitted in, so they will also be valid for the bar after that.

Cancelling all pending orders shouldn't slow the system to a crawl. How were you cancelling them? If there are a large number of orders with a large number of symbols, it could slow it down if you try to cancel all the orders for all symbols in the NewBar code for each symbol or something.

Also, can you elaborate on the difference between position.BarCountExit and position.BarsValid?

BarsValid is a property of an order, and refers to how long RightEdge should wait before cancelling it if it hasn't been filled. On PositionSettings, it refers to the order used to open the position. BarCountExit is the number of bars after a position has been opened that it should be closed automatically.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems