Simulated tick to clock MC. Could it be done

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Simulated tick to clock MC. Could it be done

Postby arjfca » 08 Jul 2011

A Friday afternoon thought..

As I understand, MC is driven by tick coming from the instrument that is plot. No tick or scarce in time tick (low frequency) would then mean variable to not be updated in timely manner. No tick, no variables update.

My Idea, Could it be imaginable to have a new built in instrument programmed in C or other language that would create a simulated tick. This tick could be programmed to be issued on a known time base. Doing that we could be able to have all variables updated in a real time basis instead being timed by the tick clock

Only problem is the simulated instrument would have to be place in Data1 and the regular one be placed in Data2. Orders are issued for Data1 only. (to my understanding)

I'm testing a simple delay printout. A 0.5 second delay. If I display a chart using 1 tick time base, it is easy to see that both printout and charts are updated at the same time. But it is not a tick, tack clock or a regular pace. Fast tick clock, faster printout, lower tick clock, lower printout.

If it is realizable, I don't have the knowledge to create it. If it is a crazy idea, be indulgent, it is Friday after all. :)

A great weekend and good summer vacations for the lucky one.

Martin

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Simulated tick to clock MC. Could it be done

Postby Stan Bokov » 11 Jul 2011

RelalcLastBarAfter(s) where s is the number of seconds is a timer-based calculation. It gets around the need for a simulated tick. It forces the script to recalculate after an 's' number of seconds. Could be 0.5 or 30.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Simulated tick to clock MC. Could it be done

Postby arjfca » 11 Jul 2011

RelalcLastBarAfter(s) where s is the number of seconds is a timer-based calculation. It gets around the need for a simulated tick. It forces the script to recalculate after an 's' number of seconds. Could be 0.5 or 30.
Interesting

Does it take over the complete clock re-calculation. Or it is complementary to the actual bar scale time. I will read about it.

Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Simulated tick to clock MC. Could it be done

Postby arjfca » 11 Jul 2011

RelalcLastBarAfter(s)
It is should be writen: ReCalcLastBarAfter(s) ;)

Martin

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Simulated tick to clock MC. Could it be done

Postby Stan Bokov » 12 Jul 2011

Sorry, typo. Although Relalc sounds funnier.

On a serious note, this word recalculates your script based on a timer, regardless of whether any new ticks were received. So, you are not dependent on the market actually doing anything to force a calculation - useful for those slow ticking symbols and closing positions at the end of the day.

If that's what you are trying to accomplish, this is the word for you. I'm not too sure what you mean with 'complete clock recalculation' and 'complimentary to the bar scale time'.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Simulated tick to clock MC. Could it be done

Postby arjfca » 12 Jul 2011

Thanks Stan

- How do i use ReCalcLastBarAfter(s) and or where do I place it in the code. I don't found any documentation on that.

- What is the lowest (s) value ?

Martin

dblend
Posts: 16
Joined: 11 Jul 2011
Been thanked: 1 time

Re: Simulated tick to clock MC. Could it be done

Postby dblend » 13 Jul 2011

Does it take over the complete clock re-calculation. Or it is complementary to the actual bar scale time. I will read about it.
I am also interested in this question. I think what is being asked is if the running of the code will only run every RecalcLastbarAfter(x) or if new ticks will also cause the signal to recalculate and if so, how will the two recalculation events work together, which takes preference and if a new tick comes in will the RecalcLastbarAfter(x) be reset?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Simulated tick to clock MC. Could it be done

Postby Dave Masalov » 13 Jul 2011

- How do i use ReCalcLastBarAfter(s) and or where do I place it in the code. I don't found any documentation on that.

- What is the lowest (s) value ?
Martin,

This keyword forces the recalculation of the code before the normal recalculation event occurs (i.e. new tick comes in Intra-Bar Order Generation mode). For example it can be used to stop trading at the end of trading session. The lowest value is one second.
Quote:
Does it take over the complete clock re-calculation. Or it is complementary to the actual bar scale time. I will read about it.

I am also interested in this question. I think what is being asked is if the running of the code will only run every RecalcLastbarAfter(x) or if new ticks will also cause the signal to recalculate and if so, how will the two recalculation events work together, which takes preference and if a new tick comes in will the RecalcLastbarAfter(x) be reset?
Martin and dblend,

If you use RecalcLastbarAfter(x), new ticks will also cause the signal to recalculate as usual. If a new tick comes in RecalcLastbarAfter(x) will be reset.


Return to “MultiCharts”