Discussions
»
Product and Service Development
»
Data Related Questions
»
how to write data into a security from another realtime-feed security in realtime situation?
Rank: Member
Groups: Registered, Registered Users Joined: 11/2/2012(UTC) Posts: 15
|
hi! everyone.
i need to explain my situation clearly first.
As the data limit for a security is 65500, my security can only store two days of tick data only.
As i need to calculate average price in each minute and i want to do it by creating an indicator that calculates average price in each minute from the tick data.
The problem is After two days, the more historical data will be erased.
The indicator chart can only display average price of two days only because the price chart can only store two days data.
I am thinking of solving this problem by writing average price per minute into a new security in realtime so that it can display a maximum of 65500 data of average price minute.
How can i do it?
Thank You for helping me!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
The simplest solution would be to pipe the RT data into a database and have the database update the 1M datafile each minute...
In MS, you'd still need to display two charts, tick data and 1M data, and each minute you'd have to reload/refresh the 1M chart each minute (or if done programmatically, each minute the screen will "flash" as the data is updated and the chart redrawn).
More advanced solutions involve the construction of specialised RT servers, or commercial products such as MetaServer.
Of course, gaps in data and backfilling need to be very carefully considered.
If I was going to such trouble, I'd probably just write a whole new application and use this instead?!
wabbit [:D]
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/2/2012(UTC) Posts: 15
|
THANK YOU!
i guess i have to learn some new programming languages now.
really difficult to implement my strategies coz I am not good at programming.
one more question.
when i use moving average on the the price(1 minute chart), there are several options for me to select to calculate moving average- open price,closed price,typical price,etc, but there is no average price
If i want to calculate the moving average using average price, what can i do?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/9/2012(UTC) Posts: 169
|
You could write a custom indicator as follows to calc a 10 period simple MA of this:
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
If you want the true average of the tick data received, you'll have to group the data into their respective minutes ( its safer to assume each minute starts at zero seconds, but this is not necessarily the case for all traders ), sum the data then divide by the number of data points in that time-group.
You could have a "rolling" timeframe on the ticks instead of grouping them into discrete timeframe buckets, this is up to you.
In both cases, although it can be done in basic MSFL, the functionality is more easily implemented as an external function where internal looping is allowed.
wabbit [:D]
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Data Related Questions
»
how to write data into a security from another realtime-feed security in realtime situation?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.