Fake Tick would be helpful.

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 1980
Joined: 21 Jul 2007
Has thanked: 156 times
Been thanked: 395 times

Fake Tick would be helpful.

Postby bowlesj3 » 25 Nov 2008

Hi,

I trade two futures contracts and one of them does not trade overnight. It would be handy to have a feature that allows us to issue a fake tick (which matches the last price tick of the day) which causes the EL code to execute. Useful for off hours testing and next day preparation.

Thanks,
John.

drwar
Posts: 218
Joined: 31 Jul 2005

Re: Fake Tick would be helpful.

Postby drwar » 25 Nov 2008

[quote]Hi,

I trade two futures contracts and one of them does not trade overnight. It would be handy to have a feature that allows us to issue a fake tick (which matches the last price tick of the day) which causes the EL code to execute. Useful for off hours testing and next day preparation.

Thanks,
John.[/quote]

John
LastbaronChart will do that for you. You can control one execution of your code based on it triggering on your last complete bar.

J~

bowlesj3
Posts: 1980
Joined: 21 Jul 2007
Has thanked: 156 times
Been thanked: 395 times

Postby bowlesj3 » 25 Nov 2008

hi drwar,

I don't think I worded my question correctly. If no ticks are coming it at 8pm at night when the market closes at 4:15pm how is any code going to execute? It can't since it needs a tick to execute. Basically I am thinking that if a function key was set up to send a fake tick through (but one that does not get written to the database of course) it could trigger the code to execute. Of course certain tests could not be performed come to think of it. In that case a replay would be needed. In my immediate need a single fack tick is all I would need. I am just starting to wonder if a backtest run could be used (even though I don't use the backtesting feature ever).

John.

drwar
Posts: 218
Joined: 31 Jul 2005

Postby drwar » 25 Nov 2008

[quote]hi drwar,

I don't think I worded my question correctly. If no ticks are coming it at 8pm at night when the market closes at 4:15pm how is any code going to execute? It can't since it needs a tick to execute. Basically I am thinking that if a function key was set up to send a fake tick through (but one that does not get written to the database of course) it could trigger the code to execute. Of course certain tests could not be performed come to think of it. In that case a replay would be needed. In my immediate need a single fack tick is all I would need. I am just starting to wonder if a backtest run could be used (even though I don't use the backtesting feature ever).

John.[/quote]

John
I believe I understood you exactly. I am not sure you understood my answer. Let me elucidate.

if sometime after 4:15pm when no ticks are coming in you load a chart with an indicator or signal code on it. If the relevant portions of the code is enclosed in logic triggered by Lastbaronchart. Those portions of the code will trigger once and only once when the lastbaronchart function triggers true.
... and of course if the chart is already up you can set the status of the indicator off and back on to force it to trigger just once again.

What happens is the following. When applying an indicator on "history bars"
an indicator will be triggered by the close of every history bar. We do not want signals triggering on history bars for automation so this is filtered by using lastbaronchart. The same technique works for indicators as well. So by ignoring all the irrelevent closes and detecting the lastbaronchart chart you have your fake tick when lastbaronchart is detected even tho no realtime ticks are coming in.

J~

bowlesj3
Posts: 1980
Joined: 21 Jul 2007
Has thanked: 156 times
Been thanked: 395 times

Postby bowlesj3 » 25 Nov 2008

I see what you are saying now. It makes sense except the study I am using already has the lastbaronchart built into its processing. However you have given me an idea. If I could trick it to do the current last bar bar on chart one bar early (specifically the second last bar on chart) then your idea might work. I could probably do that a number of ways (at least two ways).

Thanks,
John.

drwar
Posts: 218
Joined: 31 Jul 2005

Postby drwar » 25 Nov 2008

[quote]I see what you are saying now. It makes sense except the study I am using already has the lastbaronchart built into its processing. However you have given me an idea. If I could trick it to do the current last bar bar on chart one bar early (specifically the second last bar on chart) then your idea might work. I could probably do that a number of ways (at least two ways).

Thanks,
John.[/quote]

If it already has it built in then just turn the study off and back on . It will process once when it hits lastbaronchart true. Otherwise it would sit there forever until the next lastbaronchart which will not happen until new ticks come in.

J~

bowlesj3
Posts: 1980
Joined: 21 Jul 2007
Has thanked: 156 times
Been thanked: 395 times

Postby bowlesj3 » 25 Nov 2008

Actually it is not that simple. Turning it off and back on resets a few things on the command "firstbaronchart".

This is kind of funny in that we both have lost sight of the original idea which was a new Feature for MC. The study works fine for the e-mini which has ticks over night as you know. However the Canadian market not trading overnight trips it up. So all the study needs is a few fake ticks so I can get things set up and when the real ticks come in I will be right ready bang on the first tick at 9:30.

The study has arrows that I move around and it picks these values up. It needs ticks to find them. So what I am doing at present is writing a study to find these off hours (picks then up when I turn that new study on off hours) and it writes the values out to GVs which are picked up at 9:30 when the live feed comes in. So I have a work around already but I just thought it would be kind of need for everyone if MC has this fake tick feature.

John.


Return to “MultiCharts”