Stock price data tends to grap people's attention, especially when its in a format that isn't redily accessable to them.
This is a source for nearly realtime, time series data. Google finance uses high resolution data for the graphs at their site, and this linked can be used to get at that source data. I've read that the data can contain errors, or weird offsets, so I don't know if I would plan to trade using this information, but it looks pretty good.
The attached script pulls data for the stock symbol that can be specificed in the open string (maybe someone else can make the dialog). The data can be in a specified time interval, expressed in seconds (below the interval is every 60 sec), for some time interval going back from the current day.
The rest of the script formats the data so it can be graphed.
It might come in handy and if I post it here I'll likely be able to find it again.
// time interval in sec =60&p
// days to go back =18d&
// stock symbol q=GOOG //for google, but others work too
dt = Open( "https://www.google.com/finance/getprices?i=60&p=18d&f=d,o,h,l,c,v&df=cpct&q=GOOG" );
interval = Item( 2, Column( 1 )[3], "=" );
timezone = Item( 2, Column( 1 )[6], "=" );
dateoffset = 2082758400;//66 years and 12 hours
Column( 1 ) << set name( "Stamp" );
Column( 2 ) << set name( "Close" ) << Data Type( Numeric, 2 ) << Set Modeling Type( "Continuous" );
Column( 3 ) << set name( "High" ) << Data Type( Numeric, 2 ) << Set Modeling Type( "Continuous" );
Column( 4 ) << set name( "Low" ) << Data Type( Numeric, 2 ) << Set Modeling Type( "Continuous" );
Column( 5 ) << set name( "Open" ) << Data Type( Numeric, 2 ) << Set Modeling Type( "Continuous" );
Column( 6 ) << set name( "Volume" ) << Data Type( Numeric, 2 ) << Set Modeling Type( "Continuous" );
dt << select rows( {1, 2, 3, 4, 5, 6} );
dt << delete rows();
dt<< new table variable("Date offset in seconds", dateoffset);
dt << New Table Variable( "interval", interval );
dt << New Table Variable( "time zone offset", timezone );
dt << New Column( "temp1", formula( If( Contains( :Stamp, "a" ) > 0, Num( Munger( :Stamp, 1, "a", "" ) ) ) ) );
dt << New Column( "temp2",
formula( If( Row() == 1, :temp1, If( Is Missing( :temp1 ) == 1, Lag( :temp2, 1 ), :temp1 ) ) )
);
dt << New Column( "temp3",
formula(
If( Is Missing( Num( :Stamp ) ) == 1,
0,
Num( :Stamp )
)
)
);
dt << New Column( "temp4",
Numeric,
"Continuous",
Format( "m/d/y h:m:s", 23, 0 ),
Input Format( "m/d/y h:m:s", 0 ),
formula( (:temp3 * :interval + :temp2 + :time zone offset * :interval)+2082758400 )
);
dt << New Column( "Time of Day", Numeric,
"Continuous",
Format( "h:m:s", 12, 0 ),
Input Format( "h:m:s", 0 ),formula( Time Of Day( :temp4 ) ) );
dt << New Column( "Day", Numeric,"Continuous",formula( Day of year(:temp4) ) );
dt:temp4<<set name("Time");
dt<<Graph Builder(
Size( 1018, 572 ),
Show Control Panel( 0 ),
Variables(
X( :Time of Day ),
Y( :Close ),
Y( :High, Position( 1 ) ),
Y( :Low, Position( 1 ) ),
Y( :Open, Position( 1 ) ),
Y( :Volume ),
Overlay( :Day )
),
Elements(
Position( 1, 1 ),
Line( X, Y( 1 ), Y( 4 ), Legend( 13 ) ),
Area( X, Y( 2 ), Y( 3 ), Legend( 15 ), Area Style( "Range" ) )
),
Elements( Position( 1, 2 ), Line( X, Y, Legend( 14 ) ) ),
SendToReport(
Dispatch(
{},
"Volume",
ScaleBox,
{Scale( "Log" ), Min( 100 ), Max( 217855.76 ), Inc( 1 ),
Minor Ticks( 1 )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Stock Trend Chart" )}
),
Dispatch(
{},
"Y title",
TextEditBox,
{Set Text( "Open, Close and High-Low Range" )}
),
Dispatch( {}, "400", LegendBox, {Set Title( "" ), Set Wrap( 0 )} )
)
);