Hi, I have been looking but can't find it. Does MC have a timer Class, like TS? This timer would allow an order to be placed based on a time event and not limited to a bar/price event.
Thanks. Gordon
Is there a Timer Class? [SOLVED]
Re: Is there a Timer Class? [SOLVED]
There is no Timer class in MC. However, you may want to look into RecalcLastBarAfter() and AllowSendOrderAlways keywords. The other option for getting full control of your orders is to write your own broker DLL.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Is there a Timer Class?
Hi, I have been looking but can't find it. Does MC have a timer Class, like TS? This timer would allow an order to be placed based on a time event and not limited to a bar/price event.
Thanks. Gordon
Code: Select all
input:
Order.Time(1100);
if Time = Order.Time
and Buy.Condition = True
then Begin
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Is there a Timer Class?
That code is still based on price events.Hi, I have been looking but can't find it. Does MC have a timer Class, like TS? This timer would allow an order to be placed based on a time event and not limited to a bar/price event.
Thanks. GordonCode: Select all
input:
Order.Time(1100);
if Time = Order.Time
and Buy.Condition = True
then Begin
Adding `RecalcLastBarAfter()` makes it time-based (as Orion already pointed out). I don't know how TS implements the Timer class, but `RecalcLastBarAfter()` requires a minimum value of 100ms. In MultiCharts 9.1, this can be changed with a registry setting (see discussion in the MultiCharts .NET forum here).
Re: Is there a Timer Class?
Thanks guys. I am looking to get away from the "uncertain" event of the price tick, to the "certain" event of a timer. Josh, the TS timer can be set to any value, say 14 seconds prior to the closing time, at 14 seconds prior to the close, the timer fires and we can use that event to say, fire off an order.
So even if there are no price ticks in the last minute of trading, we are assured to be able to place an order (or some other action).
Gordon
So even if there are no price ticks in the last minute of trading, we are assured to be able to place an order (or some other action).
Gordon