The ordercreator method seems to be protected and unable to be called in CalcBar
I want to be able to create Order objects on the fly, how do I do that?
Thanks and regards,
drolles
can't create order objects on the fly
Re: can't create order objects on the fly
As far as I know, you don't do that. I do not really know much of the details about what actually happens behind the scenes with Order objects, but the general approach is to create your order objects in Create() and send them in CalcBar(). Behind the scenes I do not know what that actually translates to with the broker, ie. does this mean orders are cancelled and re-submitted thus changing your position in the queue? I don't know, but I would hope it is smart enough to NOT do this.The ordercreator method seems to be protected and unable to be called in CalcBar
I want to be able to create Order objects on the fly, how do I do that?
Thanks and regards,
drolles
Re: can't create order objects on the fly
MidKnight,
Thanks for the reply.
Possibly I’m coming at this with assumptions from OpenQuant but how do I know the conditions of each owner at the time of creation?
Are we in a managed vs unmanaged situation here
What about if I need to adjust a target level of a limit order? How do I do that in CalcBar?
Cheers,
drolles
Thanks for the reply.
Possibly I’m coming at this with assumptions from OpenQuant but how do I know the conditions of each owner at the time of creation?
Are we in a managed vs unmanaged situation here
What about if I need to adjust a target level of a limit order? How do I do that in CalcBar?
Cheers,
drolles
Re: can't create order objects on the fly
If you are using a target limit order to exit an open position, your code will need a IOrderPriced object that you will Send(price) every time in CalcBar(). If you want to change the price, then simply modify the value you Send() -- does that make sense?
Re: can't create order objects on the fly
Thanks MK.
Ok, that does make sense. Perfect sense. I’ve looked these up in the PL Language Ref. Perfect. Can I control when these orders expire?
The thing I don’t understand is how you determine what orders are being generated by your strategy: viewtopic.php?f=19&t=11664
Cheers,
drolles
Ok, that does make sense. Perfect sense. I’ve looked these up in the PL Language Ref. Perfect. Can I control when these orders expire?
The thing I don’t understand is how you determine what orders are being generated by your strategy: viewtopic.php?f=19&t=11664
Cheers,
drolles
Re: can't create order objects on the fly
MK, I’ve looked further into this.
I’ve found the order expiry property within the TradeManager class for orders.
I’m a little confused here. In OpenQuant (and other platforms) the backtester simulator acts like a broker, the backtester here seems to be behaving like something else.
What’s the function of the trade manager class Order object as opposed to the Order object in the PowerLangauge Namespace? I’ve found a thread which looks to create event / methods which track things like order fills (viewtopic.php?f=19&t=10698). I’m confused as to why you would create those things…?
Can the TradeManager class be used in backtest?
Cheers,
drolles
I’ve found the order expiry property within the TradeManager class for orders.
I’m a little confused here. In OpenQuant (and other platforms) the backtester simulator acts like a broker, the backtester here seems to be behaving like something else.
What’s the function of the trade manager class Order object as opposed to the Order object in the PowerLangauge Namespace? I’ve found a thread which looks to create event / methods which track things like order fills (viewtopic.php?f=19&t=10698). I’m confused as to why you would create those things…?
Can the TradeManager class be used in backtest?
Cheers,
drolles
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: can't create order objects on the fly
PowerLanguage Backtester works differently from the broker simulators. On a study calculation a set of orders is generated. Orders live until the next study calculation. To continue sending orders they should be generated on each calculation. The orders are not actually sent, that is why there are no cancelled/rejected orders.I’m a little confused here. In OpenQuant (and other platforms) the backtester simulator acts like a broker, the backtester here seems to be behaving like something else.
TradeManager class cannot be used in backtesting. TradeManager provides access to the Order and Position Tracker window that contains information only regarding actual trades generated and sent to the broker.Can the TradeManager class be used in backtest?
Re: can't create order objects on the fly
Thanks for that. I don't understand what you mean by "next study calculation". Do you mean each time CalBar is run?PowerLanguage Backtester works differently from the broker simulators. On a study calculation a set of orders is generated. Orders live until the next study calculation. To continue sending orders they should be generated on each calculation. The orders are not actually sent, that is why there are no cancelled/rejected orders.
Thanks. As per my other thread this is industry standard functionality to see the orders generated by your strategy in backtest (viewtopic.php?f=19&t=11664).TradeManager class cannot be used in backtesting. TradeManager provides access to the Order and Position Tracker window that contains information only regarding actual trades generated and sent to the broker.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: can't create order objects on the fly
Yes, that is correct.Thanks for that. I don't understand what you mean by "next study calculation". Do you mean each time CalBar is run?