Is there a Timer Class?  [SOLVED]

Questions about MultiCharts and user contributed studies.
justme
Posts: 56
Joined: 08 Jan 2015
Has thanked: 9 times
Been thanked: 3 times

Is there a Timer Class?

Postby justme » 20 Apr 2015

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

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: Is there a Timer Class?  [SOLVED]

Postby orion » 20 Apr 2015

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.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Is there a Timer Class?

Postby TJ » 20 Apr 2015

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

User avatar
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?

Postby JoshM » 21 Apr 2015

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
That code is still based on price events.

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).

justme
Posts: 56
Joined: 08 Jan 2015
Has thanked: 9 times
Been thanked: 3 times

Re: Is there a Timer Class?

Postby justme » 22 Apr 2015

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

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: Is there a Timer Class?

Postby orion » 23 Apr 2015

As Josh and I said, the only way to do this is to use RecalcLastBarAfter() and AllowSendOrdersAlways.

justme
Posts: 56
Joined: 08 Jan 2015
Has thanked: 9 times
Been thanked: 3 times

Re: Is there a Timer Class?

Postby justme » 23 Apr 2015

Thanks.


Return to “MultiCharts”