Hello.
I am having problems referencing that most latest timestamp of a foreign symbol in real time database (in this instance the spy with interactive brokers plug-in). Based time interval set in database is 1min.
The function I have written below just returns the timestamp from what ticker is shown in the chart pane window. It also just returns whatever timeframe the chart pane window is in at the time, not the one-minute timestamp as requested in the timeframeset(in1minute) function.
function timestamp()
{
_TRACE( "#Function Timestamp has been called");
SetForeign("SPY");
TimeFrameSet(in1Minute);
TimeStamptime = LastValue(TimeNum());
_TRACE( "#Timestamp in function is" + timestamptime);
TimeFrameRestore();
RestorePriceArrays();
return timestamptime;
}
_TRACE( "#Timestamp out of function is" + timestamp());
I did try
TIMESTAMPTIME = GetRTDataForeign( "Updatetime" ," SPY" );
but this gave me an empty/null answer from IB, and seems like a slow way of going about it.
From the notes for the foreign function in the AFL reference it seems that the foreign function synchronises the data with the currently selected symbol in the chart pane, hence timenum() returns timestamp synchronised to current symbol in chart pane.
What I'm chasing is a function I can call from the main program to basically get the market clock for trading times irrespective of what symbol or timeframe is in the chart pane window. I would prefer not to use the now() function as I would rather reference the exchange time not my computer time.
Any help would be much appreciated.
Cheers Brent
Posted by: poo1971@yahoo.com.au
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon