[QM] Is there a way to edit the data values?

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

[QM] Is there a way to edit the data values?

Postby 2haerim » 19 Jun 2009

In TS2ki's GlobalServer, modifying values for the data is possible(see the attached), but QuoteManager does not provide a way to modify some of all of the data stored in the local database. For example, when a futures symbol rolls over the next one, we need to adjust the gap between preivous and current futures symbol values.

If it is not possible, any external program to manipulate the QM's local database files would be an alternative.



Anyway to do it?

HR
Attachments
TS2ki_GS_Allows_Modify_Data.PNG
TS2ki_GS_Allows_Modify_Data.PNG (126.52 KiB) Viewed 216 times

bowlesj3
Posts: 1977
Joined: 21 Jul 2007
Has thanked: 155 times
Been thanked: 395 times

Postby bowlesj3 » 20 Jun 2009

Actually this idea of connecting futures quarterly data is interesting. These questions come to mind. Do very many traders actually trade that long a time span? (most are probably day traders or short term swing traders I would think). If they do hold over rollovers what considerations does their systems take into account regarding the price difference across contracts and do they actually want an adjustment? Is it not best to deal with the reality of what futures actually do? Also if it is just a matter of being able to do one backtest run rather than having to restart the backtest over and over again for new contracts could that not be programmed in to test a series of futures contracts over a period of many years all in one run (in other words the traders systems automatically close out contracts before roll over, the backtest run closes the old contract and opens the next file and processes the new contract totaling all stats once again). Therefore there is no need to connect futures contacts to do backtest over 20 years of contracts because MC simulates the rollover process by closing one contract and opening the next and maintaining the individual trade result statistics for the reports at the end of the run. I don't think this is a major programming effort actually (not minor but also not major). To me MC should be programmed to reflect reality rather than doctoring the data. It could even force an open position to close on the day the contract actually expires and report this to the trader in the backtest report. Does someone actually have a computerized system that actually does an automatic rollover? It this actually happens maybe MC could open a new contract when it starts and close out the old on expiry all as part of its 20 years backtest run. Why not?

I don't have the answer nor the need for such a feature. I was just curious and thought that it might be something those who do may want to consider as a feature.

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 20 Jun 2009

I trade the HSI, which is a monthly contract.

My indicators go back 200+ period.

It would be nice to string 3 contracts together so that there is some continuity to the indicators.



But I don't think a Rollover feature requires you to edit your database.

bowlesj3
Posts: 1977
Joined: 21 Jul 2007
Has thanked: 155 times
Been thanked: 395 times

Postby bowlesj3 » 20 Jun 2009

What is HSI and why is it so short a contract?

I guess at this point, to satisfy 2haerim's question, to adjust the data would require an export to ascii, a home grown program to make the adjustments to the older data then MC would have to bring that adjusted file in via ascii. The kind of home grown program for the adjusting like a database program could be used to create. A home grown program like that in VBA is fairly easy. Even excel VBA could do it.
Last edited by bowlesj3 on 20 Jun 2009, edited 1 time in total.

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 20 Jun 2009

HSI is the Hong Kong Heng Sang Index.

The futures contract is only a month long.
i.e. they have 12 monthly contracts a year, which makes rollover a pain.

bowlesj3
Posts: 1977
Joined: 21 Jul 2007
Has thanked: 155 times
Been thanked: 395 times

Postby bowlesj3 » 20 Jun 2009

Maybe they want you to hold for a short period of time to generate more commissions. Even 3 months is too short for me but not because I hold that long.

At least it is easier than rolling a stone (that is kind of a play on words - not the market) :wink:

janus
Posts: 747
Joined: 25 May 2009
Has thanked: 41 times
Been thanked: 83 times

Postby janus » 20 Jun 2009

There is no perfect solution as it depends on your trading style and length. For very short term trading, futures is probably good enough. The problem arises when you are a medium to long term trader.

My approach for longer term charting is to create a perpetual contract as follows. At the end of each day I take the difference between the closing cash (eg, DOW) and the corresponding forward futures (eg, mini DOW futures) and adjust the futures accordingly for the day and night sessions. The result is it takes into account the carry costs, dividends adjustment, etc. and converts it to the equivalent of a 1 day expiry futures contract. Rollovers are then smoothed out. The best approach is for the DOW cash to trade the same time as the futures round the clock and just use the cash price as I find it better for most trading systems. However, since the cash doesn't trade round the clock we are stuck with futures for applying the study. Another approach is to use the cash during the day session and switch to the futures (with the adjustment as above) for the night session.

I haven't settled down on a particular approach as yet as I'm still trying other ideas.

bowlesj3
Posts: 1977
Joined: 21 Jul 2007
Has thanked: 155 times
Been thanked: 395 times

Postby bowlesj3 » 21 Jun 2009

Hi Janus,

I don't fully understand your explaination but that isn't really important for this question. Does your trading system do an actual computerized roll over? In other words, do you have the current futures contract on a chart as well as the next futures contract on that same chart and (based upon any criteria that you have programmed at the moment) the study may decide to sell the old contract position and open a position in the new contract (a roll over) rather than just close out the old position?

What is interesting about this is such a study is going to need a way of not testing for the future contract unless it is actually out there on the chart and at some point the trader is going to have to make the symbol changes to the chart while the system is out of the market.

I suggested above how 2haerim could get what he wanted but that was only for backtesting off ascii data and it would work if he never does computerized or even manual roll overs in his system. If his system was to do an actual computerized roll over based upon these backtests then this adjusted data would have to somehow be brought into the historic portion of the live feed. I have no idea how to do this. I tried to merge data once with IB data (without any adjustments) and it screwed up the database. It sort of worked but not totally. The problem is that daily bars are a different data stream than the minute bar data (I think it is actually the backfill that is different and the current daily bar for the current live data is being built off the same data as the minute bars). At night I think IB is consoidating the tick data into a small record for each daily bar to save space. I suspect MC is merging this with the live feed to create the current live daily bar. I say this because when you close MC at night the current daily bar vanishes and reappears okay the next morning after backfilling is done. This is probably why you can't merge that adjusted ascii data back in to the live feed. That is my best guess.

My guess is very few if any are actually doing this fully computerized roll over. That is why I am curious if you are actually doing it.

John.

janus
Posts: 747
Joined: 25 May 2009
Has thanked: 41 times
Been thanked: 83 times

Postby janus » 21 Jun 2009

I understand your situation about how to roll over open contracts, I''m still testing my system and haven't begun tackling the issue of rollovers as yet. Once I've completed my studies, I might use global variables or some other way to "communicate" from one study to another to carry out the rollover - perhaps. For starters I'll just do things manually when the contract is about to expire. I may not bother automating it as it doesn't happen often enough to justify the extra work. If I'm not busy doing other things I may put the effort into automating it just for the fun of it.

bowlesj3
Posts: 1977
Joined: 21 Jul 2007
Has thanked: 155 times
Been thanked: 395 times

Postby bowlesj3 » 21 Jun 2009

Hi Janus

Sounds like a very practical and smart approach to me.

John.

traderstuff
Posts: 68
Joined: 24 Jul 2005

Postby traderstuff » 22 Jun 2009

This subject about "rollovers', "perpetual future contracts", "continuous contracts" etc has been going on here for many years, including just what the best all around method would be, or if there should be multiple choices available.

I am not sure just what methodology the TSS folks are going to use, but I believe it was a couple of months ago in April that Andrew Kirillov relayed on this forum the following -

"MultiCharts 6 will be released in July-August and will have many major features like data playback, spreads, futures rollovers, get-inside bar backtesting and tracking center."


So it seems apparent that this item, along with other much wanted features will be soon forthcoming.

Thanks, TS SUPPORT team!


Return to “MultiCharts”